mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-27 18:50:41 +00:00
feat: --image-type argument overrides value in --config build.yaml (#2179)
closes #2162 # test plan run `llama stack build --image-name ollama --image-type <venv/conda/container> --config llama_stack/templates/ollama/build.yaml` and verify venv | conda | container are built.
This commit is contained in:
parent
f02f7b28c1
commit
f40693e720
2 changed files with 3 additions and 1 deletions
|
@ -206,6 +206,8 @@ def run_stack_build_command(args: argparse.Namespace) -> None:
|
||||||
contents = yaml.safe_load(f)
|
contents = yaml.safe_load(f)
|
||||||
contents = replace_env_vars(contents)
|
contents = replace_env_vars(contents)
|
||||||
build_config = BuildConfig(**contents)
|
build_config = BuildConfig(**contents)
|
||||||
|
if args.image_type:
|
||||||
|
build_config.image_type = args.image_type
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
cprint(
|
cprint(
|
||||||
f"Could not parse config file {args.config}: {e}",
|
f"Could not parse config file {args.config}: {e}",
|
||||||
|
|
|
@ -49,7 +49,7 @@ class StackBuild(Subcommand):
|
||||||
type=str,
|
type=str,
|
||||||
help="Image Type to use for the build. If not specified, will use the image type from the template config.",
|
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],
|
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(
|
self.parser.add_argument(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue