ci: speed up CI builds - bake dependency cache, Ubuntu 24.04, fix Task.project deprecations#462
Merged
Merged
Conversation
Pin GRADLE_USER_HOME to /home/builduser/.gradle so the dependency cache warmed at image-build time - including the ~1 GiB IntelliJ Platform SDK - is reused at runtime instead of being re-downloaded on every CI build. The build scan showed the IDE re-downloaded every run because the runtime GRADLE_USER_HOME did not match where the image warm-up had written it. This stays hermetic: each pod gets its own copy-on-write view of the baked cache from the immutable image, distributed via the registry, with no shared mutable host state. A stale baked cache simply falls back to downloading, so it is never incorrect. Also warm compileTestKotlin so the test-framework dependencies are baked too, and bump the base image to Ubuntu 24.04 - removing the default 'ubuntu' user that now occupies UID 1000 so builduser can keep it. Refs #461 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two task actions resolved paths through Project at execution time, which Gradle has deprecated and which blocks the configuration cache: - mergePodmanDocumentation called file() inside its doLast; hoist the undocumentedJsonFile path to configuration time. - GenerateDataFromManPages read project.layout.buildDirectory in its action; inject it via a new renderedXIncludesDir property set when the task is registered. Refs #461 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Warming compileTestKotlin pulled the docker-compose metadata task
(composeBuild) into the task graph, which fails during the kaniko image
build because no Docker daemon is available:
Task :composeBuild FAILED
> A problem occurred starting process 'command 'docker''
The IntelliJ Platform SDK (the ~1 GiB cache we actually want baked) is
already pulled by compileKotlin, so revert to the proven
'dependencies compileKotlin' warm-up.
Refs #461
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Part of #461. First batch of build-speed work, driven by the Develocity build scan (
https://gradle.com/s/hllckx5e6jnw2).Changes
ci:Bake a usable dependency cache into the build-environment imageGRADLE_USER_HOME=/home/builduser/.gradle. The image already warms the Gradle cache, but the scan showed the ~948 MiB IntelliJ Platform SDK re-downloaded every build because the runtimeGRADLE_USER_HOMEdidn't match where the warm-up wrote it. Pinning it makes the baked cache actually get used.compileTestKotlintoo, so the test-framework deps are baked alongside the compile deps.ubuntuuser that now occupies UID 1000 sobuildusercan keep it.Expected: ~1–1.5 min off every build (the 948 MiB download + much of the metadata-resolution storm).
build:Stop accessingTask.projectat execution timeFixes the 2 deprecations the scan flagged (also a configuration-cache prerequisite):
mergePodmanDocumentationcalledfile()insidedoLast→ hoisted to configuration time.GenerateDataFromManPagesreadproject.layout.buildDirectoryin its action → injected via a newrenderedXIncludesDirproperty.Verification
./gradlew buildPlugin --rerun-tasks --warning-mode all→ BUILD SUCCESSFUL, noTask.project at execution timedeprecations remain.worker-podtemplate sets noHOME/env, so the image'sGRADLE_USER_HOMEtakes effect at runtime.Deferred (per discussion on #461 — want a slow-run scan first)
:testCPU contention.🤖 Generated with Claude Code