mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-28 10:54:19 +00:00
ci: add dynamic CI job to test templates (#1230)
# What does this PR do? Introduced a new CI job that dynamically generates a build matrix based on available templates from `llama_stack/templates/*/build.yaml`. This allows automated testing for all templates without manual intervention. The CI currently builds for venv and containers. Signed-off-by: Sébastien Han <seb@redhat.com> ~Will pass once https://github.com/meta-llama/llama-stack/pull/1228 merges.~ Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
parent
9617468d13
commit
5e54113b19
1 changed files with 76 additions and 0 deletions
76
.github/workflows/providers-build.yml
vendored
Normal file
76
.github/workflows/providers-build.yml
vendored
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
name: Test Llama Stack Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'llama_stack/cli/stack/build.py'
|
||||||
|
- 'llama_stack/cli/stack/_build.py'
|
||||||
|
- 'llama_stack/distribution/build.*'
|
||||||
|
- 'llama_stack/distribution/*.sh'
|
||||||
|
- '.github/workflows/providers-build.yml'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'llama_stack/cli/stack/build.py'
|
||||||
|
- 'llama_stack/cli/stack/_build.py'
|
||||||
|
- 'llama_stack/distribution/build.*'
|
||||||
|
- 'llama_stack/distribution/*.sh'
|
||||||
|
- '.github/workflows/providers-build.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate-matrix:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
templates: ${{ steps.set-matrix.outputs.templates }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Generate Template List
|
||||||
|
id: set-matrix
|
||||||
|
run: |
|
||||||
|
templates=$(ls llama_stack/templates/*/*build.yaml | awk -F'/' '{print $(NF-1)}' | jq -R -s -c 'split("\n")[:-1]')
|
||||||
|
echo "templates=$templates" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: generate-matrix
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
template: ${{ fromJson(needs.generate-matrix.outputs.templates) }}
|
||||||
|
image-type: [venv, container]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.10'
|
||||||
|
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
|
||||||
|
- name: Install LlamaStack
|
||||||
|
run: |
|
||||||
|
uv venv
|
||||||
|
source .venv/bin/activate
|
||||||
|
uv pip install -e .
|
||||||
|
|
||||||
|
- name: Print build dependencies
|
||||||
|
run: |
|
||||||
|
uv run llama stack build --template ${{ matrix.template }} --image-type ${{ matrix.image-type }} --image-name test --print-deps-only
|
||||||
|
|
||||||
|
- name: Run Llama Stack Build
|
||||||
|
run: |
|
||||||
|
uv run llama stack build --template ${{ matrix.template }} --image-type ${{ matrix.image-type }} --image-name test
|
||||||
|
|
||||||
|
- name: Print dependencies in the image
|
||||||
|
if: matrix.image-type == 'venv'
|
||||||
|
run: |
|
||||||
|
source test/bin/activate
|
||||||
|
uv pip list
|
Loading…
Add table
Add a link
Reference in a new issue