forked from phoenix-oss/llama-stack-mirror
fix: llama stack build use UV_SYSTEM_PYTHON to install dependencies to system environment (#1163)
# What does this PR do? - resolves issue: #1159 - Root cause: https://github.com/meta-llama/llama-stack/pull/980 forces `build_venv.sh` to install in a venv environment, which do not work on Colab notebook environment <img width="1004" alt="image" src="https://github.com/user-attachments/assets/1f9be409-5313-4926-b078-74e141cf29eb" /> ## This PR Use `UV_SYSTEM_PYTHON` to make sure dependencies are installed in current system environment. Which will be used in the Colab environment. ``` UV_SYSTEM_PYTHON=1 llama stack build --template together --image-type venv ``` ## Test Plan - Works in Colab environment <img width="621" alt="image" src="https://github.com/user-attachments/assets/ae93bc3d-e05a-44b9-bb21-fb88f29969b8" />
This commit is contained in:
parent
2b752df79a
commit
61f43b8677
1 changed files with 9 additions and 4 deletions
|
@ -74,10 +74,15 @@ run() {
|
|||
local pip_dependencies="$2"
|
||||
local special_pip_deps="$3"
|
||||
|
||||
echo "Using virtual environment $env_name"
|
||||
uv venv "$env_name"
|
||||
# shellcheck source=/dev/null
|
||||
source "$env_name/bin/activate"
|
||||
if [ -n "${UV_SYSTEM_PYTHON:-}" ]; then
|
||||
echo "Installing dependencies in system Python environment"
|
||||
else
|
||||
echo "Using virtual environment $env_name"
|
||||
uv venv "$env_name"
|
||||
# shellcheck source=/dev/null
|
||||
source "$env_name/bin/activate"
|
||||
fi
|
||||
|
||||
if [ -n "$TEST_PYPI_VERSION" ]; then
|
||||
# these packages are damaged in test-pypi, so install them first
|
||||
uv pip install fastapi libcst
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue