-
Notifications
You must be signed in to change notification settings - Fork 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
base: main
Are you sure you want to change the base?
Conversation
dcf3c02
to
c151c80
Compare
Add a new --export-dir flag to the `llama stack build` command that allows users to export container build artifacts to a specified directory instead of building the container directly. This feature is useful for: - Building containers in different environments - Sharing build configurations - Customizing the build process The exported tarball includes: - Containerfile (Dockerfile) - Run configuration file (if building from config) - External provider files (if specified) - Build script for assistance The tarball is named with a timestamp for uniqueness: <distro-name>_<timestamp>.tar.gz Documentation has been updated in building_distro.md to reflect this new functionality as well as integration tests. Signed-off-by: Sébastien Han <[email protected]>
@@ -270,6 +273,50 @@ printf "Containerfile created successfully in %s/Containerfile\n\n" "$TEMP_DIR" | |||
cat "$TEMP_DIR"/Containerfile | |||
printf "\n" | |||
|
|||
# If export_dir is specified, copy all necessary files and exit |
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.
this script is getting very large. I think at the very least we can make this section into a function perhaps?
# Create the archive with all files | ||
echo "Creating tarball with the following files:" | ||
echo "- Containerfile" | ||
[ -n "$run_config" ] && echo "- 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.
nice one liners
edit: although the conditionals get repeated. can you add the echo
as you are building the tar_cmd
?
;; | ||
*) | ||
# Check if argument is a valid directory path (export_dir) or special_pip_deps | ||
if [[ "$1" == *" "* ]] || ! mkdir -p "$1" 2>/dev/null; then |
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.
hm what is this? this looks very dangerous. why are we doing mkdir -p
for checking?!
What does this PR do?
Add a new --export-dir flag to the
llama stack build
command that allows users to export container build artifacts to a specified directory instead of building the container directly. This feature is useful for:The exported tarball includes:
The tarball is named with a timestamp for uniqueness: _.tar.gz
Documentation has been updated in building_distro.md to reflect this new functionality as well as integration tests.
Test Plan