fix: scope UV env vars to llama-stack install only

The previous change set UV_EXTRA_INDEX_URL and UV_INDEX_STRATEGY as
persistent ENV vars, which affected all subsequent uv commands including
distribution dependency installation. This caused conflicts when deps
have their own --extra-index-url (like PyTorch packages).

Now these env vars are only used inline for the llama-stack installation
step in editable mode, keeping distribution deps unaffected.
This commit is contained in:
Ashwin Bharambe 2025-10-31 10:05:39 -07:00
parent 98fa43fd94
commit a51a4317b3

View file

@ -58,8 +58,6 @@ ENV TEST_PYPI_VERSION=${TEST_PYPI_VERSION}
ENV KEEP_WORKSPACE=${KEEP_WORKSPACE} ENV KEEP_WORKSPACE=${KEEP_WORKSPACE}
ENV DISTRO_NAME=${DISTRO_NAME} ENV DISTRO_NAME=${DISTRO_NAME}
ENV RUN_CONFIG_PATH=${RUN_CONFIG_PATH} ENV RUN_CONFIG_PATH=${RUN_CONFIG_PATH}
ENV UV_EXTRA_INDEX_URL=${UV_EXTRA_INDEX_URL}
ENV UV_INDEX_STRATEGY=${UV_INDEX_STRATEGY}
# Copy the repository so editable installs and run configurations are available. # Copy the repository so editable installs and run configurations are available.
COPY . /workspace COPY . /workspace
@ -76,13 +74,19 @@ RUN set -eux; \
fi; fi;
# Install llama-stack # Install llama-stack
# Use UV_EXTRA_INDEX_URL inline only for this step to avoid affecting distribution deps
RUN set -eux; \ RUN set -eux; \
if [ "$INSTALL_MODE" = "editable" ]; then \ if [ "$INSTALL_MODE" = "editable" ]; then \
if [ ! -d "$LLAMA_STACK_DIR" ]; then \ if [ ! -d "$LLAMA_STACK_DIR" ]; then \
echo "INSTALL_MODE=editable requires LLAMA_STACK_DIR to point to a directory inside the build context" >&2; \ echo "INSTALL_MODE=editable requires LLAMA_STACK_DIR to point to a directory inside the build context" >&2; \
exit 1; \ exit 1; \
fi; \ fi; \
if [ -n "$UV_EXTRA_INDEX_URL" ]; then \
UV_EXTRA_INDEX_URL="$UV_EXTRA_INDEX_URL" UV_INDEX_STRATEGY="$UV_INDEX_STRATEGY" \
uv pip install --no-cache-dir -e "$LLAMA_STACK_DIR"; \ uv pip install --no-cache-dir -e "$LLAMA_STACK_DIR"; \
else \
uv pip install --no-cache-dir -e "$LLAMA_STACK_DIR"; \
fi; \
elif [ "$INSTALL_MODE" = "test-pypi" ]; then \ elif [ "$INSTALL_MODE" = "test-pypi" ]; then \
uv pip install --no-cache-dir fastapi libcst; \ uv pip install --no-cache-dir fastapi libcst; \
if [ -n "$TEST_PYPI_VERSION" ]; then \ if [ -n "$TEST_PYPI_VERSION" ]; then \