feat(suite): cap the pre-run payloads kept in a suite - #304
Conversation
The jochemnet bloatnet pre-run bundle is a single 9.4 GiB pre-run.request — ~8k blocks of setup. CreateSuiteOutput copies it into the suite directory on every job and the runner then uploads it, so it costs a 9.4 GiB local write plus a 9.4 GiB transfer per completed run. Nothing consumes it: the runner replays pre-runs from the fixtures cache, not from the suite, and the UI has no use for a bundle that size. Cap it. A pre-run step over max_pre_run_step_size (default 512MB) is recorded in summary.json with its size and "omitted": true, but not copied — so it is never uploaded either. The size is checked with a stat before the copy, so an oversized bundle costs neither the write nor the transfer. "0" disables the limit. Recording the omission rather than silently dropping the entry keeps the suite honest about what the run replayed, and gives the UI something to check before offering the file for viewing. The bytes remain in the fixtures artifact the step came from.
Stat the step first so an omitted bundle leaves no empty step directory implying a file that was never stored, and so the provider path does not materialise content it is about to discard.
…it for what it does max_pre_run_step_size under tests read like a test-execution setting; nothing in the name said it governs what gets uploaded with a suite. It is now results_upload.max_pre_run_upload_size, next to the rest of the upload config, where both the path and the name say what it affects. Also documents it in docs/configuration.md, with a section covering why the cap exists, what an omitted bundle looks like in summary.json, and where to find the bytes when one is skipped.
|
Both addressed. Renamed and moved. You're right that the name didn't say what it affects — and under runner:
benchmark:
results_upload:
max_pre_run_upload_size: 512MBI went with Docs. One other change since you looked: the size check now runs before anything is created, so an omitted bundle leaves no empty |
The ETag check was there to catch same-size-different-bytes. With the pre-run cap in #304 every remaining suite file is under the part size, so that branch covers all of them — meaning a full read and MD5 of the whole suite, 1-3 GB, on every run, to avoid re-sending the same 1-3 GB. It was insurance against something the design already rules out: a suite hash is a digest of exactly these step files, and only benchmarkoor writes under that prefix, so a key cannot hold different bytes at the same size without the hash changing too. Drop it and compare size, which the listing already gives us for free. summary.json stays exempt. It is the one file that is rewritten rather than content-addressed, so a label edit that happens to preserve its length is plausible in a way it is not for the rest. Net 63 lines and one crypto import gone.
Implements @skylenet's suggestion: a size limit on pre-run bundles, 512MB default, anything over it skipped.
Why
The jochemnet bloatnet pre-run bundle is a single 9.4 GiB
pre-run.request— roughly 8k blocks of setup.CreateSuiteOutputcopies it into the suite directory on every job, and the runner then uploads it. Nothing consumes it: the runner replays pre-runs from the fixtures cache, not from the suite, and the UI has no use for a bundle that size.What it does
A pre-run step over
runner.benchmark.tests.max_pre_run_step_size(default512MB) is recorded insummary.jsonand not copied, so it never reaches the bucket.0disables the limit.Two details worth flagging for review:
Checked with a
statbefore the copy, not at upload time. Skipping it at the upload layer would still leave a 9.4 GiB write intoRUNNER_TEMPon every job. Doing it here costs neither the write nor the transfer, and keeps the uploader generic — it has no business knowing which files are pre-run steps.The entry is recorded as
omitted, not dropped. The suite stays honest about what the run replayed, and the UI gets something to check before offering the file for viewing —TestFilesList.tsx:147currently linkssuites/<hash>/<og_path>/pre_run.requestunconditionally, which would 404 for an omitted bundle. That UI guard is a separate change; this PR gives it the flag to read.Tests
TestCreateSuiteOutput_OmitsOversizedPreRunSteps— over the limit: no file written, summary recordsomittedand the true size, test steps unaffected.TestCreateSuiteOutput_KeepsPreRunStepsWithinLimit— under the limit and with the limit disabled, the bundle is stored exactly as before.How this relates to the other PRs
summary.jsonthat the UI actually needs — but with this cap the 9.4 GiB path stops being exercised.CreateSuiteOutput, so whichever of fix(suite): merge into the stored summary, not just the local one #303/feat(suite): cap the pre-run payloads kept in a suite #304 merges second needs a trivial rebase — happy to fold both into an options struct if you'd rather.Verification
make build-core,make lint-core(0 issues), fullgo test ./pkg/... ./cmd/...all pass locally.