From 58d38ad3fa8ea5b17afa00735cc990a956f62dae Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Tue, 14 Jan 2025 15:36:46 -0800 Subject: [PATCH] no need for dockerfiles --- llama_stack/cli/stack/build.py | 22 +++------------------ llama_stack/distribution/build_container.sh | 12 ++--------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/llama_stack/cli/stack/build.py b/llama_stack/cli/stack/build.py index 5afc96be1..50d1a942c 100644 --- a/llama_stack/cli/stack/build.py +++ b/llama_stack/cli/stack/build.py @@ -81,14 +81,6 @@ class StackBuild(Subcommand): default="conda", ) - self.parser.add_argument( - "--dockerfile-only", - type=bool, - default=False, - action=argparse.BooleanOptionalAction, - help="Whether to generate a Dockerfile only (only valid when image-type is docker)", - ) - def _run_stack_build_command(self, args: argparse.Namespace) -> None: import textwrap @@ -100,12 +92,6 @@ class StackBuild(Subcommand): from llama_stack.distribution.distribution import get_provider_registry - if args.dockerfile_only and args.image_type != "docker": - self.parser.error( - "dockerfile-only flag is only valid when image-type is docker" - ) - return - if args.list_templates: self._run_template_list_cmd(args) return @@ -123,7 +109,6 @@ class StackBuild(Subcommand): self._run_stack_build_command_from_build_config( build_config, template_name=args.template, - dockerfile_only=args.dockerfile_only, ) return @@ -195,7 +180,7 @@ class StackBuild(Subcommand): name=name, image_type=image_type, distribution_spec=distribution_spec ) self._run_stack_build_command_from_build_config( - build_config, dockerfile_only=args.dockerfile_only + build_config, ) return @@ -206,7 +191,7 @@ class StackBuild(Subcommand): self.parser.error(f"Could not parse config file {args.config}: {e}") return self._run_stack_build_command_from_build_config( - build_config, dockerfile_only=args.dockerfile_only + build_config, ) def _generate_run_config(self, build_config: BuildConfig, build_dir: Path) -> None: @@ -284,7 +269,6 @@ class StackBuild(Subcommand): self, build_config: BuildConfig, template_name: Optional[str] = None, - dockerfile_only: bool = False, ) -> None: import json import os @@ -304,7 +288,7 @@ class StackBuild(Subcommand): to_write = json.loads(build_config.model_dump_json()) f.write(yaml.dump(to_write, sort_keys=False)) - return_code = build_image(build_config, build_file_path, dockerfile_only) + return_code = build_image(build_config, build_file_path) if return_code != 0: return diff --git a/llama_stack/distribution/build_container.sh b/llama_stack/distribution/build_container.sh index 6b76646f7..b809a26c0 100755 --- a/llama_stack/distribution/build_container.sh +++ b/llama_stack/distribution/build_container.sh @@ -18,7 +18,7 @@ if [ "$#" -lt 4 ]; then exit 1 fi -special_pip_deps="$7" +special_pip_deps="$6" set -euo pipefail @@ -28,7 +28,6 @@ docker_base=$2 build_file_path=$3 host_build_dir=$4 pip_dependencies=$5 -dockerfile_only=$6 # Define color codes RED='\033[0;31m' @@ -109,6 +108,7 @@ if [ -n "$LLAMA_STACK_DIR" ]; then else if [ -n "$TEST_PYPI_VERSION" ]; then # these packages are damaged in test-pypi, so install them first + echo "Installing fastapi libcst" add_to_docker "RUN pip install fastapi libcst" add_to_docker <