From f40693e7208613b75b7807eeef1418e8007c65b7 Mon Sep 17 00:00:00 2001 From: Matthew Farrellee Date: Fri, 16 May 2025 17:45:41 -0400 Subject: [PATCH] feat: --image-type argument overrides value in --config build.yaml (#2179) closes #2162 # test plan run `llama stack build --image-name ollama --image-type --config llama_stack/templates/ollama/build.yaml` and verify venv | conda | container are built. --- llama_stack/cli/stack/_build.py | 2 ++ llama_stack/cli/stack/build.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/llama_stack/cli/stack/_build.py b/llama_stack/cli/stack/_build.py index c2a19c070..25a234bbe 100644 --- a/llama_stack/cli/stack/_build.py +++ b/llama_stack/cli/stack/_build.py @@ -206,6 +206,8 @@ def run_stack_build_command(args: argparse.Namespace) -> None: contents = yaml.safe_load(f) contents = replace_env_vars(contents) build_config = BuildConfig(**contents) + 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 93e7d9b22..2c402beeb 100644 --- a/llama_stack/cli/stack/build.py +++ b/llama_stack/cli/stack/build.py @@ -49,7 +49,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.CONDA.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(