mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
The GitHub Actions cache was restoring a cached virtual environment (.venv) with old code. This commit clears all caching layers: 1. Removes cached .venv directory (the main culprit) 2. Clears Python bytecode cache (.pyc files) 3. Clears UV cache directory This forces uv sync to create a completely fresh virtual environment with the latest source code changes, ensuring the authorization parameter is picked up across all tool runtime providers.
73 lines
2.7 KiB
YAML
73 lines
2.7 KiB
YAML
name: Setup runner
|
|
description: Prepare a runner for the tests (install uv, python, project dependencies, etc.)
|
|
inputs:
|
|
python-version:
|
|
description: The Python version to use
|
|
required: false
|
|
default: "3.12"
|
|
client-version:
|
|
description: The llama-stack-client-python version to test against (latest or published)
|
|
required: false
|
|
default: "latest"
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
|
|
with:
|
|
python-version: ${{ inputs.python-version }}
|
|
version: 0.7.6
|
|
|
|
- name: Configure client installation
|
|
id: client-config
|
|
uses: ./.github/actions/install-llama-stack-client
|
|
with:
|
|
client-version: ${{ inputs.client-version }}
|
|
|
|
- name: Install dependencies
|
|
shell: bash
|
|
env:
|
|
UV_EXTRA_INDEX_URL: ${{ steps.client-config.outputs.uv-extra-index-url }}
|
|
run: |
|
|
# Export UV env vars for current step and persist to GITHUB_ENV for subsequent steps
|
|
if [ -n "$UV_EXTRA_INDEX_URL" ]; then
|
|
export UV_INDEX_STRATEGY=unsafe-best-match
|
|
echo "UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL" >> $GITHUB_ENV
|
|
echo "UV_INDEX_STRATEGY=$UV_INDEX_STRATEGY" >> $GITHUB_ENV
|
|
echo "Exported UV environment variables for current and subsequent steps"
|
|
fi
|
|
|
|
echo "Clearing cached virtual environment to ensure fresh install"
|
|
# Remove cached venv that may contain old code
|
|
if [ -d ".venv" ]; then
|
|
echo "Removing cached .venv directory"
|
|
rm -rf .venv
|
|
fi
|
|
|
|
# Clear Python bytecode cache
|
|
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
|
|
find . -name "*.pyc" -delete 2>/dev/null || true
|
|
|
|
# Clear uv's cache directory to force rebuilding wheels from source
|
|
if [ -n "$UV_CACHE_DIR" ] && [ -d "$UV_CACHE_DIR" ]; then
|
|
echo "Clearing UV cache at $UV_CACHE_DIR"
|
|
rm -rf "$UV_CACHE_DIR"/*
|
|
fi
|
|
|
|
echo "Syncing dependencies with uv (will create fresh venv)"
|
|
uv sync --all-groups
|
|
|
|
echo "Force reinstalling llama-stack from source to ensure latest changes"
|
|
uv pip install --force-reinstall --no-deps -e .
|
|
|
|
echo "Installing ad-hoc dependencies"
|
|
uv pip install faiss-cpu
|
|
|
|
# Install specific client version after sync if needed
|
|
if [ "${{ steps.client-config.outputs.install-after-sync }}" = "true" ]; then
|
|
echo "Installing llama-stack-client from: ${{ steps.client-config.outputs.install-source }}"
|
|
uv pip install ${{ steps.client-config.outputs.install-source }}
|
|
fi
|
|
|
|
echo "Installed llama packages"
|
|
uv pip list | grep llama
|