@@ -68,14 +68,18 @@ jobs:
6868 git config user.name "github-actions[bot]"
6969 git config user.email "github-actions[bot]@users.noreply.github.com"
7070
71- # One-shot migration from the legacy loose-files layout. Idempotent.
72- if [ -d data/results ] && [ ! -f data/results.tar.zst ]; then
73- tar -C data -I 'zstd -19' -cf data/results.tar.zst results
71+ # Migrate from legacy loose uncompressed JSON/YAML files to
72+ # per-file zstd. Idempotent: subsequent runs find no *.json
73+ # (besides machine.json, excluded) or *.yml and the find
74+ # produces no input.
75+ if [ -d data/results/asvrunner ]; then
76+ find data/results/asvrunner -name '*.json' ! -name 'machine.json' -print0 |
77+ xargs -0 -r -P 4 -n 50 zstd --rm -19 -q
7478 fi
75- if [ -d data/envs ] && [ ! -f data/envs.tar.zst ]; then
76- tar -C data -I 'zstd -19' -cf data/envs.tar.zst envs
79+ if [ -d data/envs ]; then
80+ find data/envs -name '*.yml' -print0 |
81+ xargs -0 -r -P 4 -n 50 zstd --rm -19 -q
7782 fi
78- rm -rf data/results data/envs
7983
8084 cd ..
8185 sha="$(python3 asv-runner-code/ci/find_commit_to_run.py --input-path=asv-runner/data/ --repo-path=.)"
@@ -116,7 +120,8 @@ jobs:
116120
117121 # Build pandas at the claimed SHA and run the ASV suite. No concurrency
118122 # lock here — multiple workflow runs benchmark different SHAs in parallel.
119- # Outputs are uploaded as a workflow artifact for the merge job.
123+ # The new <sha>.json and <sha>.yml are zstd-compressed before upload so
124+ # the merge job can drop them into the storage tree as-is.
120125 benchmark :
121126 name : Run benchmarks
122127 needs : claim
@@ -160,17 +165,20 @@ jobs:
160165 cp asv_bench/results/asvrunner/machine.json /tmp/upload/results/asvrunner/
161166 cp asv_bench/results/asvrunner/${SHORT_SHA}-existing*.json /tmp/upload/results/asvrunner/${SHA}.json
162167 pixi list -e asv --fields name,version > /tmp/upload/envs/${SHA}.yml
168+ # Compress per-SHA files. benchmarks.json and machine.json stay
169+ # uncompressed (small, overwritten each run, read directly).
170+ zstd --rm -19 -q /tmp/upload/results/asvrunner/${SHA}.json
171+ zstd --rm -19 -q /tmp/upload/envs/${SHA}.yml
163172
164173 - name : Upload artifact
165174 uses : actions/upload-artifact@v4
166175 with :
167176 name : asv-results-${{ needs.claim.outputs.sha }}
168177 path : /tmp/upload/
169178
170- # Layer this run's results into the latest tarballs and orphan force-push.
171- # If a concurrent merge wins the race (lease fails), refetch — that
172- # winner's data is now in the tarballs we extract — re-add ours on top
173- # and try again.
179+ # Drop this run's compressed files into the storage tree and orphan
180+ # force-push. If a concurrent merge wins the race (lease fails), refetch
181+ # — that winner's data is already on disk after the fetch — and redo.
174182 merge :
175183 name : Merge into storage branch
176184 needs : [claim, benchmark]
@@ -205,31 +213,23 @@ jobs:
205213 git config user.name "github-actions[bot]"
206214 git config user.email "github-actions[bot]@users.noreply.github.com"
207215
208- # Idempotent migration from legacy loose-files layout.
209- if [ -d data/results ] && [ ! -f data/results.tar.zst ]; then
210- tar -C data -I 'zstd -19' -cf data/results.tar.zst results
216+ # Migrate from legacy loose uncompressed files to per-file zstd.
217+ # Idempotent.
218+ if [ -d data/results/asvrunner ]; then
219+ find data/results/asvrunner -name '*.json' ! -name 'machine.json' -print0 |
220+ xargs -0 -r -P 4 -n 50 zstd --rm -19 -q
211221 fi
212- if [ -d data/envs ] && [ ! -f data/envs.tar.zst ]; then
213- tar -C data -I 'zstd -19' -cf data/envs.tar.zst envs
222+ if [ -d data/envs ]; then
223+ find data/envs -name '*.yml' -print0 |
224+ xargs -0 -r -P 4 -n 50 zstd --rm -19 -q
214225 fi
215- rm -rf data/results data/envs
216226
217- WORK=$(mktemp -d)
218- mkdir -p "$WORK/results/asvrunner" "$WORK/envs"
219- if [ -f data/results.tar.zst ]; then
220- tar -I zstd -xf data/results.tar.zst -C "$WORK"
221- fi
222- if [ -f data/envs.tar.zst ]; then
223- tar -I zstd -xf data/envs.tar.zst -C "$WORK"
224- fi
225-
226- cp /tmp/new/results/benchmarks.json "$WORK/results/"
227- cp /tmp/new/results/asvrunner/machine.json "$WORK/results/asvrunner/"
228- cp /tmp/new/results/asvrunner/${SHA}.json "$WORK/results/asvrunner/"
229- cp /tmp/new/envs/${SHA}.yml "$WORK/envs/"
230-
231- tar -C "$WORK" -I 'zstd -19' -cf data/results.tar.zst results
232- tar -C "$WORK" -I 'zstd -19' -cf data/envs.tar.zst envs
227+ # Drop in this run's new files.
228+ mkdir -p data/results/asvrunner data/envs
229+ cp /tmp/new/results/benchmarks.json data/results/
230+ cp /tmp/new/results/asvrunner/machine.json data/results/asvrunner/
231+ cp /tmp/new/results/asvrunner/${SHA}.json.zst data/results/asvrunner/
232+ cp /tmp/new/envs/${SHA}.yml.zst data/envs/
233233
234234 EXPECTED=$(git rev-parse origin/${BRANCH_NAME})
235235 git checkout --orphan fresh
0 commit comments