Repository navigation
Conversation
…artifact once Every runner slot keeps its own Gradle cache, so a host fetched the same jars once per slot and again after each pruner eviction, until Maven Central's per-IP, per-file limit blocked it for ~23 h (#45). - maven-proxy service: nginx proxy_cache for Maven Central, Google Maven and the Gradle Plugin Portal. proxy_cache_lock coalesces concurrent misses into one upstream download, Plugin Portal redirects are followed and cached, 429/5xx are never cached, and the cache is LRU-bounded by MAVEN_PROXY_MAX_SIZE. - maven-proxy.gradle: init script that the preflight installs into ~/.gradle/init.d. It redirects only the three upstream repositories and Robolectric's runtime downloads, and leaves the build as declared when the proxy does not answer. - MAVEN_PROXY=off disables it per host (in .env) or per job (in env). - tests/maven-proxy.sh covers the preflight install, the real compose service against a fake upstream, and, when gradle is on PATH, the init script. Refs #45 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Closing: the issue #45 work lands in one consolidated PR together with the pruner fix. The branch feat/maven-proxy stays for that PR. |
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.
Refs #45
Why
Each runner slot keeps its own Gradle cache under
slots/<id>/cache/gradle, and the pruner evicts from those caches. A host therefore downloaded the same Robolectric jars (nativeruntime-dist-compatat ~150 MB,android-all-instrumentedat ~190 MB) once per slot and again after each eviction. Maven Central's per-IP, per-file limit then blocked the beelink host (5 slots behind one IP) for ~23 h. This is the structural fix: one upstream download per host. The pruner fix for Gradle 9's cache dirs is in a separate branch.What
maven-proxyservice (maven-proxy/default.conf.template, nginx1.31.9-alpine): a caching proxy at/maven2/,/google/and/plugins/.proxy_cache_lockmakes concurrent misses for one file wait for a single upstream download.200is cached until LRU eviction or 90 days unused;404andmaven-metadata.xmlfor 10 min.429and5xxare never cached.RUNNER_DATA_DIR/maven-proxy, bounded byMAVEN_PROXY_MAX_SIZE(default20g).maven-proxy/maven-proxy.gradle: a Groovy init script that ships in the image. The preflight copies it into each slot's~/.gradle/init.d, and only when it has changed./healthzonce per build. If the proxy is down, the build keeps its declared repositories and Gradle logs a warning.robolectric.dependency.repo.urlat the proxy, because Robolectric downloadsandroid-alljars itself at test time.MAVEN_PROXY=offin.envto disable it on a host, or in a job'senvto disable it for that job.--scale maven-proxy=0also works, because the runners fall back to upstream.Why nginx, not
GRADLE_RO_DEP_CACHEor ReposiliteA read-only dependency cache seeded by the pruner:
android-all-instrumentedis one of the two jars that triggered the block.The proxy is independent of the Gradle version, serves any Maven client, and fails open. Reposilite would mean a JVM (heavy on the Pi), stored state and an admin token, with no clear coalescing of concurrent misses.
Tests
tests/maven-proxy.sh:MAVEN_PROXY=offor without a URL.maven-proxyservice against a fake upstream nginx, and checks:429is passed through and not cached, metadata is cached, and unknown paths return 404 without reaching upstream.gradleis on PATH): repositories are redirected and Robolectric is pointed at the proxy; a dependency resolves through the proxy; the declared repositories are kept, with a warning, when the proxy is down;MAVEN_PROXY=offopts a job out.Local results:
gradleimage. With--warning-mode=allthere are no deprecations, and the configuration cache works.429cached, no redirect follow) fails the test as expected.tests/*.shpass inubuntu:24.04; shellcheck anddocker compose configare clean.image-smoke.shnow checks that the init script is in the image.Follow-up (not in this PR)
Robolectric keeps its downloaded jars in
~/.m2/repository. That path is not linked into the slot, so it lives in the container's writable layer, outside the pruner's budget.🤖 Generated with Claude Code