Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: cover how to deploy and run the built environments #99

Open
ncoghlan opened this issue Dec 5, 2024 · 3 comments
Open

Docs: cover how to deploy and run the built environments #99

ncoghlan opened this issue Dec 5, 2024 · 3 comments
Labels
Category: Documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@ncoghlan
Copy link
Collaborator

ncoghlan commented Dec 5, 2024

Currently the only docs on actually deploying and using the built environments are the list of layer config fields in https://venvstacks.lmstudio.ai/file-formats/#deployed-layer-configuration

Summarising my notes on this from the Discord channel:

  1. Unpack all 3 layers in the same location on the target system (so the directories end up next to each other). For each one, run the post-installation script after unpacking.
  2. Once everything is unpacked, run the application layer's launch module using the -m switch for the Python executable in that environment.

Running the post-installation script when unpacking each layer:

  1. Read the layer config from {env_path}share/venv/metadata/venvstacks_layer.json
  2. Resolve base_python from the layer config relative to the environment folder
  3. Use that resolved path to run {base_python_path} {env_path}/postinstall.py

Running the launch module for application layers:

  1. Read the layer config from {env_path}share/venv/metadata/venvstacks_layer.json
  2. Read launch_module from the layer config
  3. Resolve python from the layer config relative to the environment folder
  4. Use that resolved path to run {python_path} -m {launch_module} (potentially with CLI arguments, depending on the use case)
@ncoghlan ncoghlan added Category: Documentation Improvements or additions to documentation good first issue Good for newcomers labels Dec 5, 2024
@ncoghlan
Copy link
Collaborator Author

ncoghlan commented Dec 5, 2024

There's a lot more to potentially cover, like using layer versioning and the published metadata files to allow the embedding app to make informed decisions about whether it already has a given layer installed, and doesn't need to download it again.

That will be tricky to write before #89 is resolved, though, and is out of scope for this particular issue report. This issue just covers the basic case of "I have built a set of layers and want to deploy them to a target machine"

@ncoghlan
Copy link
Collaborator Author

ncoghlan commented Dec 5, 2024

In the absence of #35 (which suggests turning the docs example into a fully implemented demo), it would also be good to have a worked example of building and deploying the sample project from the test suite.

Both the "assumed knowledge" version (with exact layer version numbers updated as needed):

$ cpython-3.11/bin/python cpython-3.11/postinstall.py
$ cpython-3.11/bin/python framework-scipy@1/postinstall.py
$ cpython-3.11/bin/python app-scipy@1/postinstall.py
$ app-scipy@1/bin/python -m scipy_import

And the platform-and-application independent version that reads the metadata config file.

@ncoghlan
Copy link
Collaborator Author

ncoghlan commented Dec 5, 2024

I've put "good first issue" on this, mainly because "What do you wish the docs had told you before you started?" is a genuinely useful viewpoint here (but also because this doesn't require any deep knowledge of venvstacks internals, just a basic grasp on how to use it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant