Skip to content

Commit 4d20476

Browse files
authored
Merge branch 'microsoft:main' into main
2 parents 2042f52 + a3b2db1 commit 4d20476

File tree

287 files changed

+49919
-3757
lines changed

Some content is hidden

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

287 files changed

+49919
-3757
lines changed

.github/workflows/backport.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Backport Merged Pull Request
2+
on:
3+
pull_request_target:
4+
types: [closed]
5+
permissions:
6+
contents: write
7+
issues: write
8+
pull-requests: write
9+
10+
# NOTE:
11+
# Microsoft requires rotating BOT_PAT every 3 months.
12+
# Log onto agent-lightning-bot account and rotate the PAT if needed.
13+
14+
jobs:
15+
backport:
16+
name: Backport pull request
17+
runs-on: ubuntu-latest
18+
# Don't run on closed unmerged pull requests
19+
if: github.event.pull_request.merged
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Create backport pull requests
23+
uses: korthout/backport-action@v3
24+
with:
25+
branch_name: 'backport/${pull_number}/${target_branch}'
26+
label_pattern: ^(stable/[^ ]+)$
27+
github_token: ${{ secrets.BOT_PAT }}
28+
add_labels: backport
29+
add_author_as_assignee: true
30+
git_committer_name: agent-lightning-bot
31+
# This email address is not monitored.
32+
git_committer_email: agl.msft@outlook.com

.github/workflows/badge-apo.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Badge - APO
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- Examples - APO
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-apo.yml', label: 'apo', variants: ['legacy', 'stable'] },
28+
];
29+
await badgeAggregation({ github, context, core, dependencies });

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

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

.github/workflows/badge-latest.yml

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

.github/workflows/badge-spider.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Badge - Spider
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- Examples - Spider
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-spider.yml', label: 'spider', variants: ['stable', 'legacy'] },
28+
];
29+
await badgeAggregation({ github, context, core, dependencies });
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Badge - Unsloth
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- Examples - Unsloth
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-unsloth.yml', label: 'examples-unsloth.stable', variants: ['stable'] },
28+
];
29+
await badgeAggregation({ github, context, core, dependencies });

.github/workflows/docs.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
- 'v*'
99
workflow_dispatch:
1010

11+
concurrency:
12+
group: docs-deploy
13+
cancel-in-progress: false
14+
1115
permissions:
1216
contents: write
1317
pages: write
@@ -20,15 +24,14 @@ jobs:
2024
- uses: actions/checkout@v4
2125
with:
2226
fetch-depth: 0
23-
24-
- name: Set up Python
25-
uses: actions/setup-python@v5
27+
- uses: actions/setup-python@v6
2628
with:
2729
python-version: '3.12'
28-
29-
- name: Install dependencies
30-
run: |
31-
./scripts/setup_stable.sh
30+
- uses: astral-sh/setup-uv@v7
31+
with:
32+
enable-cache: true
33+
- name: Sync dependencies
34+
run: uv sync --frozen --no-default-groups --group dev
3235

3336
- name: Configure Git
3437
run: |
@@ -51,10 +54,11 @@ jobs:
5154
- name: Deploy versioned docs
5255
if: startsWith(github.ref, 'refs/tags/')
5356
run: |
54-
mike deploy --push --update-aliases ${{ steps.version.outputs.version }} stable
57+
uv run --locked --no-sync mike deploy --push --update-aliases ${{ steps.version.outputs.version }} stable
5558
5659
- name: Deploy dev docs
5760
if: github.ref == 'refs/heads/main'
5861
run: |
59-
mike deploy --push latest
60-
mike set-default --push latest
62+
uv run --locked --no-sync mike deploy --push latest
63+
# Always set stable to default
64+
uv run --locked --no-sync mike set-default --push stable

