mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-21 01:15:10 +00:00
feat(cli): make venv the default image type (#3187)
We have removed conda now so we can make `venv` the default. Just doing `llama stack build --distro starter` is now enough for the most part.
This commit is contained in:
parent
7519ab4024
commit
2e7ca07423
2 changed files with 3 additions and 19 deletions
|
@ -92,15 +92,7 @@ def run_stack_build_command(args: argparse.Namespace) -> None:
|
||||||
)
|
)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
build_config = available_distros[distro_name]
|
build_config = available_distros[distro_name]
|
||||||
if args.image_type:
|
build_config.image_type = 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:
|
elif args.providers:
|
||||||
provider_list: dict[str, list[BuildProvider]] = dict()
|
provider_list: dict[str, list[BuildProvider]] = dict()
|
||||||
for api_provider in args.providers.split(","):
|
for api_provider in args.providers.split(","):
|
||||||
|
@ -137,13 +129,6 @@ def run_stack_build_command(args: argparse.Namespace) -> None:
|
||||||
providers=provider_list,
|
providers=provider_list,
|
||||||
description=",".join(args.providers),
|
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)
|
build_config = BuildConfig(image_type=args.image_type, distribution_spec=distribution_spec)
|
||||||
elif not args.config and not distro_name:
|
elif not args.config and not distro_name:
|
||||||
|
@ -217,8 +202,7 @@ 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
|
||||||
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}",
|
||||||
|
|
|
@ -59,7 +59,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=None, # no default so we can detect if a user specified --image-type and override image_type in the config
|
default=ImageType.VENV.value,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.parser.add_argument(
|
self.parser.add_argument(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue