-
Notifications
You must be signed in to change notification settings - Fork 6
323 lines (295 loc) · 11.8 KB
/
Copy pathrelease-surface-rtt.yml
File metadata and controls
323 lines (295 loc) · 11.8 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
name: Release Surface RTT
on:
schedule:
- cron: "35 */6 * * *"
workflow_dispatch:
inputs:
surfaces:
description: Space or comma separated surface ids
required: false
default: "control-ui"
type: string
versions:
description: Space or comma separated OpenClaw versions to measure
required: false
default: ""
type: string
version_limit:
description: Maximum future versions per surface when versions is empty
required: false
default: "2"
type: string
samples:
description: Number of RTT samples
required: false
default: "10"
type: string
permissions:
actions: read
contents: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
NODE_VERSION: "24.x"
PNPM_VERSION: "11.2.2"
jobs:
resolve:
name: Resolve OpenClaw surface release packages
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.release.outputs.matrix }}
reason: ${{ steps.release.outputs.reason }}
should_run: ${{ steps.release.outputs.should_run }}
surfaces: ${{ steps.release.outputs.surfaces }}
versions: ${{ steps.release.outputs.versions }}
steps:
- name: Checkout RTT tracker
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Resolve OpenClaw surface release packages
id: release
env:
INPUT_SURFACES: ${{ github.event_name == 'workflow_dispatch' && inputs.surfaces || '' }}
INPUT_VERSIONS: ${{ github.event_name == 'workflow_dispatch' && inputs.versions || '' }}
INPUT_VERSION_LIMIT: ${{ github.event_name == 'workflow_dispatch' && inputs.version_limit || '' }}
shell: bash
run: |
set -euo pipefail
node scripts/resolve-openclaw-surface-package.mjs
- name: Report skipped package
if: steps.release.outputs.should_run != 'true'
run: |
echo "No surface release versions to measure (${{ steps.release.outputs.reason }})"
measure:
name: Measure OpenClaw ${{ matrix.package.label }} release RTT
needs: resolve
if: needs.resolve.outputs.should_run == 'true'
runs-on: blacksmith-16vcpu-ubuntu-2404
timeout-minutes: 60
concurrency:
group: surface-rtt-measure-${{ matrix.package.surface }}-${{ github.ref }}
cancel-in-progress: false
strategy:
fail-fast: false
max-parallel: 1
matrix:
package: ${{ fromJSON(needs.resolve.outputs.matrix) }}
steps:
- name: Checkout RTT tracker
uses: actions/checkout@v7
with:
path: openclaw-rtt
fetch-depth: 0
- name: Checkout OpenClaw release
uses: actions/checkout@v7
with:
repository: openclaw/openclaw
ref: ${{ matrix.package.tag }}
path: openclaw
fetch-depth: 1
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
shell: bash
run: |
set -euo pipefail
corepack enable
corepack prepare "pnpm@${PNPM_VERSION}" --activate
- name: Locate pnpm store
id: pnpm-store
working-directory: openclaw
shell: bash
run: |
set -euo pipefail
echo "path=$(pnpm store path --silent)" >>"$GITHUB_OUTPUT"
- name: Restore pnpm store
uses: actions/cache@v6
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: openclaw-release-surface-rtt-pnpm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('openclaw/pnpm-lock.yaml') }}
restore-keys: |
openclaw-release-surface-rtt-pnpm-${{ runner.os }}-${{ runner.arch }}-
- name: Install OpenClaw dependencies
working-directory: openclaw
shell: bash
run: |
set -euo pipefail
time pnpm install --frozen-lockfile --prefer-offline --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true --config.side-effects-cache=true
- name: Install Playwright Chromium
working-directory: openclaw
shell: bash
run: |
set -euo pipefail
node scripts/ensure-playwright-chromium.mjs
- name: Verify OpenClaw release ref
working-directory: openclaw
shell: bash
run: |
set -euo pipefail
version="$(node -p "require('./package.json').version")"
if [[ "$version" != "${{ matrix.package.version }}" ]]; then
echo "OpenClaw package version mismatch: expected ${{ matrix.package.version }}, got ${version}" >&2
exit 1
fi
- name: Run ${{ matrix.package.label }} RTT samples
id: surface_rtt
working-directory: openclaw
env:
INPUT_SAMPLES: ${{ github.event_name == 'workflow_dispatch' && inputs.samples || '' }}
shell: bash
run: |
set -euo pipefail
samples="${INPUT_SAMPLES:-10}"
if ! [[ "$samples" =~ ^[1-9][0-9]*$ ]]; then
echo "samples must be a positive integer, got: $samples" >&2
exit 1
fi
output_root=".artifacts/control-ui-release-rtt-${{ matrix.package.version }}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
sample_paths="$RUNNER_TEMP/openclaw-control-ui-${{ matrix.package.version }}-rtt-samples.tsv"
: >"$sample_paths"
echo "output_root=${output_root}" >>"$GITHUB_OUTPUT"
echo "sample_paths=${sample_paths}" >>"$GITHUB_OUTPUT"
for sample in $(seq 1 "$samples"); do
output_dir="${output_root}/sample-${sample}"
metrics_path="${output_dir}/resource-metrics.env"
rm -rf "$output_dir"
mkdir -p "$output_dir"
echo "SURFACE_RELEASE_RTT_PHASE:${{ matrix.package.surface }} version=${{ matrix.package.version }} sample=${sample}/${samples}"
/usr/bin/time \
-f 'max_rss_kb=%M\nelapsed_seconds=%e' \
-o "$metrics_path" \
node --import tsx ../openclaw-rtt/scripts/measure-control-ui-rtt.mjs \
--output-dir "$output_dir"
echo "attempts=1" >>"$metrics_path"
printf '%s\t%s\t%s\n' \
"${PWD}/${output_dir}/qa-suite-summary.json" \
"${PWD}/${metrics_path}" \
"${PWD}/${output_dir}/control-ui-events.json" >>"$sample_paths"
done
- name: Prepare ${{ matrix.package.label }} release import artifact
working-directory: openclaw
shell: bash
run: |
set -euo pipefail
import_dir="$RUNNER_TEMP/release-surface-rtt-import-${{ matrix.package.surface }}-${{ matrix.package.version }}"
rm -rf "$import_dir"
mkdir -p "$import_dir"
cp -R "${{ steps.surface_rtt.outputs.output_root }}" "$import_dir/artifacts"
{
echo "surface=${{ matrix.package.surface }}"
echo "scenario=${{ matrix.package.scenario }}"
echo "spec=${{ matrix.package.spec }}"
echo "version=${{ matrix.package.version }}"
} >"$import_dir/metadata.env"
- name: Upload ${{ matrix.package.label }} release import artifact
uses: actions/upload-artifact@v7.0.1
with:
name: release-surface-rtt-import-${{ matrix.package.surface }}-${{ matrix.package.version }}
path: ${{ runner.temp }}/release-surface-rtt-import-${{ matrix.package.surface }}-${{ matrix.package.version }}
retention-days: 14
if-no-files-found: error
- name: Upload ${{ matrix.package.label }} RTT artifacts
if: always()
uses: actions/upload-artifact@v7.0.1
with:
name: release-surface-rtt-${{ matrix.package.surface }}-${{ matrix.package.version }}-${{ github.run_id }}-${{ github.run_attempt }}
path: openclaw/.artifacts/control-ui-release-rtt-${{ matrix.package.version }}-${{ github.run_id }}-${{ github.run_attempt }}
retention-days: 14
if-no-files-found: warn
report:
name: Import surface release RTT reports
needs:
- resolve
- measure
if: always() && needs.resolve.outputs.should_run == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 10
concurrency:
group: rtt-report-writer-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout RTT tracker
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Download surface release import artifacts
uses: actions/download-artifact@v8.0.1
with:
pattern: release-surface-rtt-import-*
path: ${{ runner.temp }}/release-surface-rtt-imports
- name: Import surface release RTT results
shell: bash
run: |
set -euo pipefail
git pull --rebase origin "${GITHUB_REF_NAME:-main}"
import_root="$RUNNER_TEMP/release-surface-rtt-imports"
shopt -s nullglob
import_dirs=("$import_root"/release-surface-rtt-import-*)
if [[ -f "$import_root/metadata.env" ]]; then
import_dirs=("$import_root")
fi
if [[ "${#import_dirs[@]}" -eq 0 ]]; then
echo "No surface release RTT import artifacts downloaded." >&2
exit 1
fi
get_metadata() {
local metadata_path="$1"
local key="$2"
grep -m 1 "^${key}=" "$metadata_path" | cut -d= -f2-
}
for import_dir in "${import_dirs[@]}"; do
metadata_path="${import_dir}/metadata.env"
surface="$(get_metadata "$metadata_path" surface)"
scenario="$(get_metadata "$metadata_path" scenario)"
spec="$(get_metadata "$metadata_path" spec)"
version="$(get_metadata "$metadata_path" version)"
sample_paths="$RUNNER_TEMP/openclaw-${surface}-${version}-rtt-samples.tsv"
: >"$sample_paths"
while IFS= read -r sample_dir; do
summary_path="${sample_dir}/qa-suite-summary.json"
metrics_path="${sample_dir}/resource-metrics.env"
events_path="${sample_dir}/control-ui-events.json"
if [[ ! -f "$summary_path" || ! -f "$metrics_path" || ! -f "$events_path" ]]; then
echo "Missing ${surface} release artifacts under ${sample_dir}." >&2
exit 1
fi
printf '%s\t%s\t%s\n' "$summary_path" "$metrics_path" "$events_path" >>"$sample_paths"
done < <(find "${import_dir}/artifacts" -mindepth 1 -maxdepth 1 -type d -name 'sample-*' | sort -V)
node scripts/import-surface-rtt.mjs "$sample_paths" \
--surface "$surface" \
--spec "$spec" \
--version "$version" \
--provider-mode mock-openai \
--scenario "$scenario" \
--require-pass
done
node scripts/update-readme.mjs
node scripts/validate.mjs
node scripts/surface-rtt-summary.mjs
- name: Commit result
shell: bash
run: |
set -euo pipefail
git add data/surfaces/ runs/surfaces/ README.md
if git diff --cached --quiet --exit-code; then
echo "No surface release RTT changes to commit."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "data: record surface release rtt"
git push || {
git pull --rebase origin "${GITHUB_REF_NAME:-main}"
git push
}