mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 15:23:51 +00:00
update build.sh
This commit is contained in:
parent
f05347be8f
commit
1e978e16b1
4 changed files with 19 additions and 7 deletions
|
@ -8,8 +8,13 @@ import argparse
|
||||||
|
|
||||||
from llama_toolchain.cli.subcommand import Subcommand
|
from llama_toolchain.cli.subcommand import Subcommand
|
||||||
from llama_toolchain.core.datatypes import * # noqa: F403
|
from llama_toolchain.core.datatypes import * # noqa: F403
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
from llama_toolchain.common.config_dirs import DISTRIBS_BASE_DIR
|
from llama_toolchain.common.config_dirs import DISTRIBS_BASE_DIR
|
||||||
|
from llama_toolchain.common.serialize import EnumEncoder
|
||||||
|
from termcolor import cprint
|
||||||
|
|
||||||
|
|
||||||
def parse_api_provider_tuples(
|
def parse_api_provider_tuples(
|
||||||
|
|
|
@ -32,7 +32,7 @@ class StackRun(Subcommand):
|
||||||
from llama_toolchain.core.package import BuildType
|
from llama_toolchain.core.package import BuildType
|
||||||
|
|
||||||
self.parser.add_argument(
|
self.parser.add_argument(
|
||||||
"distribution",
|
"--distribution",
|
||||||
type=str,
|
type=str,
|
||||||
help="Distribution whose build you want to start",
|
help="Distribution whose build you want to start",
|
||||||
)
|
)
|
||||||
|
@ -40,7 +40,6 @@ class StackRun(Subcommand):
|
||||||
"--name",
|
"--name",
|
||||||
type=str,
|
type=str,
|
||||||
help="Name of the build you want to start",
|
help="Name of the build you want to start",
|
||||||
required=True,
|
|
||||||
)
|
)
|
||||||
self.parser.add_argument(
|
self.parser.add_argument(
|
||||||
"--type",
|
"--type",
|
||||||
|
@ -60,14 +59,22 @@ class StackRun(Subcommand):
|
||||||
help="Disable IPv6 support",
|
help="Disable IPv6 support",
|
||||||
default=False,
|
default=False,
|
||||||
)
|
)
|
||||||
|
self.parser.add_argument(
|
||||||
|
"--run-config",
|
||||||
|
type=str,
|
||||||
|
help="Path to config file to use for the run",
|
||||||
|
)
|
||||||
|
|
||||||
def _run_stack_run_cmd(self, args: argparse.Namespace) -> None:
|
def _run_stack_run_cmd(self, args: argparse.Namespace) -> None:
|
||||||
from llama_toolchain.common.exec import run_with_pty
|
from llama_toolchain.common.exec import run_with_pty
|
||||||
from llama_toolchain.core.package import BuildType
|
from llama_toolchain.core.package import BuildType
|
||||||
|
|
||||||
build_type = BuildType(args.type)
|
if args.run_config:
|
||||||
build_dir = BUILDS_BASE_DIR / args.distribution / build_type.descriptor()
|
path = args.run_config
|
||||||
path = build_dir / f"{args.name}.yaml"
|
else:
|
||||||
|
build_type = BuildType(args.type)
|
||||||
|
build_dir = BUILDS_BASE_DIR / args.distribution / build_type.descriptor()
|
||||||
|
path = build_dir / f"{args.name}.yaml"
|
||||||
|
|
||||||
config_file = Path(path)
|
config_file = Path(path)
|
||||||
|
|
||||||
|
|
|
@ -117,4 +117,4 @@ ensure_conda_env_python310 "$env_name" "$pip_dependencies"
|
||||||
|
|
||||||
printf "${GREEN}Successfully setup conda environment. Configuring build...${NC}\n"
|
printf "${GREEN}Successfully setup conda environment. Configuring build...${NC}\n"
|
||||||
|
|
||||||
$CONDA_PREFIX/bin/python3 -m llama_toolchain.cli.llama stack configure $distribution_type --name "$build_name" --type conda_env
|
$CONDA_PREFIX/bin/python3 -m llama_toolchain.cli.llama stack configure --distribution $distribution_type --name "$build_name" --package-type conda_env
|
||||||
|
|
|
@ -110,4 +110,4 @@ set +x
|
||||||
printf "${GREEN}Succesfully setup Podman image. Configuring build...${NC}"
|
printf "${GREEN}Succesfully setup Podman image. Configuring build...${NC}"
|
||||||
echo "You can run it with: podman run -p 8000:8000 $image_name"
|
echo "You can run it with: podman run -p 8000:8000 $image_name"
|
||||||
|
|
||||||
$CONDA_PREFIX/bin/python3 -m llama_toolchain.cli.llama stack configure $distribution_type --name "$build_name" --type container
|
$CONDA_PREFIX/bin/python3 -m llama_toolchain.cli.llama stack configure --distribution $distribution_type --name "$build_name" --package-type container
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue