FrankChen021 opened a new pull request, #20270:
URL: https://github.com/apache/druid/pull/20270

   ## Summary
   
   Re-orchestrate the CI jobs and remove redundant build work to reduce the time
   required to validate a change.
   
   ## Current job dependencies
   
   Before this change, the workflow was effectively:
   
   ```text
   unit-tests (including validate-dist) -> docker-tests -> actions-timeline
   ```
   
   The `docker-tests` job had `needs: [unit-tests]`, so it waited for the 
complete
   unit-test reusable workflow, including distribution validation, before it 
could
   start.
   
   After this change:
   
   ```text
   unit-tests ─┐
               ├─ actions-timeline
   docker-tests ┘
   ```
   
   The unit-test and Docker-test workflows run independently. The timeline job
   remains reporting-only and waits for both workflows.
   
   ## Key problems
   
   - Docker tests were unnecessarily gated by all unit-test shards.
   - The distribution was built in a separate `validate-dist` job and 
transferred
     through an artifact before Docker testing.
   - The Docker workflow performed unnecessary image save/load/prune operations.
   - The Docker image could rebuild the application from source.
   - Docker-test Maven execution verified the entire reactor instead of the
     required `embedded-tests` module and its dependencies.
   - JavaScript and Python CodeQL jobs performed unnecessary Java setup and 
Maven
     compilation.
   - The distribution build was single-threaded.
   
   ## Changes
   
   - Remove the separate distribution-validation job from the unit-test 
workflow.
   - Rename `.github/scripts/validate-dist` to `.github/scripts/build-dist` and 
run
     it in the Docker job.
   - Use Maven `-T1C` for the distribution build.
   - Build the Docker image from the host-built distribution with
     `BUILD_FROM_SOURCE=false`.
   - Remove the Docker image save/load/prune cycle and distribution artifact
     handoff.
   - Allow the host-built distribution tarball into the Docker build context.
   - Limit Docker-test Maven execution to `embedded-tests` and its dependencies
     with `-pl embedded-tests -am`.
   - Remove the Docker job dependency on the unit-test workflow.
   - Skip Java setup and Maven compilation for JavaScript and Python CodeQL 
jobs.
   
   ## Measured outcome
   
   ### Successful upstream master baseline
   
   The baseline is commit `e9db64b6e97c974975321f51085936f9c27e13f9` on the
   Apache Druid `master` branch. All three relevant workflows completed
   successfully:
   
   - [Unit & Integration tests 
CI](https://github.com/apache/druid/actions/runs/34004622921)
   - [Static Checks 
CI](https://github.com/apache/druid/actions/runs/34004622770)
   - [CodeQL](https://github.com/apache/druid/actions/runs/34004622568)
   
   The complete upstream CI window was **1h15m55s**. The Docker job started
   **40m18s after** the Unit & Integration workflow began because of the 
existing
   dependency.
   
   ### Current branch benchmark
   
   The previous equivalent fork benchmark measured a complete substantive CI
   window of **41m36s**. The Docker job started two seconds after the workflow 
and
   completed successfully. One `S*` unit-test shard failed, so this benchmark is
   performance evidence rather than a green validation result.
   
   | Metric | Successful upstream `master` | Current branch benchmark | 
Difference |
   | --- | ---: | ---: | ---: |
   | Unit & Integration workflow | 1h15m55s | 41m36s | 34m19s faster |
   | Docker job runtime | 35m27s | 35m55s | 28s slower |
   | Docker job start delay | 40m18s | 2s | 40m16s earlier |
   | CodeQL workflow | 30m41s | 27m27s | 3m14s faster |
   
   The Docker job is slightly longer because it now performs the host 
distribution
   build, but the job becomes available immediately instead of waiting for the
   unit-test workflow.
   
   ### CodeQL breakdown
   
   | CodeQL job | Successful upstream `master` | Current branch benchmark | 
Difference |
   | --- | ---: | ---: | ---: |
   | Analyze (JavaScript) | 6m46s | 1m41s | 5m05s faster |
   | Analyze (Python) | 6m41s | 1m02s | 5m39s faster |
   | Analyze (Java) | 30m37s | 27m24s | Not attributed to this change |
   
   The JavaScript and Python improvements result from skipping Java setup and
   Maven compilation for interpreted-language analysis. The Java timing
   difference is not an intended optimization.
   
   ### Same-workflow `-T1C` comparison
   
   Compared with the preceding no-`-T1C` benchmark:
   
   | Metric | No `-T1C` | Current branch | Improvement |
   | --- | ---: | ---: | ---: |
   | Distribution build | 29m25s | 14m22s | 15m03s faster |
   | Docker job | 50m15s | 35m55s | 14m20s faster |
   | End-to-end workflow | 55m43s | 41m36s | 14m07s faster |
   
   These are single-run measurements and can vary with GitHub Actions runner
   scheduling.
   
   ## Validation
   
   - `git diff --check`
   - Shell syntax validation for `build-dist` and `run_docker-tests`
   - Docker job completed successfully in the benchmark run
   - CodeQL jobs completed successfully in the benchmark run
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to