mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-05 20:27:35 +00:00
bake run.yaml inside docker, simplify run
This commit is contained in:
parent
cb36be320f
commit
6cd3e4183f
3 changed files with 19 additions and 21 deletions
|
@ -29,9 +29,12 @@ SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
|||
REPO_DIR=$(dirname $(dirname "$SCRIPT_DIR"))
|
||||
DOCKER_BINARY=${DOCKER_BINARY:-docker}
|
||||
DOCKER_OPTS=${DOCKER_OPTS:-}
|
||||
REPO_CONFIGS_DIR="$REPO_DIR/tmp/configs"
|
||||
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
|
||||
llama stack configure $build_file_path --output-dir $REPO_CONFIGS_DIR
|
||||
|
||||
add_to_docker() {
|
||||
local input
|
||||
output_file="$TEMP_DIR/Dockerfile"
|
||||
|
@ -99,11 +102,12 @@ add_to_docker <<EOF
|
|||
# This would be good in production but for debugging flexibility lets not add it right now
|
||||
# We need a more solid production ready entrypoint.sh anyway
|
||||
#
|
||||
# ENTRYPOINT ["python", "-m", "llama_stack.distribution.server.server"]
|
||||
CMD ["python", "-m", "llama_stack.distribution.server.server", "./llamastack-run.yaml"]
|
||||
|
||||
EOF
|
||||
|
||||
add_to_docker "ADD tmp/configs/$(basename "$build_file_path") ./llamastack-build.yaml"
|
||||
add_to_docker "ADD tmp/configs/$build_name-run.yaml ./llamastack-run.yaml"
|
||||
|
||||
printf "Dockerfile created successfully in $TEMP_DIR/Dockerfile"
|
||||
cat $TEMP_DIR/Dockerfile
|
||||
|
@ -124,7 +128,10 @@ set -x
|
|||
$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 "Success! You can run it with: $DOCKER_BINARY run -p 8000:8000 $image_name"
|
||||
|
||||
echo "Checking image builds..."
|
||||
$DOCKER_BINARY run $DOCKER_OPTS -it $image_name cat llamastack-build.yaml
|
||||
|
||||
echo "Checking image run..."
|
||||
$DOCKER_BINARY run $DOCKER_OPTS -it $image_name cat llamastack-run.yaml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue