From 0c4591a73d8d947e6c3a4ef766259efe88d16e99 Mon Sep 17 00:00:00 2001 From: Charlie Doern Date: Sun, 23 Feb 2025 19:51:30 -0500 Subject: [PATCH] fix: image_name defaults to none since `--image-name` has a default of None, often a user can get `llamastack-None` when using environments like venv and container. currently, the image_name is llamastack- with the value of the flag or the current conda environment. Change this to be either the value of the flag OR the current image_type. So now the default image names are things like: `llamastack-venv` `llamastack-conda` `llamastack-container` Signed-off-by: Charlie Doern --- llama_stack/cli/stack/_build.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llama_stack/cli/stack/_build.py b/llama_stack/cli/stack/_build.py index 666c2e6dd..d26f8ab31 100644 --- a/llama_stack/cli/stack/_build.py +++ b/llama_stack/cli/stack/_build.py @@ -71,6 +71,10 @@ def run_stack_build_command(args: argparse.Namespace) -> None: else: image_name = args.image_name + if not image_name: + image_name = f"llamastack-{args.image_type}" + print(f"No image name provided and could not detect one from environment. Using image_name: {image_name}") + if args.template: available_templates = available_templates_specs() if args.template not in available_templates: