-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (141 loc) · 5.04 KB
/
Copy pathtask-battery.yml
File metadata and controls
155 lines (141 loc) · 5.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: VFB Task Battery
on:
workflow_dispatch:
inputs:
repetitions:
description: Repetitions per task
required: true
default: '1'
concurrency:
description: Number of questions to run in parallel
required: true
default: '4'
timeout_ms:
description: Per-question timeout in milliseconds
required: true
default: '240000'
limit:
description: Optional number of tasks to run
required: false
default: ''
ids:
description: Optional comma-separated task IDs, e.g. T1.1,T3.4
required: false
default: ''
commit_results:
description: Commit JSON results back to test-results/task-battery
required: true
default: 'true'
type: choice
options:
- 'true'
- 'false'
push:
branches: '**'
paths:
- app/**
- lib/**
- scripts/run-task-battery.mjs
- tests/task-battery/**
- package.json
- package-lock.json
- .github/workflows/task-battery.yml
pull_request:
branches: [ main ]
paths:
- app/**
- lib/**
- scripts/run-task-battery.mjs
- tests/task-battery/**
- package.json
- package-lock.json
- .github/workflows/task-battery.yml
permissions:
contents: write
concurrency:
group: task-battery-${{ github.ref }}
cancel-in-progress: true
jobs:
benchmark:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Checkout VFBchat
uses: actions/checkout@v4
with:
path: VFBchat
persist-credentials: true
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: VFBchat/package-lock.json
- name: Install dependencies
working-directory: VFBchat
run: npm ci
- name: Lint
working-directory: VFBchat
run: npm run lint
- name: Build
working-directory: VFBchat
run: npm run build
- name: Check benchmark credentials
id: creds
working-directory: VFBchat
env:
ELM_API_KEY: ${{ secrets.ELM_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
if [ -n "$ELM_API_KEY" ] || [ -n "$OPENAI_API_KEY" ]; then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
echo "No ELM_API_KEY or OPENAI_API_KEY secret is configured; skipping live task battery run." >> "$GITHUB_STEP_SUMMARY"
fi
- name: Run task battery
id: task_battery
if: steps.creds.outputs.available == 'true'
continue-on-error: true
timeout-minutes: 80
working-directory: VFBchat
env:
ELM_API_KEY: ${{ secrets.ELM_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ELM_BASE_URL: ${{ secrets.ELM_BASE_URL || vars.ELM_BASE_URL || 'https://elm.edina.ac.uk/api/v1' }}
APPROVED_ELM_BASE_URL: ${{ secrets.ELM_BASE_URL || vars.ELM_BASE_URL || 'https://elm.edina.ac.uk/api/v1' }}
ELM_MODEL: ${{ secrets.ELM_MODEL || vars.ELM_MODEL || 'meta-llama/Llama-3.3-70B-Instruct' }}
APPROVED_ELM_MODEL: ${{ secrets.ELM_MODEL || vars.ELM_MODEL || 'meta-llama/Llama-3.3-70B-Instruct' }}
VFB_MCP_URL: ${{ secrets.VFB_MCP_URL || vars.VFB_MCP_URL || 'https://vfb3-mcp-preview.virtualflybrain.org/' }}
RATE_LIMIT_PER_IP: '10000'
TASK_BATTERY_REPETITIONS: ${{ github.event.inputs.repetitions || '1' }}
TASK_BATTERY_CONCURRENCY: ${{ github.event.inputs.concurrency || '4' }}
TASK_BATTERY_TIMEOUT_MS: ${{ github.event.inputs.timeout_ms || '240000' }}
TASK_BATTERY_LIMIT: ${{ github.event.inputs.limit || '' }}
TASK_BATTERY_IDS: ${{ github.event.inputs.ids || '' }}
run: |
args=(--task-file tests/task-battery/tasks.json --server-command start --port 3210)
npm run benchmark:task-battery -- "${args[@]}"
- name: Upload benchmark artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: task-battery-results
path: VFBchat/test-results/task-battery
if-no-files-found: warn
- name: Commit benchmark results
if: steps.creds.outputs.available == 'true' && github.event_name != 'pull_request' && (github.event.inputs.commit_results != 'false')
working-directory: VFBchat
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add test-results/task-battery
if git diff --cached --quiet; then
echo "No benchmark result changes to commit."
else
git commit -m "Add task battery results for ${GITHUB_SHA::7} [skip ci]"
git push
fi
- name: Fail when task battery had errors
if: steps.task_battery.outcome == 'failure'
run: exit 1