← Back to Pull requests

ci: cut Docker test job from 40m to 25m by building a lean distribution #20297

Closed
unknown closed this pull request without merging on Sep 15, 2026 05:20 UTC
View on GitHub
unknown unknown commented on Sep 08, 2026 12:32 UTC
Author

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-check job, which is off the CI critical path.

Observed Docker baseline

Baseline is the master Docker 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, from apache-release) | 7.7 min | No |
| exec:exec (of which generate-licenses-report in distribution: 229s) | 6.5 min | No, source release only |
| checkstyle:check | 5.0 min | No |
| web-console npm 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 distribution module also ran alone for the last 5m36s of the build (three of four cores idle), almost entirely in the apache-release-only generate-licenses-report execution and the source-release assembly.

In the test step, -pl embedded-tests -am re-ran 38 upstream modules (including web-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-check builds the distribution with -Prat -Pdist -Pbundle-contrib-exts and runs checkstyle, pmd, forbiddenapis, animal-sniffer, enforcer and cyclonedx; static-checks-maven runs the same static checks plus spotbugs. The only checks that had no other CI run were the apache-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 with mvn -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. benchmarks is 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 with web.console.skip=true), and packaging-check still builds and packages the console with -Dweb.console.skip=false on every commit. web-console was 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. Drops apache-release, rat and all static checks from the Docker job. .github/scripts/build-dist is 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.skip to 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: replace license_checks_script.sh with a standalone repo-wide apache-rat:check -Prat. RAT stays here because packaging-check excludes benchmarks from its reactor; the license dependency report generation and check-licenses.py are now covered by packaging-check via apache-release. Also remove the duplicate distribution install.
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, so embedded-tests resolves its dependencies (including the test-scoped web-console) from ~/.m2/repository. If a persisted build cache is ever reintroduced, -am must come back or maven-install-plugin must be forced via runAlways.
5. .github/scripts/openrewrite.sh: remove the duplicate distribution install.

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.sh and openrewrite.sh are:

mvn -B install -q -ff -pl distribution -P skip-tests -Dweb.console.skip=true ...

They only install the default distribution project without the packaging profiles, and neither script consumes the result. packaging-check.sh remains 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 runs apache-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.

Diff: 650 lines (+487 / -163) across 8 files Reviewer: GWphua Review duration: 9648m
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
0.52
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 52% (MEDIUM) · Higher = larger blast radius
52%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 20.5% · Safe to merge
20.5%
Repository