From 9eb01dd6647a5fa7751e96b97c20698c893d5492 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Thu, 19 Sep 2024 10:26:41 -0700 Subject: [PATCH] Add DOCKER_BINARY / DOCKER_OPTS to all scripts --- .gitignore | 1 + llama_stack/distribution/build_container.sh | 2 +- llama_stack/distribution/configure_container.sh | 5 ++++- llama_stack/distribution/start_container.sh | 5 ++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index db254fa7f..fe3342921 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ dist *.egg-info dev_requirements.txt build +.DS_Store diff --git a/llama_stack/distribution/build_container.sh b/llama_stack/distribution/build_container.sh index 836f9bf19..984e66afa 100755 --- a/llama_stack/distribution/build_container.sh +++ b/llama_stack/distribution/build_container.sh @@ -114,4 +114,4 @@ set +x echo "You can run it with: podman run -p 8000:8000 $image_name" echo "Checking image builds..." -podman run -it $image_name cat llamastack-build.yaml +$DOCKER_BINARY run $DOCKER_OPTS -it $image_name cat llamastack-build.yaml diff --git a/llama_stack/distribution/configure_container.sh b/llama_stack/distribution/configure_container.sh index 68009f8b1..56e45db7e 100755 --- a/llama_stack/distribution/configure_container.sh +++ b/llama_stack/distribution/configure_container.sh @@ -6,6 +6,9 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +DOCKER_BINARY=${DOCKER_BINARY:-docker} +DOCKER_OPTS=${DOCKER_OPTS:-} + set -euo pipefail error_handler() { @@ -25,7 +28,7 @@ host_build_dir="$2" container_build_dir="/app/builds" set -x -podman run -it \ +$DOCKER_BINARY run $DOCKER_OPTS -it \ -v $host_build_dir:$container_build_dir \ $docker_image \ llama stack configure ./llamastack-build.yaml --output-dir $container_build_dir diff --git a/llama_stack/distribution/start_container.sh b/llama_stack/distribution/start_container.sh index ac5fbb565..77b353e6b 100755 --- a/llama_stack/distribution/start_container.sh +++ b/llama_stack/distribution/start_container.sh @@ -6,6 +6,9 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +DOCKER_BINARY=${DOCKER_BINARY:-docker} +DOCKER_OPTS=${DOCKER_OPTS:-} + set -euo pipefail RED='\033[0;31m' @@ -34,7 +37,7 @@ port="$1" shift set -x -podman run -it \ +$DOCKER_BINARY run $DOCKER_OPTS -it \ -p $port:$port \ -v "$yaml_config:/app/config.yaml" \ $docker_image \