-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: export distribution container build artifacts #2186
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -53,7 +53,7 @@ The main points to consider are: | |||||||
|
||||||||
``` | ||||||||
llama stack build -h | ||||||||
usage: llama stack build [-h] [--config CONFIG] [--template TEMPLATE] [--list-templates] [--image-type {conda,container,venv}] [--image-name IMAGE_NAME] [--print-deps-only] [--run] | ||||||||
usage: llama stack build [-h] [--config CONFIG] [--template TEMPLATE] [--list-templates] [--image-type {conda,container,venv}] [--image-name IMAGE_NAME] [--print-deps-only] [--run] [--export-dir EXPORT_DIR] | ||||||||
|
||||||||
Build a Llama stack container | ||||||||
|
||||||||
|
@@ -71,6 +71,8 @@ options: | |||||||
found. (default: None) | ||||||||
--print-deps-only Print the dependencies for the stack only, without building the stack (default: False) | ||||||||
--run Run the stack after building using the same image type, name, and other applicable arguments (default: False) | ||||||||
--export-dir EXPORT_DIR | ||||||||
Export the build artifacts to a specified directory instead of building the container. This will create a tarball containing the Dockerfile and all necessary files to build the container. (default: None) | ||||||||
|
||||||||
``` | ||||||||
|
||||||||
|
@@ -260,6 +262,24 @@ Containerfile created successfully in /tmp/tmp.viA3a3Rdsg/ContainerfileFROM pyth | |||||||
You can now edit ~/meta-llama/llama-stack/tmp/configs/ollama-run.yaml and run `llama stack run ~/meta-llama/llama-stack/tmp/configs/ollama-run.yaml` | ||||||||
``` | ||||||||
|
||||||||
You can also export the build artifacts to a specified directory instead of building the container directly. This is useful when you want to: | ||||||||
- Build the container in a different environment | ||||||||
- Share the build configuration with others | ||||||||
- Customize the build process | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
To export the build artifacts, use the `--export-dir` flag: | ||||||||
|
||||||||
``` | ||||||||
llama stack build --config my-build.yaml --image-type container --export-dir ./my-build | ||||||||
``` | ||||||||
|
||||||||
This will create a tarball in the specified directory containing: | ||||||||
- The Dockerfile (named Containerfile) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
- The run configuration file (if building from a config) | ||||||||
- Any external provider files (if specified in the config) | ||||||||
|
||||||||
The tarball will be named with a timestamp to ensure uniqueness, for example: `<distro-name>_<timestamp>.tar.gz` | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder whether we should not directly export the files as-is, and let the user do the archiving (if needed). If using an archive instead like proposed, I would rethink the UI, and instead of adding an We could also do it all at once, with the danger of including too much magic:
Regardless what we chose, I would not unconditionally add a timestamp, as this might complicate CI handling when both the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the behaviour change to I think this makes even more sense in the context of the other options of |
||||||||
|
||||||||
After this step is successful, you should be able to find the built container image and test it with `llama stack run <path/to/run.yaml>`. | ||||||||
::: | ||||||||
|
||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Maybe break up the overlong line into two and align, like for the
--config
option. However this is not consistent, maybe we should agree on a max. line length for help texts (like 80 or 120)