ci: cut Docker test job from 40m to 25m by building a lean distribution #20297
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #20297"
general
weight: 0.35
GWphua
Summary
Cut the Docker test job from 39m41s to 25m06s by building only what the Docker image needs, and move the release-only validation it used to perform into the
packaging-checkjob, which is off the CI critical path.Observed Docker baseline
Baseline is the
masterDocker job in workflow run 34300307586, job 102305613946, at commit cc8b586. The job completed successfully in 39m41s:| Step | Duration |
| --- | ---: |
| Build the Druid distribution | 18m20s |
| Build the Docker image | 1m29s |
| Run Docker tests | 19m08s |
Attributing the Maven goals in the distribution-build log to CPU time (45 CPU-minutes on a 4-vCPU runner):
| Goal | CPU time | Needed for the Docker image? |
| --- | ---: | --- |
|
cyclonedx:makeBom(118 modules) | 13.1 min | No ||
javadoc:jar(79 modules, fromapache-release) | 7.7 min | No ||
exec:exec(of whichgenerate-licenses-reportindistribution: 229s) | 6.5 min | No, source release only ||
checkstyle:check| 5.0 min | No ||
web-consolenpm install + build | 4.7 min | Yes ||
assembly:single(binary 36s, source release 42s) | 2.0 min | Binary only ||
compile+testCompile| 2.7 min | Yes ||
apache-rat:check| 1.5 min | No |The
distributionmodule also ran alone for the last 5m36s of the build (three of four cores idle), almost entirely in theapache-release-onlygenerate-licenses-reportexecution and the source-release assembly.In the test step,
-pl embedded-tests -amre-ran 38 upstream modules (includingweb-console, ~2 minutes) before the first test started.All of the removed work is already validated on the same commit by the Static Checks CI workflow:
packaging-checkbuilds the distribution with-Prat -Pdist -Pbundle-contrib-extsand runs checkstyle, pmd, forbiddenapis, animal-sniffer, enforcer and cyclonedx;static-checks-mavenruns the same static checks plus spotbugs. The only checks that had no other CI run were theapache-release-only ones: javadoc generation, source jars, the source-release assembly and the license dependency reports.Changes
1.
.github/workflows/docker-tests.yml: build the distribution inline withmvn -B -T1C clean install -pl '!benchmarks' -Pdist,bundle-contrib-exts,skip-static-checks,skip-tests -Dweb.console.skip=true, the same profiles the Dockerfile builder stage uses.benchmarksis excluded since nothing in the distribution or the Docker tests depends on it (no measurable time saving; it ran on an idle thread). The web console assets are skipped: no Docker test uses the console, the router tolerates the missing assets (the unit-test shards already run embedded routers withweb.console.skip=true), andpackaging-checkstill builds and packages the console with-Dweb.console.skip=falseon every commit.web-consolewas the critical path of the lean build (3m49s of 5m04s), so this should bring the step to roughly 4 minutes. The image under test therefore differs from the shipped image only in lacking the console assets. Dropsapache-release,ratand all static checks from the Docker job..github/scripts/build-distis deleted: the Docker workflow was its only caller and the name suggested a general-purpose release build.2.
.github/scripts/packaging-check.sh: add-Papache-release -Dgpg.skip -Ddependency-check.skipto both Maven invocations, so javadoc, source jars, the source-release assembly and the license dependency reports keep a CI run. This job is not on the critical path of its workflow.3.
.github/scripts/static-checks-maven.sh: replacelicense_checks_script.shwith a standalone repo-wideapache-rat:check -Prat. RAT stays here becausepackaging-checkexcludesbenchmarksfrom its reactor; the license dependency report generation andcheck-licenses.pyare now covered bypackaging-checkviaapache-release. Also remove the duplicatedistributioninstall.4.
.github/scripts/run_docker-tests: drop-am. The distribution build step installs every reactor module on the fresh runner and no Maven build cache is persisted across jobs, soembedded-testsresolves its dependencies (including the test-scopedweb-console) from~/.m2/repository. If a persisted build cache is ever reintroduced,-ammust come back ormaven-install-pluginmust be forced viarunAlways.5.
.github/scripts/openrewrite.sh: remove the duplicatedistributioninstall.The only workflow change is the inlined build step; no caching or job-graph changes.
Distribution-install cleanup rationale
The removed commands in
static-checks-maven.shandopenrewrite.share:They only install the default
distributionproject without the packaging profiles, and neither script consumes the result.packaging-check.shremains the job that builds and validates the distribution.Measured outcome
PR head 05d007f, Unit & Integration run 34428720842 and Static Checks run 34428720600:
| Job / step | Baseline | This PR | Δ |
| --- | ---: | ---: | ---: |
| Docker: Build the Druid distribution | 18m20s | 2m46s | −15m34s |
| Docker: Build the Docker image | 1m29s | 1m05s | −24s |
| Docker: Run Docker tests | 19m08s | 17m15s | −1m53s (Maven overhead before first test 2m00s → 13s) |
| Docker job total | 39m41s | 21m47s | −17m54s |
|
packaging-check(now runsapache-release) | 13m27s | 19m00s | +5m33s ||
static-checks-maven(license reports removed, RAT kept) | 32m06s | 27m27s | −4m39s || Static Checks CI workflow (longest job) | 32m06s | 27m27s | −4m39s |
All 107 Docker tests pass (19 skipped, as on master). The Docker job is no longer the longest job in the Unit & Integration workflow; the unit-test shards (~35–37 min) are now the critical path.