mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-27 18:50:41 +00:00
[CLI] avoid configure twice (#171)
* avoid configure twice * cleanup tmp config * update output msg * address comment * update msg * script update
This commit is contained in:
parent
06db9213b1
commit
62d266f018
3 changed files with 23 additions and 9 deletions
|
@ -137,10 +137,16 @@ class StackBuild(Subcommand):
|
|||
if build_config.image_type == "conda"
|
||||
else (f"llamastack-{build_config.name}")
|
||||
)
|
||||
cprint(
|
||||
f"You can now run `llama stack configure {configure_name}`",
|
||||
color="green",
|
||||
)
|
||||
if build_config.image_type == "conda":
|
||||
cprint(
|
||||
f"You can now run `llama stack configure {configure_name}`",
|
||||
color="green",
|
||||
)
|
||||
else:
|
||||
cprint(
|
||||
f"You can now run `llama stack run {build_config.name}`",
|
||||
color="green",
|
||||
)
|
||||
|
||||
def _run_template_list_cmd(self, args: argparse.Namespace) -> None:
|
||||
import json
|
||||
|
|
|
@ -8,15 +8,17 @@ from enum import Enum
|
|||
from typing import List, Optional
|
||||
|
||||
import pkg_resources
|
||||
|
||||
from llama_stack.distribution.utils.exec import run_with_pty
|
||||
from pydantic import BaseModel
|
||||
|
||||
from termcolor import cprint
|
||||
|
||||
from llama_stack.distribution.utils.exec import run_with_pty
|
||||
|
||||
from llama_stack.distribution.datatypes import * # noqa: F403
|
||||
from pathlib import Path
|
||||
|
||||
from llama_stack.distribution.distribution import api_providers, SERVER_DEPENDENCIES
|
||||
from llama_stack.distribution.utils.config_dirs import BUILDS_BASE_DIR
|
||||
from llama_stack.distribution.distribution import get_provider_registry
|
||||
|
||||
|
||||
|
@ -95,6 +97,7 @@ def build_image(build_config: BuildConfig, build_file_path: Path):
|
|||
build_config.name,
|
||||
package_deps.docker_image,
|
||||
str(build_file_path),
|
||||
str(BUILDS_BASE_DIR / ImageType.docker.value),
|
||||
" ".join(deps),
|
||||
]
|
||||
else:
|
||||
|
|
|
@ -10,7 +10,7 @@ if [ "$#" -lt 4 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
special_pip_deps="$5"
|
||||
special_pip_deps="$6"
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
|
@ -18,7 +18,8 @@ build_name="$1"
|
|||
image_name="llamastack-$build_name"
|
||||
docker_base=$2
|
||||
build_file_path=$3
|
||||
pip_dependencies=$4
|
||||
host_build_dir=$4
|
||||
pip_dependencies=$5
|
||||
|
||||
# Define color codes
|
||||
RED='\033[0;31m'
|
||||
|
@ -33,7 +34,8 @@ REPO_CONFIGS_DIR="$REPO_DIR/tmp/configs"
|
|||
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
|
||||
llama stack configure $build_file_path --output-dir $REPO_CONFIGS_DIR
|
||||
llama stack configure $build_file_path
|
||||
cp $host_build_dir/$build_name-run.yaml $REPO_CONFIGS_DIR
|
||||
|
||||
add_to_docker() {
|
||||
local input
|
||||
|
@ -132,6 +134,9 @@ fi
|
|||
|
||||
set -x
|
||||
$DOCKER_BINARY build $DOCKER_OPTS -t $image_name -f "$TEMP_DIR/Dockerfile" "$REPO_DIR" $mounts
|
||||
|
||||
# clean up tmp/configs
|
||||
rm -rf $REPO_CONFIGS_DIR
|
||||
set +x
|
||||
|
||||
echo "Success! You can run it with: $DOCKER_BINARY $DOCKER_OPTS run -p 5000:5000 $image_name"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue