forked from meta-llama/llama-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add dynamic CI job to test templates
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. Signed-off-by: Sébastien Han <[email protected]>
- Loading branch information
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Dynamic Llama Stack Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
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 dependencies | ||
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 |