Repository navigation
[CI] Use Develocity cache node for the remote Gradle build cache - #40551
Conversation
The remote build cache at beam-cache.apache.org (a Develocity Build Cache Node) has been unusable since its credentials were revoked (INFRA-28474), and the Build Cache Node is reaching end of life. Switch the remote build cache to the Develocity build cache connector, so builds use the built-in Edge node of develocity.apache.org. The cache is anonymously readable, so every build now reads from it, including pull requests and local builds. Writes are authenticated with the Develocity access key instead of a separate username/password, so the GE_CACHE_USERNAME and GE_CACHE_PASSWORD secrets are no longer used. Workflows now read the access key from the BEAM_DEVELOCITY_ACCESS_KEY secret, scoped to the beam project on develocity.apache.org. Only CI push and schedule runs write to the remote cache. Jenkins detection is removed from settings.gradle.kts, as Beam CI no longer runs on Jenkins.
Abacn
left a comment
There was a problem hiding this comment.
Thanks! Just had one question.
| } | ||
| isEnabled = !System.getenv("GRADLE_ENTERPRISE_CACHE_USERNAME").isNullOrBlank() | ||
| remote(develocity.buildCache) { | ||
| isEnabled = true |
There was a problem hiding this comment.
Is isEnabled = true intended, or shall we enable remote cache only for isCI?
I see the description,
Reads: enabled for every build, including pull requests and local builds. The cache on develocity.apache.org is anonymously readable, so no credentials are needed.
Previously remote cache isn't enabled in release candidate builds (https://github.com/apache/beam/blob/master/.github/workflows/build_release_candidate.yml), as it's supposed to start with a fresh build. We can follow up later.
There was a problem hiding this comment.
We recommend enable build cache reads all builds, but only writing from CI. For develocity.apache.org, reads are anonymous, so setting this to true allows contributors to benefit from remote cache reads.
That said, it is configurable if you prefer only CI.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #40551 +/- ##
=============================================
+ Coverage 56.16% 75.82% +19.65%
Complexity 2288 2288
=============================================
Files 1124 259 -865
Lines 178336 14459 -163877
Branches 1489 1487 -2
=============================================
- Hits 100170 10964 -89206
+ Misses 75645 2792 -72853
+ Partials 2521 703 -1818
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
Addresses INFRA-28474.
The remote Gradle build cache at
beam-cache.apache.orghas been returning403 Forbiddensince its credentials were revoked, so CI builds get no remote cache hits. That cache is a Develocity Build Cache Node, which is reaching end of life, so rather than restore its credentials this PR moves the remote cache to the Develocity build cache connector. Builds then use the built-in Edge node ofdevelocity.apache.org, the same server Beam already publishes Build Scans to under thebeamproject.Changes
settings.gradle.ktsHttpBuildCachepointing atbeam-cache.apache.orgwithremote(develocity.buildCache).develocity.apache.orgis anonymously readable, so no credentials are needed.pushandscheduleruns that have a Develocity access key. This keeps the rule from [CI] Make Gradle caches read-only for untrusted presubmit workflow runs #40358 that unmerged code never writes to the remote cache.Workflows (308 files, mechanical)
DEVELOCITY_ACCESS_KEYnow comes from theBEAM_DEVELOCITY_ACCESS_KEYsecret that Apache Infra created for thebeamproject.GRADLE_ENTERPRISE_CACHE_USERNAME/GRADLE_ENTERPRISE_CACHE_PASSWORD. TheGE_CACHE_USERNAMEandGE_CACHE_PASSWORDsecrets are no longer used and can be deleted.Security
pull_request_targetorissue_comment, and fork PRs do not receive secrets, so untrusted code never sees the key.isPushfurther limits those builds to writing to the cache only onpushandscheduleevents.Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123orfixes #456).CHANGES.mdwith noteworthy changes. (CI-only change with no user-facing impact.)See CONTRIBUTING.md for more details.