This commit is contained in:
Xi Yan 2024-09-25 15:11:51 -07:00
parent 37be3fb184
commit ca7602a642
2 changed files with 4 additions and 3 deletions

View file

@ -95,9 +95,9 @@ class StackBuild(Subcommand):
# save build.yaml spec for building same distribution again # save build.yaml spec for building same distribution again
if build_config.image_type == ImageType.docker.value: if build_config.image_type == ImageType.docker.value:
# docker needs build file to be in the llama-stack repo dir to be able to copy over to the image # docker needs build file to be in the llama-stack repo dir to be able to copy over to the image
llama_stack_path = Path(os.path.relpath(__file__)).parent.parent.parent llama_stack_path = Path(os.path.abspath(__file__)).parent.parent.parent.parent
build_dir = ( build_dir = (
llama_stack_path / "configs/distributions" / build_config.image_type llama_stack_path / "tmp/configs/"
) )
else: else:
build_dir = ( build_dir = (

View file

@ -103,7 +103,7 @@ add_to_docker <<EOF
EOF EOF
add_to_docker "ADD $build_file_path ./llamastack-build.yaml" add_to_docker "ADD tmp/configs/$(basename "$build_file_path") ./llamastack-build.yaml"
printf "Dockerfile created successfully in $TEMP_DIR/Dockerfile" printf "Dockerfile created successfully in $TEMP_DIR/Dockerfile"
cat $TEMP_DIR/Dockerfile cat $TEMP_DIR/Dockerfile
@ -116,6 +116,7 @@ fi
if [ -n "$LLAMA_MODELS_DIR" ]; then if [ -n "$LLAMA_MODELS_DIR" ]; then
mounts="$mounts -v $(readlink -f $LLAMA_MODELS_DIR):$models_mount" mounts="$mounts -v $(readlink -f $LLAMA_MODELS_DIR):$models_mount"
fi fi
set -x set -x
$DOCKER_BINARY build $DOCKER_OPTS -t $image_name -f "$TEMP_DIR/Dockerfile" "$REPO_DIR" $mounts $DOCKER_BINARY build $DOCKER_OPTS -t $image_name -f "$TEMP_DIR/Dockerfile" "$REPO_DIR" $mounts
set +x set +x