Repository navigation
fix(pruner): evict Gradle 9 transforms, cap work dirs and add a host-wide Maven proxy - #47
Merged
Merged
Conversation
…wide Maven proxy Maven Central answered 429 on beelink for Robolectric's 151 MB nativeruntime-dist-compat jar: a per-IP, per-file limit. Every slot kept downloading it again because the pruner could not see Gradle 9's caches/<version>/transforms (23 GB against 1 GB of dependencies on one slot) and evicted dependencies to meet the budget instead. Pruner: - Evict caches/*/transforms/* units, and warn when bytes no STORE_TABLE rule covers pass a quarter of a slot's budget. - Split the budget over active slots only. A slot no runner claimed for SLOT_IDLE_DAYS (7), and whose .lock no live runner holds, is emptied; the preflight records the claim time on the slot's .lock. - Take the maven-proxy cache off the host budget before the split, at most half of it. - Cap each slot's work dir with WORK_BUDGET_BYTES (10 GiB, 0 = off): whole work/<repo> checkouts go, least recently used first; work/_* stays. Maven proxy: - A maven-proxy compose service (nginx) caches Maven Central, Google Maven and the Gradle Plugin Portal under RUNNER_DATA_DIR/maven-proxy, shares one upstream download between concurrent misses, never caches a 429, and follows redirects (absolute or path-only) inside the proxy. - The image ships maven-proxy.gradle, installed by the preflight into ~/.gradle/init.d. It points the three repositories and Robolectric at the proxy when /healthz answers at build start, and leaves builds as declared when it does not or MAVEN_PROXY=off. Tests cover Gradle 9 transforms, the untracked-bytes warning, idle and held slots, the proxy budget share, work dir eviction, the proxy cache against a fake upstream and Gradle 9 through the init script. Closes #45 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
azlekov
force-pushed
the
fix/pruner-gradle9-transforms
branch
from
November 26, 2026 07:30
0948457 to
125941a
Compare
azlekov
enabled auto-merge (squash)
November 26, 2026 07:33
azlekov
added a commit
that referenced
this pull request
Nov 26, 2026
…ate CA (#49) nginx's proxy_ssl_verify_depth defaults to 1: one CA between the leaf and a trusted root. Maven Central's chain runs through Let's Encrypt's Root YE, which Alpine's bundle does not trust, and on to ISRG Root X2 and X1, so every Maven Central download through the proxy failed 502 ("unable to get local issuer certificate") after the rollout of #47. Google Maven and the Plugin Portal were unaffected. The proxy test's fake upstream spoke plain HTTP, so it never verified a chain. It now serves HTTPS with two intermediate CAs and fails 502 without the fix. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 26, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #45.
Since 23 Nov, Android builds on beelink fail with a 429 from Maven Central on
org.robolectric:nativeruntime-dist-compat:1.0.19. Sonatype limits downloads of each file per IP address and blocks this one for about 23 hours. The runners hit the limit because the pruner kept deleting downloaded dependencies, so every slot downloaded the same 150–190 MB Robolectric jars again. The full analysis is in this comment on #45.This PR fixes the pruner and adds a host-wide Maven proxy, so each host downloads an artifact once.
Pruner
caches/<version>/transforms, which no rule covered (only Gradle 8'scaches/transforms-*). On slot 2 they were 23 GB against 1.1 GB of dependencies, so the pruner could only meet the budget by deleting dependencies. A newSTORE_TABLErule evicts these transforms oldest first.SLOT_IDLE_DAYS(default 7) gets no share of the budget and is emptied. The preflight records the claim time onslots/<id>/.lock. If every slot looks idle (the host was stopped), none is emptied.slots/<id>/work, where every repo a slot ever built keeps its checkout and build outputs: 68 GB on beelink, mostly repos untouched since October.WORK_BUDGET_BYTES(default 10 GiB per slot,0turns it off) now evicts wholework/<repo>checkouts, least recently used first. The runner recreates a missing checkout dir andactions/checkoutclones the repo again. The runner's ownwork/_*dirs stay, a busy slot is skipped, and an idle slot loses every checkout.Maven proxy
maven-proxyservice indocker-compose.yml(nginx:1.31.9-alpine) caches Maven Central, Google Maven and the Gradle Plugin Portal under${RUNNER_DATA_DIR}/maven-proxy.MAVEN_PROXY_MAX_SIZE(default20g).proxy_cache_lock).maven-proxy.gradle, which the preflight installs into~/.gradle/init.d. It pointsmavenCentral(),google()andgradlePluginPortal()at the proxy, and Robolectric too (robolectric.dependency.repo.url)./healthzonce when a build starts. If the proxy does not answer, orMAVEN_PROXY=off, Gradle uses the repositories as declared.maven-proxyonly while the runners are idle. The README says so.Why a proxy and not
GRADLE_RO_DEP_CACHEGradle can read a shared read-only dependency cache, which the pruner could seed from the slots. That cache has these limits:
An HTTP proxy has none of these limits. It works with any Gradle version and any Maven client, and builds fall back to the declared repositories when it is down. nginx was chosen over Reposilite because it needs no JVM and no admin account, keeps no state besides its cache, and shares concurrent downloads of the same file.
Tests
tests/pruner-gradle.sh: Gradle 9 transform eviction; thekotlin-dslcache is kept; the untracked-bytes warning.tests/pruner-budget.sh: proxy cache subtraction and its half-budget cap; an idle slot is emptied while the active slots keep their budget; nothing is emptied when every slot is idle.tests/pruner-work.sh: the oldest checkout goes whole andwork/_*stays; no limit withWORK_BUDGET_BYTES=0; a busy slot is left alone; an idle slot loses its checkouts while an active one keeps its own.tests/maven-proxy.sh: the preflight installs the init script and replaces an old copy; the nginx cache against a fake upstream; Gradle 9.9.2 resolves through the proxy and falls back when it is down.tests/image-smoke.sh: the init script is in the image.All pass locally, and shellcheck reports nothing.
Rollout
After merge, build the image and update
RUNNER_IMAGEon each host. Rundocker compose up -dwhile the runners are idle, somaven-proxystarts before the runners pick up jobs.🤖 Generated with Claude Code