Repository navigation
ci: keep BuildKit state on a RunsOn sticky disk and allow Testcontainers reuse - #40
Merged
Merged
Conversation
…ers reuse Docker image builds resolved Gradle from scratch every time (~3 min in service-moderation): the Dockerfiles' --mount=type=cache mounts are not carried by any cache exporter. The default RunsOn label now adds a sticky=docker disk and runs-on/action in buildkit mode, so the builder's whole state, cache mounts included, is snapshotted per repo and branch. Gradle CI opts the ephemeral runner into Testcontainers reuse, which Quarkus Dev Services already request.
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.
Docker builds: sticky BuildKit state
Every image build ran Gradle from scratch, ~3 min in service-moderation, because the Dockerfiles'
RUN --mount=type=cache,target=/root/.gradle/...mounts are never exported by any cache backend (type=gha,s3,registry). The default RunsOn label now addssticky=docker:30gb, andruns-on/actionruns inbuildkitmode. The Buildx builder's whole state, cache mounts included, then lives on an EBS disk that is snapshotted per repo and branch, with fallback to the default branch.cleanup: falselets the RunsOn post step snapshot the disk.runneroverride has no sticky label, so the mode is skipped. GitHub-hosted (public) builds are unchanged.Measured on groundsgg/service-moderation#150 (PR build, 4 vCPU spot):
CACHEDGradle CI: Testcontainers reuse
Quarkus Dev Services request container reuse, but Testcontainers ignored the request ("Reuse was requested but the environment does not support the reuse of containers", 6× per run in service-moderation). The runner now opts in through
~/.testcontainers.properties. This is safe because the runner is discarded after the job. On #150 the warning is gone and the tests stay green; the test duration barely moved there (307 s → 292 s).Tests
test_sticky_buildkit_state_only_with_the_default_runs_on_label.python -m unittest discover -s tests: 11 tests OK.