address comments, configure within docker file

This commit is contained in:
Xi Yan 2024-09-15 23:16:18 -07:00
parent fd67cfff39
commit e466ec389b
7 changed files with 53 additions and 48 deletions

View file

@ -25,7 +25,8 @@ set -euo pipefail
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
REPO_DIR=$(dirname $(dirname "$SCRIPT_DIR"))
BUILD_DIR=$(dirname $(dirname "$build_file_path"))
DOCKER_BINARY=${DOCKER_BINARY:-docker}
DOCKER_OPTS=${DOCKER_OPTS:-}
TEMP_DIR=$(mktemp -d)
@ -93,7 +94,7 @@ add_to_docker <<EOF
EOF
add_to_docker "ADD $build_file_path ./build.yaml"
add_to_docker "ADD $build_file_path ./llamastack-build.yaml"
printf "Dockerfile created successfully in $TEMP_DIR/Dockerfile"
cat $TEMP_DIR/Dockerfile
@ -107,10 +108,10 @@ if [ -n "$LLAMA_MODELS_DIR" ]; then
mounts="$mounts -v $(readlink -f $LLAMA_MODELS_DIR):$models_mount"
fi
set -x
podman build --network host -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
echo "You can run it with: podman run -p 8000:8000 $image_name"
echo "Checking image builds..."
podman run -it llamastack-local-docker-example cat build.yaml
podman run -it $image_name cat llamastack-build.yaml

View file

@ -21,6 +21,8 @@ if [ $# -lt 2 ]; then
fi
docker_image="$1"
build_file_path="$2"
host_build_dir="$2"
container_build_dir="/app/builds"
podman run -it $docker_image cat build.yaml >> ./$build_file_path
set -x
podman run -it -v $host_build_dir:$container_build_dir $docker_image llama stack configure ./llamastack-build.yaml --output-dir $container_build_dir

View file

@ -155,8 +155,8 @@ class DistributionSpec(BaseModel):
default="local",
description="Name of the distribution type. This can used to identify the distribution",
)
description: str = Field(
default="Use code from `llama_toolchain` itself to serve all llama stack APIs",
description: Optional[str] = Field(
default="",
description="Description of the distribution",
)
docker_image: Optional[str] = None