From f563b87dc2dba6eac09d702981fe7a7db0a0ba58 Mon Sep 17 00:00:00 2001 From: lens0021 Date: Tue, 18 Aug 2026 00:14:23 +0900 Subject: [PATCH] ci: bake the two smoke sites at once instead of one after the other The reproducibility check bakes the docs site a second time and diffs it, and the two bakes were 209s of the smoke job's 321s. They are independent by construction, so they can run together. The reason it pays is that a bake is mostly one process. Only the skin passes run beside each other, and even those are three on a four-core runner, so a second bake fills cores the first leaves idle rather than taking any from it. Measured locally with two containers pinned to four cores, the runner's count, on an image built from this commit's parent: | | wall clock | |---|---| | one bake alone | 118s | | two, one after the other | 257s | | two at once, four cores between them | 150s | | two at once, two cores each | 166s | 150s is the shape that landed: no cpu flags, both bakes left to size themselves as they do today. Capping them at two cores each is slower, because it also halves the concurrency of the part that does parallelise. An earlier run of the same benchmark gave two bakes at once a spurious win by capping each at four cores on a fourteen-core host, which is eight cores between them and not a runner at all. Peak combined resident memory was 1 GiB against the runner's 16, with no OOM in either log, which was the risk worth measuring: two bakes at three skin passes each is six MediaWiki boots at once. The source mount is read-only now that two containers share it. Only `wikven translate` writes into src, and this is not that. Each bake writes to its own log, because two live logs interleave into neither, and both are printed in collapsed groups afterwards. Verified that the step's own shell propagates a failure: a bake pointed at a source that does not exist ends the step non-zero. Output is byte-identical across every configuration above, which is the check itself agreeing. Refs #461. --- _Generated by [Claude Code](https://claude.ai/code/session_935f02d1)_ Co-authored-by: Claude --- .github/workflows/smoke.yml | 46 +++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 84644d3e6..0bb7ba2ff 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -66,13 +66,38 @@ jobs: tags: wikven cache-from: type=gha,scope=wikven-image - - name: Bake the docs site + # Both bakes of the reproducibility check below, at once. They are independent by construction + # -- separate containers, separate output directories, one shared source -- and most of a + # bake is a single process: only the skin passes run beside each other, so the second bake + # fills cores the first leaves idle rather than taking any from it. Measured on four cores, the + # runner's count: 257s one after the other against 150s together, output byte-identical either + # way, and a combined 1 GiB at peak where the runner has 16. + # + # Each writes to its own log because two live logs interleave into neither. + - name: Bake the docs site twice run: | - mkdir -p dist - docker run --rm \ - -v "$(pwd)/docs:/workspace/src" \ - -v "$(pwd)/dist:/workspace/dist" \ - wikven + set -uo pipefail + mkdir -p dist dist-again + bake() { + docker run --rm \ + -v "$(pwd)/docs:/workspace/src:ro" \ + -v "$(pwd)/$1:/workspace/dist" \ + wikven + } + bake dist > bake.log 2>&1 & + first=$! + bake dist-again > bake-again.log 2>&1 & + second=$! + status=0 + wait "$first" || status=$? + wait "$second" || status=$? + echo '::group::First bake' + cat bake.log + echo '::endgroup::' + echo '::group::Second bake' + cat bake-again.log + echo '::endgroup::' + exit "$status" - name: Assert the bake produced a complete, self-contained site run: | @@ -230,14 +255,11 @@ jobs: # differ. Baking from two separate clones is the stronger check and is not this one: it fails # today because importWikitext.php stamps revisions with filemtime(), which a second clone # changes (#406). - - name: Bake the docs site again and assert the two bakes are identical + # + # Both bakes ran in the step above, at once; this only reads what they wrote. + - name: Assert the two bakes are identical run: | set -euo pipefail - mkdir -p dist-again - docker run --rm \ - -v "$(pwd)/docs:/workspace/src" \ - -v "$(pwd)/dist-again:/workspace/dist" \ - wikven if diff -rq dist dist-again; then echo "Two bakes of the same source are byte-identical." else