From 0d09590cf2c33596c3fcea2fa3d0bdd6abcb281e Mon Sep 17 00:00:00 2001 From: Gaurav Tiwari Date: Fri, 13 Nov 2026 14:02:32 +0000 Subject: [PATCH 1/4] Build n8n images with the arguments their Bake targets resolve From n8n commit c86615646b (2026-11-10), the n8n and runners Dockerfiles declare BUILDER_IMAGE, RUNTIME_IMAGE and NODE_IMAGE without defaults. docker/docker-bake.hcl holds the pins. The plans ran docker buildx build with three fixed build arguments, so every lane of every n8n case failed with "base name (${BUILDER_IMAGE}) should not be blank". Preparation now resolves the n8n, runners and runners-distroless Bake targets at the checked-out commit and adds their arguments to the run's plan command. All lanes build the same images. The fixed NODE_VERSION, N8N_VERSION and N8N_RELEASE_TYPE arguments are removed, because the targets set them. Preparation stops if a target builds a different Dockerfile or the plan already sets one of its arguments. --- test/bench/bake_build_args_test.rb | 67 +++++++++++++++++++ tools/README.md | 8 +++ .../n8n-runners-distroless/.boringcache.toml | 3 - tools/docker/n8n-runners-distroless/case.toml | 2 +- tools/docker/n8n-runners/.boringcache.toml | 3 - tools/docker/n8n-runners/case.toml | 2 +- tools/docker/n8n/.boringcache.toml | 3 - tools/docker/n8n/case.toml | 2 +- tools/docker/shared/bake-build-args.rb | 24 +++++++ 9 files changed, 102 insertions(+), 12 deletions(-) create mode 100644 test/bench/bake_build_args_test.rb create mode 100644 tools/docker/shared/bake-build-args.rb diff --git a/test/bench/bake_build_args_test.rb b/test/bench/bake_build_args_test.rb new file mode 100644 index 0000000000..1eb5cff7ba --- /dev/null +++ b/test/bench/bake_build_args_test.rb @@ -0,0 +1,67 @@ +require_relative "test_helper" +require "open3" + +class BakeBuildArgsTest < Minitest::Test + SCRIPT = File.join(Bench::ROOT, "tools/docker/shared/bake-build-args.rb") + + def test_n8n_plans_build_with_the_arguments_their_bake_target_resolves + { "n8n" => "n8n", "n8n-runners" => "runners", "n8n-runners-distroless" => "runners-distroless" }.each do |kase, target| + prepare = TomlRB.load_file(File.join(Bench::ROOT, "tools/docker", kase, "case.toml")).fetch("prepare") + assert_equal %(ruby "$BENCH_ROOT/tools/docker/shared/bake-build-args.rb" upstream/docker/docker-bake.hcl #{target}), prepare.last + command = TomlRB.load_file(File.join(Bench::ROOT, "tools/docker", kase, ".boringcache.toml")).dig("adapters", "docker", "command") + refute_includes command, "--build-arg" + end + end + + def test_resolved_arguments_follow_the_dockerfile + run_script(args: { "BUILDER_IMAGE" => "node:26.13.0-alpine3.24@sha256:aa", "RUNTIME_IMAGE" => "n8nio/base:26.13.0@sha256:bb" }) do |command, output, status| + assert status.success?, output + assert_equal ["docker", "buildx", "build", "--file", "upstream/docker/images/n8n/Dockerfile", + "--build-arg", "BUILDER_IMAGE=node:26.13.0-alpine3.24@sha256:aa", "--build-arg", "RUNTIME_IMAGE=n8nio/base:26.13.0@sha256:bb", + "--tag", "n8n-benchmark:local", "--load", "upstream"], command + end + end + + def test_failed_bake_resolution_stops_preparation + run_script(resolve: false) do |command, output, status| + refute status.success? + assert_includes output, "Cannot resolve the n8n Bake target" + refute_includes command, "--build-arg" + end + end + + def test_a_target_for_another_dockerfile_stops_preparation + run_script(dockerfile: "docker/images/n8n/Dockerfile.debian") do |command, output, status| + refute status.success? + assert_includes output, "builds upstream/docker/images/n8n/Dockerfile.debian" + refute_includes command, "--build-arg" + end + end + + def test_an_argument_set_by_the_plan_and_the_target_stops_preparation + run_script(planned: ["--build-arg", "BUILDER_IMAGE=node:22"], args: { "BUILDER_IMAGE" => "node:26" }) do |command, output, status| + refute status.success? + assert_includes output, "both set BUILDER_IMAGE" + assert_equal 1, command.count("--build-arg") + end + end + + private + def run_script(args: {}, resolve: true, dockerfile: "docker/images/n8n/Dockerfile", planned: []) + Dir.mktmpdir("bake-args") do |dir| + FileUtils.mkdir_p(File.join(dir, "bin")) + command = ["docker", "buildx", "build", "--file", "upstream/docker/images/n8n/Dockerfile", *planned, "--tag", "n8n-benchmark:local", "--load", "upstream"] + File.write(File.join(dir, ".boringcache.toml"), TomlRB.dump("adapters" => { "docker" => { "tag" => "n8n-docker", "command" => command } })) + definition = { "target" => { "n8n" => { "context" => ".", "dockerfile" => dockerfile, "args" => args } } } + File.write(File.join(dir, "bin/docker"), <<~RUBY) + #!#{RbConfig.ruby} + abort "Expected Bake inspection" unless ARGV == %w[buildx bake --file upstream/docker/docker-bake.hcl --print n8n] + exit 1 unless #{resolve} + puts #{JSON.generate(definition).inspect} + RUBY + File.chmod(0o755, File.join(dir, "bin/docker")) + output, status = Open3.capture2e({ "PATH" => "#{dir}/bin:#{ENV.fetch("PATH")}" }, RbConfig.ruby, SCRIPT, "upstream/docker/docker-bake.hcl", "n8n", chdir: dir) + yield TomlRB.load_file(File.join(dir, ".boringcache.toml")).dig("adapters", "docker", "command"), output, status + end + end +end diff --git a/tools/README.md b/tools/README.md index fc5ef1e925..2ae6bd4d80 100644 --- a/tools/README.md +++ b/tools/README.md @@ -131,6 +131,14 @@ objects before the next target. These files were already excluded from every provider's cache; the shared dependency artifacts remain. Failed targets stop the script before verification or cleanup. +The n8n Docker cases build each upstream Dockerfile with the build arguments +that its target in `docker/docker-bake.hcl` resolves at the checked-out commit: +`n8n`, `runners` and `runners-distroless`. Upstream keeps its base image pins +only in that file, and the Dockerfiles have no defaults for them. Preparation +adds the resolved arguments to the run's plan command, so every lane builds +the same images. It stops if the target builds a different Dockerfile or the +plan already sets one of its arguments. + ## Adding The Euro-Office Docker cases start at DocumentServer diff --git a/tools/docker/n8n-runners-distroless/.boringcache.toml b/tools/docker/n8n-runners-distroless/.boringcache.toml index 181224d5bc..87af581ff1 100644 --- a/tools/docker/n8n-runners-distroless/.boringcache.toml +++ b/tools/docker/n8n-runners-distroless/.boringcache.toml @@ -8,9 +8,6 @@ metadata-hints = ["benchmark=n8n-runners-distroless", "upstream-job=build-and-pu command = [ "docker", "buildx", "build", "--file", "upstream/docker/images/runners/Dockerfile.distroless", - "--build-arg", "NODE_VERSION=26.7.0", - "--build-arg", "N8N_VERSION=snapshot", - "--build-arg", "N8N_RELEASE_TYPE=dev", "--provenance", "false", "--sbom", "false", "--tag", "n8n-runners-distroless-benchmark:local", diff --git a/tools/docker/n8n-runners-distroless/case.toml b/tools/docker/n8n-runners-distroless/case.toml index 10c4faf494..a984d8c5f1 100644 --- a/tools/docker/n8n-runners-distroless/case.toml +++ b/tools/docker/n8n-runners-distroless/case.toml @@ -2,7 +2,7 @@ project = "n8n" repo = "n8n-io/n8n" branch = "master" start_sha = "0976d925b91c0652f2fd774737d0cc3ae620f59b" -prepare = ["mise trust && mise install", "bash \"$BENCH_ROOT/tools/shared/stage-vscode-ripgrep.sh\" upstream", "cd upstream && CI=1 pnpm install --frozen-lockfile && CI=1 N8N_SKIP_LICENSES=true pnpm build:n8n"] +prepare = ["mise trust && mise install", "bash \"$BENCH_ROOT/tools/shared/stage-vscode-ripgrep.sh\" upstream", "cd upstream && CI=1 pnpm install --frozen-lockfile && CI=1 N8N_SKIP_LICENSES=true pnpm build:n8n", "ruby \"$BENCH_ROOT/tools/docker/shared/bake-build-args.rb\" upstream/docker/docker-bake.hcl runners-distroless"] check = "docker image inspect n8n-runners-distroless-benchmark:local" [runs] diff --git a/tools/docker/n8n-runners/.boringcache.toml b/tools/docker/n8n-runners/.boringcache.toml index 87a93e69de..ccb25b4f1c 100644 --- a/tools/docker/n8n-runners/.boringcache.toml +++ b/tools/docker/n8n-runners/.boringcache.toml @@ -8,9 +8,6 @@ metadata-hints = ["benchmark=n8n-runners", "upstream-job=build-and-push-docker-i command = [ "docker", "buildx", "build", "--file", "upstream/docker/images/runners/Dockerfile", - "--build-arg", "NODE_VERSION=26.7.0", - "--build-arg", "N8N_VERSION=snapshot", - "--build-arg", "N8N_RELEASE_TYPE=dev", "--provenance", "false", "--sbom", "false", "--tag", "n8n-runners-benchmark:local", diff --git a/tools/docker/n8n-runners/case.toml b/tools/docker/n8n-runners/case.toml index 64f337432c..10b854872e 100644 --- a/tools/docker/n8n-runners/case.toml +++ b/tools/docker/n8n-runners/case.toml @@ -2,7 +2,7 @@ project = "n8n" repo = "n8n-io/n8n" branch = "master" start_sha = "0976d925b91c0652f2fd774737d0cc3ae620f59b" -prepare = ["mise trust && mise install", "bash \"$BENCH_ROOT/tools/shared/stage-vscode-ripgrep.sh\" upstream", "cd upstream && CI=1 pnpm install --frozen-lockfile && CI=1 N8N_SKIP_LICENSES=true pnpm build:n8n"] +prepare = ["mise trust && mise install", "bash \"$BENCH_ROOT/tools/shared/stage-vscode-ripgrep.sh\" upstream", "cd upstream && CI=1 pnpm install --frozen-lockfile && CI=1 N8N_SKIP_LICENSES=true pnpm build:n8n", "ruby \"$BENCH_ROOT/tools/docker/shared/bake-build-args.rb\" upstream/docker/docker-bake.hcl runners"] check = "docker image inspect n8n-runners-benchmark:local" [runs] diff --git a/tools/docker/n8n/.boringcache.toml b/tools/docker/n8n/.boringcache.toml index a412e65aaa..3da17d6221 100644 --- a/tools/docker/n8n/.boringcache.toml +++ b/tools/docker/n8n/.boringcache.toml @@ -8,9 +8,6 @@ metadata-hints = ["benchmark=n8n-docker", "upstream-job=build-and-push-docker-im command = [ "docker", "buildx", "build", "--file", "upstream/docker/images/n8n/Dockerfile", - "--build-arg", "NODE_VERSION=26.7.0", - "--build-arg", "N8N_VERSION=snapshot", - "--build-arg", "N8N_RELEASE_TYPE=dev", "--provenance", "false", "--sbom", "false", "--tag", "n8n-benchmark:local", diff --git a/tools/docker/n8n/case.toml b/tools/docker/n8n/case.toml index 1deea2ca15..53caf97f1e 100644 --- a/tools/docker/n8n/case.toml +++ b/tools/docker/n8n/case.toml @@ -1,7 +1,7 @@ repo = "n8n-io/n8n" branch = "master" start_sha = "0976d925b91c0652f2fd774737d0cc3ae620f59b" -prepare = ["mise trust && mise install", "bash \"$BENCH_ROOT/tools/shared/stage-vscode-ripgrep.sh\" upstream", "cd upstream && CI=1 pnpm install --frozen-lockfile && CI=1 N8N_SKIP_LICENSES=true pnpm build:n8n"] +prepare = ["mise trust && mise install", "bash \"$BENCH_ROOT/tools/shared/stage-vscode-ripgrep.sh\" upstream", "cd upstream && CI=1 pnpm install --frozen-lockfile && CI=1 N8N_SKIP_LICENSES=true pnpm build:n8n", "ruby \"$BENCH_ROOT/tools/docker/shared/bake-build-args.rb\" upstream/docker/docker-bake.hcl n8n"] check = "docker image inspect n8n-benchmark:local" [runs] diff --git a/tools/docker/shared/bake-build-args.rb b/tools/docker/shared/bake-build-args.rb new file mode 100644 index 0000000000..37a3f655dd --- /dev/null +++ b/tools/docker/shared/bake-build-args.rb @@ -0,0 +1,24 @@ +require "json" +require "open3" +require "toml-rb" + +bake_file, name = ARGV +abort "Usage: bake-build-args.rb BAKE_FILE TARGET" unless bake_file && name + +output, status = Open3.capture2("docker", "buildx", "bake", "--file", bake_file, "--print", name) +abort "Cannot resolve the #{name} Bake target" unless status.success? +target = JSON.parse(output).fetch("target").fetch(name) + +plan = TomlRB.load_file(".boringcache.toml") +command = plan.fetch("adapters").fetch("docker").fetch("command") +file = command.index("--file") or abort "The plan command has no --file" +dockerfile = File.join(command.last, target.fetch("dockerfile", "Dockerfile")) +abort "The #{name} Bake target builds #{dockerfile}; the plan builds #{command[file + 1]}" unless command[file + 1] == dockerfile + +args = target.fetch("args", {}) +planned = command.each_cons(2).filter_map { |flag, value| value.split("=", 2).first if flag == "--build-arg" } +duplicates = planned & args.keys +abort "The plan and the #{name} Bake target both set #{duplicates.join(", ")}" if duplicates.any? + +command.insert(file + 2, *args.flat_map { |key, value| ["--build-arg", "#{key}=#{value}"] }) +File.write(".boringcache.toml", TomlRB.dump(plan)) From 7ded8c746376e776905e76981746303536f44134 Mon Sep 17 00:00:00 2001 From: Gaurav Tiwari Date: Fri, 13 Nov 2026 14:02:35 +0000 Subject: [PATCH 2/4] Use the Euro-Office core ccache switch in the plus overlays From Euro-Office core commit 2a3371b60b (2026-11-05), the core stage builds through scripts/build.sh. The stage has an ARG CORE_CCACHE switch and a core-ccache cache mount. The CMake lines that the plus overlay edited are gone, so preparation for every plus lane of euro-office and euro-office-cache stopped with "core Dockerfile changed: expected one "-DCMAKE_BUILD_TYPE=Release \\\n"". On core revisions with that switch, the overlay copies the pinned ccache binaries into the core stage and sets CORE_CCACHE=1. Lanes that do not archive local compiler caches also drop the core-ccache mount, as they already did for the WASM ccache mount. Earlier core revisions keep the existing edits. Base lanes still build the upstream Dockerfile unchanged. --- test/bench/euro_office_preparation_test.rb | 65 ++++++++++++++++++++-- tools/README.md | 4 ++ tools/docker/shared/euro-office-cache.rb | 15 ++++- 3 files changed, 79 insertions(+), 5 deletions(-) diff --git a/test/bench/euro_office_preparation_test.rb b/test/bench/euro_office_preparation_test.rb index cf2fd4aa39..daa633d79c 100644 --- a/test/bench/euro_office_preparation_test.rb +++ b/test/bench/euro_office_preparation_test.rb @@ -17,6 +17,27 @@ def test_plus_preserves_source_and_adds_compiler_and_mount_caches end end + def test_plus_turns_on_the_upstream_ccache_switch_of_the_build_script_core + prepare_core(source: build_script_core_source) do |dir, source, output, status| + assert status.success?, output + assert_equal source, File.read(File.join(dir, "upstream/core/.docker/core.bake.Dockerfile")) + dockerfile = File.read(File.join(dir, "overlay/core.Dockerfile")) + assert_includes dockerfile, "FROM core-base AS core\nCOPY bench-ccache/ccache /usr/local/bin/ccache\nCOPY bench-ccache/ccache-storage-http /usr/local/bin/ccache-storage-http\n" + assert_includes dockerfile, " ARG CORE_CCACHE=1\n" + assert_includes dockerfile, "--mount=type=cache,target=/ccache,id=core-ccache" + assert_includes dockerfile, "id=vcpkg-binary-cache" + assert_equal source.lines.size + 2, dockerfile.lines.size + end + end + + def test_build_script_core_without_its_ccache_switch_stops_preparation + prepare_core(source: build_script_core_source.sub(" ARG CORE_CCACHE\n", "")) do |dir, _, output, status| + refute status.success? + assert_includes output, "core Dockerfile changed" + refute File.exist?(File.join(dir, "overlay/core.Dockerfile")) + end + end + def test_changed_compile_step_stops_preparation prepare_core(replace: "cmake --build . --parallel") do |dir, _, output, status| refute status.success? @@ -97,13 +118,30 @@ def test_native_control_archives_compiler_caches_as_well_as_build_state end end + def test_combined_cache_leaves_the_build_script_core_compiler_cache_remote + prepare_standalone(plus: true, core: build_script_core_source) do |dir, _, output, status| + assert status.success?, output + core = File.read(File.join(dir, "overlay/core.Dockerfile")) + assert_includes core, " ARG CORE_CCACHE=1\n" + assert_includes core, "target=/build-cache" + refute_includes core, "target=/ccache" + end + end + + def test_native_control_keeps_the_build_script_core_compiler_cache_mount + prepare_standalone(plus: true, local_cache: true, core: build_script_core_source) do |dir, _, output, status| + assert status.success?, output + assert_includes File.read(File.join(dir, "overlay/core.Dockerfile")), "--mount=type=cache,target=/ccache,id=core-ccache" + end + end + private - def prepare_standalone(resolve: true, plus: false, local_cache: false) + def prepare_standalone(resolve: true, plus: false, local_cache: false, core: core_source) Dir.mktmpdir("euro-office") do |dir| %w[upstream/core/.docker overlay bin].each { FileUtils.mkdir_p(File.join(dir, it)) } File.write(File.join(dir, "upstream/VERSION"), "9.3.6-rc.1\n") File.write(File.join(dir, ".boringcache.toml"), "[adapters.docker]\ntool-cache = #{plus ? '["ccache:test"]' : '[]'}\n") - File.write(File.join(dir, "upstream/core/.docker/core.bake.Dockerfile"), core_source) + File.write(File.join(dir, "upstream/core/.docker/core.bake.Dockerfile"), core) File.write(File.join(dir, "upstream/core/.docker/core-wasm.bake.Dockerfile"), <<~'DOCKERFILE') FROM emsdk AS core-wasm COPY core /core @@ -134,11 +172,10 @@ def prepare_standalone(resolve: true, plus: false, local_cache: false) end end - def prepare_core(plus: true, replace: nil) + def prepare_core(plus: true, replace: nil, source: core_source) Dir.mktmpdir("euro-office") do |dir| FileUtils.mkdir_p(File.join(dir, "upstream/core/.docker")) FileUtils.mkdir_p(File.join(dir, "overlay")) - source = core_source source = source.sub("cmake --build .", replace) if replace File.write(File.join(dir, "upstream/core/.docker/core.bake.Dockerfile"), source) File.write(File.join(dir, ".boringcache.toml"), "[adapters.docker]\nmount-cache = #{plus}\n") @@ -161,6 +198,26 @@ def core_source DOCKERFILE end + def build_script_core_source + <<~'DOCKERFILE' + FROM core-base AS core + + COPY core /core + + ARG CORE_CCACHE + RUN --mount=type=cache,target=/build-cache \ + --mount=type=cache,target=/nuget-cache,id=vcpkg-binary-cache \ + --mount=type=cache,target=/ccache,id=core-ccache \ + --mount=type=secret,id=remote_cache_s3_access_key \ + export CCACHE_DIR=/ccache CCACHE_MAXSIZE=2G && \ + mkdir -p ${BUILD_ROOT} && \ + ${CORE_CCACHE:+ccache --zero-stats} && \ + /core/scripts/build.sh --build-dir /build-cache --output /build-cache/package ${CORE_CCACHE:+--ccache} && \ + ${CORE_CCACHE:+ccache --show-stats} && \ + cp -r /build-cache/package/* ${BUILD_ROOT} + DOCKERFILE + end + def stage_stub(dir) helper = File.join(dir, "tools/docker/shared/stage-ccache-binary.sh") FileUtils.mkdir_p(File.dirname(helper)) diff --git a/tools/README.md b/tools/README.md index 2ae6bd4d80..cd9f3ebb12 100644 --- a/tools/README.md +++ b/tools/README.md @@ -149,6 +149,10 @@ includes the seed and thirty later commits, with four distinct core revisions. resolved by its Bake target, then checks `x2t` and `allfontsgen`. Its plus plan adds ccache launchers and a ccache mount to a generated Dockerfile; both plus providers use that file and preserve the existing build and vcpkg mounts. +Core revisions that declare `CORE_CCACHE` compile through ccache themselves. +For those, the generated Dockerfile copies the pinned ccache binaries and sets +`CORE_CCACHE=1`. It keeps upstream's `core-ccache` mount only for lanes that +archive local compiler caches. All lanes retain the dependency downloads and builds defined at each revision. The history crosses upstream's migration to anonymous S3 dependency downloads. `euro-office` builds the upstream `standalone` Bake target, including packaging, diff --git a/tools/docker/shared/euro-office-cache.rb b/tools/docker/shared/euro-office-cache.rb index dc97b3d574..a1a0bc80f5 100644 --- a/tools/docker/shared/euro-office-cache.rb +++ b/tools/docker/shared/euro-office-cache.rb @@ -1,7 +1,11 @@ module EuroOfficeCache + CCACHE_BINARIES = "COPY bench-ccache/ccache /usr/local/bin/ccache\nCOPY bench-ccache/ccache-storage-http /usr/local/bin/ccache-storage-http\n".freeze + def self.core(source, local_cache: true) + return build_script_core(source, local_cache:) if source.include?("ARG CORE_CCACHE\n") + replacements = { - "FROM core-base AS core\n" => "FROM core-base AS core\nCOPY bench-ccache/ccache /usr/local/bin/ccache\nCOPY bench-ccache/ccache-storage-http /usr/local/bin/ccache-storage-http\nENV CCACHE_DIR=/root/.cache/ccache\n", + "FROM core-base AS core\n" => "FROM core-base AS core\n#{CCACHE_BINARIES}ENV CCACHE_DIR=/root/.cache/ccache\n", "-DCMAKE_BUILD_TYPE=Release \\\n" => "-DCMAKE_BUILD_TYPE=Release \\\n -DCMAKE_C_COMPILER_LAUNCHER=ccache \\\n -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \\\n", "cmake --build . &&" => "ccache --zero-stats && cmake --build . && ccache --show-stats &&", } @@ -11,6 +15,15 @@ def self.core(source, local_cache: true) replace(source, replacements, "core") end + def self.build_script_core(source, local_cache:) + replacements = { + "FROM core-base AS core\n" => "FROM core-base AS core\n#{CCACHE_BINARIES}", + "ARG CORE_CCACHE\n" => "ARG CORE_CCACHE=1\n", + } + replacements[" --mount=type=cache,target=/ccache,id=core-ccache \\\n"] = "" unless local_cache + replace(source, replacements, "core") + end + def self.wasm(source, local_cache: true) replacements = { " COPY core /core\n" => " COPY bench-ccache/ccache /usr/local/bin/ccache\n COPY bench-ccache/ccache-storage-http /usr/local/bin/ccache-storage-http\n ENV CCACHE_DIR=/ccache\n COPY core /core\n", From 1805c58f12727e8faacbd958f0d673ec6ebf96aa Mon Sep 17 00:00:00 2001 From: Gaurav Tiwari Date: Fri, 13 Nov 2026 14:02:39 +0000 Subject: [PATCH 3/4] Let BuildKit pruning continue when GitHub has evicted indexed blobs The prune job refused to delete anything unless 95% of the blobs that the newest active indexes reference were listed. From 2026-11-05 GitHub evicted cache entries that those indexes still reference. Coverage fell from 100% to 61.9%, and every scheduled run since has failed without deleting. The stale backlog grew to 217 GB, which adds to the eviction. The guard now requires 50%. A share below that still stops the job, because it means the index format and the blob keys no longer match. Unlisted blobs are never deletion candidates, so a lower share does not put referenced blobs at risk. --- AGENTS.md | 2 +- lib/bench/buildkit_prune.rb | 2 +- test/bench/buildkit_prune_test.rb | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d015d0ca96..1b8873fd5c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,7 +35,7 @@ This repository benchmarks BoringCache against other cache providers on real pro - Each regular lane rolls on one fixed cache scope, `--rolling`. `[samples]` reserves selected lanes for weekly `mode=sample` builds of the latest completed GitHub source commit; samples also run when upstream has no new commit and do not advance rolling. They share the project's rolling concurrency group. BoringCache samples restore the regular GitHub cache without publishing; native caches persist between samples. Fresh runs use their own scopes and exclude sample lanes. Legacy `[nightly]` behavior remains supported for historical configurations. - When a lane, runner or rolling series leaves `[runs]`, delete its BoringCache tags with `boringcache rm --no-platform --no-git boringcache/benchmarks `, listing them by exact name. Its records stay in `results/`. - `schedule.yml` runs `bin/bench tick` every 15 minutes. It checks each idle project in `rolling.toml` against its upstream branch and dispatches only when a commit is due at its configured stride. Active or queued rolling and sample projects wait for a later tick. An upstream check failure is reported and fails the tick without dispatching that project. The workflow's concurrency group runs one rolling run per project at a time. -- `prune-buildkit.yml` deletes stale BuildKit `type=gha` blobs every 2 hours. +- `prune-buildkit.yml` deletes stale BuildKit `type=gha` blobs every 2 hours. It deletes only when at least half of the blobs referenced by the newest active indexes are listed. A lower share means the index and blob keys no longer match. GitHub can evict blobs that an index still references, so some missing blobs are expected. - `report.yml` regenerates `data/results.json` and `data/report.md` hourly from recorded results. Experimental lanes are excluded. - A failed build or output check is recorded first, then fails its job. A failure in `prepare` leaves no record; that lane continues at the next step. - Re-run a failed rolling job only before the next step of that project starts. A re-run of an older step skips its build once a newer step is recorded for that lane, so it can never overwrite the newer cache. diff --git a/lib/bench/buildkit_prune.rb b/lib/bench/buildkit_prune.rb index 668bd806db..31ab0b7806 100644 --- a/lib/bench/buildkit_prune.rb +++ b/lib/bench/buildkit_prune.rb @@ -6,7 +6,7 @@ class BuildkitPrune INDEX = /\Aindex-(?.+)-1-[0-9a-f]{8}(?:-sig)?#(?\d+)\z/ MIN_AGE = 6 * 3600 KEEP_INDEXES = 2 - MIN_COVERAGE = 0.95 + MIN_COVERAGE = 0.5 Plan = Struct.new(:blobs, :indexes, :referenced, :missing, :coverage, :deletable, keyword_init: true) do def bytes diff --git a/test/bench/buildkit_prune_test.rb b/test/bench/buildkit_prune_test.rb index 6a23c57306..b10e589dbb 100644 --- a/test/bench/buildkit_prune_test.rb +++ b/test/bench/buildkit_prune_test.rb @@ -41,6 +41,15 @@ def test_nothing_is_deletable_when_the_index_does_not_match_the_listed_blobs assert_equal [2, 0.0, false], [result.missing, result.coverage, result.deletable] end + def test_blobs_evicted_after_their_index_was_written_do_not_stop_the_prune + indexes = [index("docker-app-gha-github-rolling", 1)] + layers = { indexes.first["key"] => %w[sha256:aa sha256:bb sha256:cc sha256:dd sha256:ee] } + result = plan(layers:, blobs: [blob("aa"), blob("bb"), blob("cc"), blob("ff")], indexes:) + + assert_equal [2, 0.6, true], [result.missing, result.coverage, result.deletable] + assert_equal %w[sha256:ff], result.blobs.map { it["key"].delete_prefix("buildkit-blob-1-") } + end + def test_the_newest_index_is_chosen_by_its_version_number indexes = [index("docker-app-gha-github-rolling", 9), index("docker-app-gha-github-rolling", 10)] From 3cd35e3e795b4868b50cac4767d0d5a413cebc4c Mon Sep 17 00:00:00 2001 From: Gaurav Tiwari Date: Fri, 13 Nov 2026 14:02:42 +0000 Subject: [PATCH 4/4] Stop rolling moon Zitadel Upstream replaced moon with Turborepo in zitadel/nextgen commit 8ff8273110 (2026-11-12). Every rolling run since fails with Command "moon" not found, so the project leaves the rolling schedule. The case definition and its records stay. --- PLAN.md | 1 + rolling.toml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/PLAN.md b/PLAN.md index 7075f42031..ac8a9109a4 100644 --- a/PLAN.md +++ b/PLAN.md @@ -45,6 +45,7 @@ The superseded measurements are available in [Git history](https://github.com/bo | Docker Vocion | 2026-10-28 | Removed from the rolling schedule at the user’s request. Definitions and measurements remain in `tools/docker/vocion` and `results/docker/vocion`. Last completed publication run: [40686377453](https://github.com/boringcache/benchmarks/actions/runs/40686377453). Filesystem diagnostic [40676640825](https://github.com/boringcache/benchmarks/actions/runs/40676640825) stopped; its dedicated workflow is disabled. | | Docker Eclipse OpenSOVD | 2026-10-28 | Removed from the rolling schedule at the user’s request. Definitions and measurements remain in `tools/docker/opensovd` and `results/docker/opensovd`. Last completed run: [40673476105](https://github.com/boringcache/benchmarks/actions/runs/40673476105). | | Cargo Bevy Explorer | 2026-10-28 | Dropped because [the upstream repository](https://github.com/decentraland/bevy-explorer) is archived; GitHub API verified `archived: true` on this date. Removed from the rolling schedule. Definitions and measurements remain in `tools/cargo/bevy-explorer` and `results/cargo/bevy-explorer`. Last completed run: [40686361441](https://github.com/boringcache/benchmarks/actions/runs/40686361441). | +| moon Zitadel | 2026-11-13 | Removed from the rolling schedule. Upstream replaced moon with Turborepo in `zitadel/nextgen` commit `8ff8273110` on 2026-11-12, and every rolling run since fails with `Command "moon" not found` ([run 43311950530](https://github.com/boringcache/benchmarks/actions/runs/43311950530)). From 2026-11-03 the builds passed but the output check failed, because the console build moved to `api/internal/staticui/console/dist` ([run 41580361010](https://github.com/boringcache/benchmarks/actions/runs/41580361010)). Definitions and measurements remain in `tools/moon/zitadel` and `results/moon/zitadel`. Last completed run: [41579157320](https://github.com/boringcache/benchmarks/actions/runs/41579157320). | ## Removed cases diff --git a/rolling.toml b/rolling.toml index 4ab718d9f1..7537354e7f 100644 --- a/rolling.toml +++ b/rolling.toml @@ -6,7 +6,6 @@ docker = ["chroma", "discourse", "dspace", "duckgres", "euro-office", "euro-offi go = ["hugo"] gradle = ["opentelemetry-java"] maven = ["spring-ai"] -moon = ["zitadel"] nix = ["zed"] nx = ["storybook"] pants = ["backend-ai"]