This commit is contained in:
Xi Yan 2025-02-19 16:47:29 -08:00
parent a66b4c4c81
commit 7c7e13734d
2 changed files with 15 additions and 4 deletions

View file

@ -122,11 +122,13 @@ def build_image(
" ".join(normal_deps), " ".join(normal_deps),
] ]
elif build_config.image_type == ImageType.venv.value: elif build_config.image_type == ImageType.venv.value:
system_install = True
script = str(importlib.resources.files("llama_stack") / "distribution/build_venv.sh") script = str(importlib.resources.files("llama_stack") / "distribution/build_venv.sh")
args = [ args = [
script, script,
str(image_name), str(image_name),
" ".join(normal_deps), " ".join(normal_deps),
str(system_install),
] ]
if special_deps: if special_deps:

View file

@ -37,6 +37,9 @@ build_name="$1"
env_name="llamastack-$build_name" env_name="llamastack-$build_name"
pip_dependencies="$2" pip_dependencies="$2"
# whether we want to install dependencies in current system python environment
system_install="$4"
# Define color codes # Define color codes
RED='\033[0;31m' RED='\033[0;31m'
NC='\033[0m' # No Color NC='\033[0m' # No Color
@ -73,11 +76,17 @@ run() {
local env_name="$1" local env_name="$1"
local pip_dependencies="$2" local pip_dependencies="$2"
local special_pip_deps="$3" local special_pip_deps="$3"
local system_install="$4"
if [ "$SYSTEM_INSTALL" = true ]; then
echo "Installing dependencies in system Python environment"
else
echo "Using virtual environment $env_name" echo "Using virtual environment $env_name"
uv venv "$env_name" uv venv "$env_name"
# shellcheck source=/dev/null # shellcheck source=/dev/null
source "$env_name/bin/activate" source "$env_name/bin/activate"
fi
if [ -n "$TEST_PYPI_VERSION" ]; then if [ -n "$TEST_PYPI_VERSION" ]; then
# these packages are damaged in test-pypi, so install them first # these packages are damaged in test-pypi, so install them first
uv pip install fastapi libcst uv pip install fastapi libcst