mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 18:00:36 +00:00
refactor: consolidate all client install logic into single action
Renamed install-client-for-release to install-llama-stack-client and made it handle both release branches and client-version inputs. Now all client installation logic lives in one place: - Release branches: always install from matching git branch - Non-release branches: install based on client-version input This eliminates all the conditional logic from setup-runner.
This commit is contained in:
parent
c86e6e906a
commit
626639beee
3 changed files with 29 additions and 29 deletions
|
|
@ -1,10 +1,16 @@
|
||||||
name: Install Client for Release Branch
|
name: Install llama-stack-client
|
||||||
description: Pre-install llama-stack-client from git on release branches to satisfy RC dependencies before uv sync
|
description: Install llama-stack-client based on branch context and client-version input
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
client-version:
|
||||||
|
description: 'Client version to install on non-release branches (latest or published). Ignored on release branches.'
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Install client from release branch if needed
|
- name: Install llama-stack-client
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# Determine the branch we're working with
|
# Determine the branch we're working with
|
||||||
|
|
@ -15,9 +21,8 @@ runs:
|
||||||
|
|
||||||
echo "Working with branch: $BRANCH"
|
echo "Working with branch: $BRANCH"
|
||||||
|
|
||||||
# If on a release branch, install from matching release branch BEFORE uv sync
|
# On release branches: always install from matching git branch to satisfy RC dependencies
|
||||||
# This allows uv sync to resolve dependencies that reference unreleased RC versions
|
# On non-release branches: install based on client-version input
|
||||||
# We always do this on release branches regardless of client-version to satisfy pyproject.toml
|
|
||||||
if [[ "$BRANCH" =~ ^release-[0-9]+\.[0-9]+\.x$ ]]; then
|
if [[ "$BRANCH" =~ ^release-[0-9]+\.[0-9]+\.x$ ]]; then
|
||||||
echo "Detected release branch: $BRANCH"
|
echo "Detected release branch: $BRANCH"
|
||||||
echo "Checking if matching branch exists in llama-stack-client-python..."
|
echo "Checking if matching branch exists in llama-stack-client-python..."
|
||||||
|
|
@ -31,4 +36,16 @@ runs:
|
||||||
echo "::error::Please create the matching release branch in llama-stack-client-python before testing"
|
echo "::error::Please create the matching release branch in llama-stack-client-python before testing"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
elif [ -n "${{ inputs.client-version }}" ]; then
|
||||||
|
# Non-release branch with client-version specified
|
||||||
|
if [ "${{ inputs.client-version }}" = "latest" ]; then
|
||||||
|
echo "Installing latest llama-stack-client-python from main branch"
|
||||||
|
uv pip install git+https://github.com/llamastack/llama-stack-client-python.git@main
|
||||||
|
elif [ "${{ inputs.client-version }}" = "published" ]; then
|
||||||
|
echo "Installing published llama-stack-client-python from PyPI"
|
||||||
|
uv pip install llama-stack-client
|
||||||
|
else
|
||||||
|
echo "Invalid client-version: ${{ inputs.client-version }}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
25
.github/actions/setup-runner/action.yml
vendored
25
.github/actions/setup-runner/action.yml
vendored
|
|
@ -18,36 +18,19 @@ runs:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
version: 0.7.6
|
version: 0.7.6
|
||||||
|
|
||||||
- name: Pre-install client for release branches
|
- name: Install llama-stack-client
|
||||||
uses: ./.github/actions/install-client-for-release
|
uses: ./.github/actions/install-llama-stack-client
|
||||||
|
with:
|
||||||
|
client-version: ${{ inputs.client-version }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# Determine the branch we're working with (needed for post-install logic)
|
|
||||||
BRANCH="${{ github.base_ref || github.ref }}"
|
|
||||||
BRANCH="${BRANCH#refs/heads/}"
|
|
||||||
|
|
||||||
echo "Updating project dependencies via uv sync"
|
echo "Updating project dependencies via uv sync"
|
||||||
uv sync --all-groups
|
uv sync --all-groups
|
||||||
|
|
||||||
echo "Installing ad-hoc dependencies"
|
echo "Installing ad-hoc dependencies"
|
||||||
uv pip install faiss-cpu
|
uv pip install faiss-cpu
|
||||||
|
|
||||||
# Install llama-stack-client-python based on the client-version input
|
|
||||||
# Only applies to non-release branches (on release branches, we already installed from git above)
|
|
||||||
if [[ ! "$BRANCH" =~ ^release-[0-9]+\.[0-9]+\.x$ ]]; then
|
|
||||||
if [ "${{ inputs.client-version }}" = "latest" ]; then
|
|
||||||
echo "Installing latest llama-stack-client-python from main branch"
|
|
||||||
uv pip install git+https://github.com/llamastack/llama-stack-client-python.git@main
|
|
||||||
elif [ "${{ inputs.client-version }}" = "published" ]; then
|
|
||||||
echo "Installing published llama-stack-client-python from PyPI"
|
|
||||||
uv pip install llama-stack-client
|
|
||||||
else
|
|
||||||
echo "Invalid client-version: ${{ inputs.client-version }}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Installed llama packages"
|
echo "Installed llama packages"
|
||||||
uv pip list | grep llama
|
uv pip list | grep llama
|
||||||
|
|
|
||||||
4
.github/workflows/pre-commit.yml
vendored
4
.github/workflows/pre-commit.yml
vendored
|
|
@ -130,8 +130,8 @@ jobs:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Pre-install client for release branches
|
- name: Install llama-stack-client
|
||||||
uses: ./.github/actions/install-client-for-release
|
uses: ./.github/actions/install-llama-stack-client
|
||||||
|
|
||||||
- name: Sync dev + type_checking dependencies
|
- name: Sync dev + type_checking dependencies
|
||||||
run: uv sync --group dev --group type_checking
|
run: uv sync --group dev --group type_checking
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue