Skip to content

Commit 4ddfe51

Browse files
committed
Merge branch 'examples/google_adk' of https://github.com/KellySit/agent-lightning into examples/google_adk
2 parents f8f4c9f + 84bdcdf commit 4ddfe51

File tree

173 files changed

+34577
-673
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+34577
-673
lines changed

.github/workflows/badge-compat.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Badge - Compatibility
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- Examples - Backward Compatibility
7+
types: [completed]
8+
9+
workflow_dispatch:
10+
11+
permissions:
12+
actions: read
13+
contents: read
14+
15+
jobs:
16+
badge:
17+
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main') }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/github-script@v8
22+
with:
23+
github-token: ${{ secrets.GITHUB_TOKEN }}
24+
script: |
25+
const badgeAggregation = require('./scripts/badge_aggregation.js');
26+
const dependencies = [
27+
{ workflow: 'examples-compat.yml', label: 'examples-compat', variants: ['legacy', 'stable'] },
28+
];
29+
await badgeAggregation({ github, context, core, dependencies });

.github/workflows/badge-unit.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Badge - Unit Test
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- CPU Test
7+
- GPU Test
8+
types: [completed]
9+
10+
workflow_dispatch:
11+
12+
permissions:
13+
actions: read
14+
contents: read
15+
16+
jobs:
17+
badge:
18+
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main') }}
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/github-script@v8
23+
with:
24+
github-token: ${{ secrets.GITHUB_TOKEN }}
25+
script: |
26+
const badgeAggregation = require('./scripts/badge_aggregation.js');
27+
const dependencies = [
28+
{ workflow: 'tests-full.yml', label: 'tests-full', variants: ['legacy', 'stable'] },
29+
{ workflow: 'tests.yml', label: 'tests', variants: ['legacy', 'stable', 'Lint', 'documentation', 'JavaScript'] },
30+
];
31+
await badgeAggregation({ github, context, core, dependencies });

.github/workflows/dashboard.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Dashboard
2+
permissions:
3+
contents: read
4+
on:
5+
schedule:
6+
# Every day at 5 AM UTC+8
7+
- cron: '0 21 * * *'
8+
9+
workflow_dispatch:
10+
11+
push:
12+
branches: [ main, stable/**/* ]
13+
14+
jobs:
15+
dashboard:
16+
name: Chromatic
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 15
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- uses: actions/setup-node@v6
24+
with:
25+
node-version: '22'
26+
- name: Install JavaScript dependencies
27+
run: cd dashboard && npm ci
28+
- name: Run Chromatic
29+
uses: chromaui/action@v13
30+
with:
31+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
32+
workingDir: dashboard
33+
exitZeroOnChanges: false

.github/workflows/examples-calc-x.yml

Lines changed: 112 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ run-name: >-
2222
|| format('Calc-X - {0}', github.event_name) }}
2323
2424
jobs:
25-
calc-x:
25+
calc-x-perf:
2626
if: >
2727
github.event_name != 'repository_dispatch' ||
2828
github.event.action == 'ci-calc-x' ||
2929
github.event.action == 'ci-all'
30-
name: Calc-X (Python ${{ matrix.python-version }}, ${{ matrix.setup-script }})
30+
name: Calc-X Performance (Python ${{ matrix.python-version }}, ${{ matrix.setup-script }})
3131
runs-on: [self-hosted, 1ES.Pool=agl-runner-gpu]
3232
timeout-minutes: 90
3333
strategy:
@@ -74,7 +74,7 @@ jobs:
7474
- name: Upload dependencies artifact
7575
uses: actions/upload-artifact@v4
7676
with:
77-
name: dependencies-calc-x-${{ matrix.python-version }}-${{ matrix.setup-script }}
77+
name: dependencies-calc-x-performance-${{ matrix.python-version }}-${{ matrix.setup-script }}
7878
path: requirements-freeze.txt
7979
compression-level: 0
8080

@@ -116,13 +116,11 @@ jobs:
116116
# Don't ask why. Don't touch this.
117117
- name: Calc-X training
118118
run: |
119-
set -ex
120119
source .venv/bin/activate
121120
cd examples/calc_x
122121
../../scripts/restart_ray.sh
123122
sleep 5
124-
PYTHONUNBUFFERED=1 python train_calc_agent.py --val-file data/test_mini.parquet --ci
125-
sleep 10
123+
python train_calc_agent.py --val-file data/test_mini.parquet --ci
126124
shell: bash
127125
env:
128126
WANDB_BASE_URL: ${{ secrets.MSR_WANDB_BASE_URL }}
@@ -137,22 +135,126 @@ jobs:
137135
WANDB_BASE_URL: ${{ secrets.MSR_WANDB_BASE_URL }}
138136
WANDB_API_KEY: ${{ secrets.MSR_WANDB_API_KEY }}
139137

140-
- name: Calc-X training LLM Proxy
138+
calc-x-variants:
139+
if: >
140+
github.event_name != 'repository_dispatch' ||
141+
github.event.action == 'ci-calc-x' ||
142+
github.event.action == 'ci-all'
143+
name: Calc-X Variants (Python ${{ matrix.python-version }}, ${{ matrix.setup-script }})
144+
runs-on: [self-hosted, 1ES.Pool=agl-runner-gpu]
145+
timeout-minutes: 90
146+
strategy:
147+
matrix:
148+
include:
149+
- python-version: '3.10'
150+
setup-script: 'legacy'
151+
- python-version: '3.12'
152+
setup-script: 'stable'
153+
- python-version: '3.13'
154+
setup-script: 'latest'
155+
fail-fast: false
156+
steps:
157+
- name: Check GPU status
158+
run: nvidia-smi
159+
- name: Check disk space
160+
run: df -h
161+
- uses: actions/checkout@v4
162+
with:
163+
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.pr_ref || (github.event.pull_request.number && format('refs/pull/{0}/merge', github.event.pull_request.number)) || github.ref }}
164+
- uses: astral-sh/setup-uv@v7
165+
with:
166+
enable-cache: true
167+
python-version: ${{ matrix.python-version }}
168+
- name: Upgrade dependencies (latest)
169+
run: uv lock --upgrade
170+
if: matrix.setup-script == 'latest'
171+
- name: Sync dependencies (latest)
172+
run: |
173+
uv sync --frozen --no-default-groups --extra verl \
174+
--group dev --group experiment --group agents --group torch-gpu-stable
175+
if: matrix.setup-script == 'latest'
176+
- name: Sync dependencies (stable & legacy)
177+
run: |
178+
uv sync --frozen --no-default-groups --extra verl \
179+
--group dev --group experiment --group agents --group torch-gpu-${{ matrix.setup-script }}
180+
if: matrix.setup-script != 'latest'
181+
- name: Freeze dependencies
182+
run: |
183+
set -ex
184+
uv pip freeze | tee requirements-freeze.txt
185+
echo "UV_LOCKED=1" >> $GITHUB_ENV
186+
echo "UV_NO_SYNC=1" >> $GITHUB_ENV
187+
- name: Upload dependencies artifact
188+
uses: actions/upload-artifact@v4
189+
with:
190+
name: dependencies-calc-x-variants-${{ matrix.python-version }}-${{ matrix.setup-script }}
191+
path: requirements-freeze.txt
192+
compression-level: 0
193+
194+
- name: Launch LiteLLM Proxy
195+
run: |
196+
./scripts/litellm_run.sh
197+
env:
198+
AZURE_API_BASE: ${{ secrets.AZURE_GROUP_SUBSCRIPTION_API_BASE }}
199+
AZURE_API_KEY: ${{ secrets.AZURE_GROUP_SUBSCRIPTION_API_KEY }}
200+
201+
- name: Prepare Calc-X dataset
202+
run: |
203+
set -ex
204+
cd examples/calc_x
205+
uv run gdown --fuzzy https://drive.google.com/file/d/1FQMyKLLd6hP9dw9rfZn1EZOWNvKaDsqw/view
206+
unzip calc-x-data.zip -d data
207+
rm calc-x-data.zip
208+
209+
- name: Calc-X MCP sanity check
210+
run: |
211+
set -ex
212+
cd examples/calc_x
213+
uv run tests/test_mcp_calculator.py
214+
env:
215+
OPENAI_API_BASE: http://localhost:12306/
216+
OPENAI_API_KEY: dummy
217+
- name: Calc-X sanity check
218+
run: |
219+
set -ex
220+
cd examples/calc_x
221+
uv run legacy_calc_agent_debug.py
222+
env:
223+
OPENAI_BASE_URL: http://localhost:12306/
224+
OPENAI_API_KEY: dummy
225+
226+
- name: Training with local model
227+
run: |
228+
set -ex
229+
source .venv/bin/activate
230+
cd examples/calc_x
231+
../../scripts/restart_ray.sh
232+
sleep 5
233+
hf download Qwen/Qwen2.5-0.5B-Instruct --local-dir data/qwen_model
234+
PYTHONUNBUFFERED=1 python train_calc_agent.py --val-file data/test_mini.parquet --ci-fast --model $(realpath data/qwen_model)
235+
sleep 10
236+
shell: bash
237+
env:
238+
WANDB_BASE_URL: ${{ secrets.MSR_WANDB_BASE_URL }}
239+
WANDB_API_KEY: ${{ secrets.MSR_WANDB_API_KEY }}
240+
id: calc_x_train_local_model
241+
242+
- name: Training with LLM Proxy
141243
run: |
142244
set -ex
143245
source .venv/bin/activate
144246
cd examples/calc_x
145247
../../scripts/restart_ray.sh
146248
sleep 5
147-
PYTHONUNBUFFERED=1 python train_calc_agent.py --val-file data/test_mini.parquet --ci --llm-proxy
249+
PYTHONUNBUFFERED=1 python train_calc_agent.py --val-file data/test_mini.parquet --ci-fast --llm-proxy
148250
sleep 10
149251
shell: bash
150252
env:
151253
WANDB_BASE_URL: ${{ secrets.MSR_WANDB_BASE_URL }}
152254
WANDB_API_KEY: ${{ secrets.MSR_WANDB_API_KEY }}
153255
id: calc_x_train_llm_proxy
154256

155-
- name: Calc-X training with external store
257+
- name: Training with external store
156258
run: |
157259
set -euo pipefail
158260
source .venv/bin/activate
@@ -182,7 +284,7 @@ jobs:
182284
WANDB_API_KEY: ${{ secrets.MSR_WANDB_API_KEY }}
183285
id: calc_x_train_external_store
184286

185-
- name: Calc-X training with role-based environment variables
287+
- name: Training with role-based environment variables
186288
run: |
187289
set -euo pipefail
188290
source .venv/bin/activate

.github/workflows/pypi-nightly.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ jobs:
2626
- name: Sync dependencies
2727
run: uv sync --frozen --no-default-groups --group dev
2828

29+
- uses: actions/setup-node@v6
30+
with:
31+
node-version: '22'
32+
- name: Install JavaScript dependencies
33+
run: cd dashboard && npm ci
34+
- name: Build dashboard
35+
run: cd dashboard && npm run build
36+
2937
- name: Get current version
3038
id: get_version
3139
run: |

.github/workflows/pypi-release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ jobs:
6060
- name: Sync dependencies
6161
run: uv sync --frozen --no-default-groups --group dev
6262

63+
- uses: actions/setup-node@v6
64+
with:
65+
node-version: '22'
66+
- name: Install JavaScript dependencies
67+
run: cd dashboard && npm ci
68+
- name: Build dashboard
69+
run: cd dashboard && npm run build
70+
6371
- name: Build package
6472
run: |
6573
uv build

.github/workflows/tests-full.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ jobs:
7373
path: requirements-freeze.txt
7474
compression-level: 0
7575

76+
- uses: actions/setup-node@v6
77+
with:
78+
node-version: '22'
79+
- name: Install JavaScript dependencies
80+
run: cd dashboard && npm ci
81+
- name: Build dashboard
82+
run: cd dashboard && npm run build
83+
7684
- name: Launch LiteLLM Proxy
7785
run: |
7886
./scripts/litellm_run.sh

0 commit comments

Comments
 (0)