.github/workflows/examples-apo.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Examples - APO
2+
permissions:
3+
contents: read
4+
on:
5+
schedule:
6+
# Every day at 3 AM UTC+8
7+
- cron: '0 19 * * *'
8+
9+
workflow_dispatch:
10+
11+
repository_dispatch:
12+
types: [ci-apo, ci-all]
13+
14+
run-name: >-
15+
${{ github.event_name == 'repository_dispatch'
16+
&& format(
17+
'PR #{0} - Label {1} - {2}',
18+
github.event.client_payload.pull_number,
19+
github.event.client_payload.ci_label,
20+
github.event.client_payload.correlation_id
21+
)
22+
|| format('APO - {0}', github.event_name) }}
23+
24+
jobs:
25+
apo:
26+
if: >
27+
github.event_name != 'repository_dispatch' ||
28+
github.event.action == 'ci-apo' ||
29+
github.event.action == 'ci-all'
30+
name: APO (Python ${{ matrix.python-version }}, ${{ matrix.setup-script }})
31+
# This job is run on GitHub hosted runners rather than self-hosted runners because it needs no GPU.
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 30
34+
strategy:
35+
matrix:
36+
include:
37+
- python-version: '3.10'
38+
setup-script: 'legacy'
39+
- python-version: '3.12'
40+
setup-script: 'stable'
41+
- python-version: '3.13'
42+
setup-script: 'latest'
43+
fail-fast: false
44+
steps:
45+
- uses: actions/checkout@v4
46+
with:
47+
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 }}
48+
- uses: astral-sh/setup-uv@v7
49+
with:
50+
enable-cache: true
51+
python-version: ${{ matrix.python-version }}
52+
- name: Upgrade dependencies (latest)
53+
run: uv lock --upgrade
54+
if: matrix.setup-script == 'latest'
55+
- name: Sync dependencies (latest)
56+
run: |
57+
uv sync --frozen --no-default-groups --extra apo \
58+
--group dev --group experiment --group agents --group core-stable
59+
if: matrix.setup-script == 'latest'
60+
- name: Sync dependencies (stable & legacy)
61+
run: |
62+
uv sync --frozen --no-default-groups --extra apo \
63+
--group dev --group experiment --group agents --group core-${{ matrix.setup-script }}
64+
if: matrix.setup-script != 'latest'
65+
- name: Freeze dependencies
66+
run: |
67+
set -ex
68+
uv pip freeze | tee requirements-freeze.txt
69+
echo "UV_LOCKED=1" >> $GITHUB_ENV
70+
echo "UV_NO_SYNC=1" >> $GITHUB_ENV
71+
- name: Upload dependencies artifact
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: dependencies-apo-${{ matrix.python-version }}-${{ matrix.setup-script }}
75+
path: requirements-freeze.txt
76+
compression-level: 0
77+
78+
- name: Launch LiteLLM Proxy
79+
run: |
80+
./scripts/litellm_run.sh
81+
env:
82+
AZURE_API_BASE: ${{ secrets.AZURE_GROUP_SUBSCRIPTION_API_BASE }}
83+
AZURE_API_KEY: ${{ secrets.AZURE_GROUP_SUBSCRIPTION_API_KEY }}
84+
85+
- name: APO custom algorithm
86+
run: |
87+
set -ex
88+
cd examples/apo
89+
uv run apo_custom_algorithm_trainer.py | tee _ci_apo.log
90+
# Check whether the log contains "Best prompt found:"
91+
grep "Best prompt found:" _ci_apo.log
92+
env:
93+
# New versions follow OPENAI_BASE_URL instead of OPENAI_API_BASE
94+
OPENAI_BASE_URL: http://localhost:12306/
95+
OPENAI_API_KEY: dummy
96+
- name: APO custom algorithm debugger
97+
run: |
98+
set -ex
99+
cd examples/apo
100+
uv run apo_debug.py --mode runner
101+
uv run apo_debug.py --mode hook
102+
uv run apo_debug.py --mode trainer
103+
env:
104+
# New versions follow OPENAI_BASE_URL instead of OPENAI_API_BASE
105+
OPENAI_BASE_URL: http://localhost:12306/
106+
OPENAI_API_KEY: dummy
107+
108+
- name: APO built-in algorithm
109+
run: |
110+
set -ex
111+
cd examples/apo
112+
uv run room_selector_apo.py
113+
env:
114+
OPENAI_BASE_URL: http://localhost:12306/
115+
OPENAI_API_KEY: dummy
116+
if: matrix.setup-script != 'legacy'

0 commit comments

Comments
 (0)