From 89661b984c55e1070b8ab88efd404c869c5e9ccc Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Mon, 18 Aug 2025 15:31:01 -0700 Subject: [PATCH] revert: "feat(cli): make venv the default image type" (#3196) Reverts llamastack/llama-stack#3187 --- llama_stack/cli/stack/_build.py | 20 ++++++++++++++++++-- llama_stack/cli/stack/build.py | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/llama_stack/cli/stack/_build.py b/llama_stack/cli/stack/_build.py index b4ada33e2..c6e204773 100644 --- a/llama_stack/cli/stack/_build.py +++ b/llama_stack/cli/stack/_build.py @@ -92,7 +92,15 @@ def run_stack_build_command(args: argparse.Namespace) -> None: ) sys.exit(1) build_config = available_distros[distro_name] - build_config.image_type = args.image_type + if args.image_type: + build_config.image_type = args.image_type + else: + cprint( + f"Please specify a image-type ({' | '.join(e.value for e in ImageType)}) for {distro_name}", + color="red", + file=sys.stderr, + ) + sys.exit(1) elif args.providers: provider_list: dict[str, list[BuildProvider]] = dict() for api_provider in args.providers.split(","): @@ -129,6 +137,13 @@ def run_stack_build_command(args: argparse.Namespace) -> None: providers=provider_list, description=",".join(args.providers), ) + if not args.image_type: + cprint( + f"Please specify a image-type (container | venv) for {args.template}", + color="red", + file=sys.stderr, + ) + sys.exit(1) build_config = BuildConfig(image_type=args.image_type, distribution_spec=distribution_spec) elif not args.config and not distro_name: @@ -202,7 +217,8 @@ def run_stack_build_command(args: argparse.Namespace) -> None: contents = yaml.safe_load(f) contents = replace_env_vars(contents) build_config = BuildConfig(**contents) - build_config.image_type = args.image_type + if args.image_type: + build_config.image_type = args.image_type except Exception as e: cprint( f"Could not parse config file {args.config}: {e}", diff --git a/llama_stack/cli/stack/build.py b/llama_stack/cli/stack/build.py index 098577c9e..80cf6fb38 100644 --- a/llama_stack/cli/stack/build.py +++ b/llama_stack/cli/stack/build.py @@ -59,7 +59,7 @@ class StackBuild(Subcommand): type=str, help="Image Type to use for the build. If not specified, will use the image type from the template config.", choices=[e.value for e in ImageType], - default=ImageType.VENV.value, + default=None, # no default so we can detect if a user specified --image-type and override image_type in the config ) self.parser.add_argument(