Skip to content

ci: speed up CI builds - bake dependency cache, Ubuntu 24.04, fix Task.project deprecations#462

Merged
SJrX merged 3 commits into
242.xfrom
ci-build-speed-improvements
Jun 20, 2026
Merged

ci: speed up CI builds - bake dependency cache, Ubuntu 24.04, fix Task.project deprecations#462
SJrX merged 3 commits into
242.xfrom
ci-build-speed-improvements

Conversation

@SJrX

@SJrX SJrX commented Jun 20, 2026

Copy link
Copy Markdown
Owner

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 image

  • Pin GRADLE_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 runtime GRADLE_USER_HOME didn't match where the warm-up wrote it. Pinning it makes the baked cache actually get used.
    • Stays hermetic: each pod gets its own copy-on-write view of the baked dir from the immutable image, distributed via the registry — no shared mutable host state. A stale baked cache just falls back to downloading, so it's never incorrect.
  • Warm compileTestKotlin too, so the test-framework deps are baked alongside the compile deps.
  • Bump base image to Ubuntu 24.04, removing the default ubuntu user that now occupies UID 1000 so builduser can keep it.

Expected: ~1–1.5 min off every build (the 948 MiB download + much of the metadata-resolution storm).

build: Stop accessing Task.project at execution time

Fixes the 2 deprecations the scan flagged (also a configuration-cache prerequisite):

  • mergePodmanDocumentation called file() inside doLast → hoisted to configuration time.
  • GenerateDataFromManPages read project.layout.buildDirectory in its action → injected via a new renderedXIncludesDir property.

Verification

  • ./gradlew buildPlugin --rerun-tasks --warning-mode allBUILD SUCCESSFUL, no Task.project at execution time deprecations remain.
  • Confirmed the worker-pod template sets no HOME/env, so the image's GRADLE_USER_HOME takes effect at runtime.
  • The next CI build's scan should show the IntelliJ SDK download gone.

Deferred (per discussion on #461 — want a slow-run scan first)

  • Node anti-affinity / CPU requests to address :test CPU contention.
  • Configuration cache for the 1m40s model-configuration (needs persistence + stable checkout path; conflicts with hermeticity).

🤖 Generated with Claude Code

Steve Ramage and others added 3 commits June 20, 2026 08:30
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>
@SJrX SJrX mentioned this pull request Jun 20, 2026
@SJrX SJrX merged commit 039e417 into 242.x Jun 20, 2026
1 check passed
@SJrX SJrX deleted the ci-build-speed-improvements branch June 20, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant