ci: add scala-build prebuild job to share compilation across Scala CI jobs#6317
Draft
Yicong-Huang wants to merge 1 commit into
Draft
ci: add scala-build prebuild job to share compilation across Scala CI jobs#6317Yicong-Huang wants to merge 1 commit into
Yicong-Huang wants to merge 1 commit into
Conversation
… jobs
The four sbt-based jobs (amber, amber-integration, platform,
platform-integration) each compiled the shared common-module graph (DAO,
WorkflowCore, WorkflowOperator, ...) from scratch — up to 14 runner legs
redoing the same Scala build.
Add a single `scala-build` prebuild job that compiles every module once
(main + test scopes), runs the cross-cutting scalafmt/scalafix lints, builds
all seven dists, and uploads two artifacts:
* scala-build-target — per-module target/ tree (classes, test-classes, Zinc
analysis, generated JOOQ sources, dists), restored by amber /
amber-integration (Linux) / platform so their jacoco/test reuse
compilation instead of redoing it.
* scala-dists — just the dist zips, for platform-integration's smoke-boot.
Downstream Scala jobs drop their own lint + compile and consume the artifacts.
The prebuild is gated on the union of the four Scala run_* inputs, so a
docs-only / frontend-only PR never runs it and every downstream Scala job
stays skipped in lockstep. Artifact names are computed per build.yml
invocation so the main build and backport legs don't collide in one run.
macOS amber-integration keeps self-compiling — Zinc analysis embeds
OS-specific absolute paths and is not portable across runners.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Yicong Huang <17627829+Yicong-Huang@users.noreply.github.com>
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6317 +/- ##
============================================
- Coverage 61.02% 60.98% -0.04%
+ Complexity 3374 3373 -1
============================================
Files 1140 1140
Lines 44923 44923
Branches 4942 4942
============================================
- Hits 27413 27396 -17
- Misses 16001 16015 +14
- Partials 1509 1512 +3
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
✅ No material benchmark regressions detected🟢 4 better · 🔴 0 worse · ⚪ 11 noise (<±5%) · 0 without baseline
Baseline detailsLatest main
Raw CSVconfig_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,503.02,200,128000,398,0.243,24395.19,34262.23,34262.23
1,100,10,64,20,2489.07,2000,1280000,804,0.490,125192.50,139885.58,139885.58
2,1000,10,64,20,21820.36,20000,12800000,917,0.559,1091267.15,1140822.68,1140822.68 |
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.
What changes were proposed in this PR?
The four sbt-based CI jobs —
amber,amber-integration,platform, andplatform-integration— each compile the shared common-module graph (DAO, WorkflowCore, WorkflowOperator, Auth, Config, …) from scratch. That is up to 14 runner legs redoing the same Scala build every run.This adds a single
scala-buildprebuild job that compiles the whole Scala world once and hands the result to the downstream jobs as artifacts.scala-build(ubuntu, one leg) runs one sbt invocation:scalafmtCheckAll+scalafixAll --check(cross-cutting lints, moved here fromamber/amber-integration)<svc>/distTest/compile(compiles every module's test scope;TexeraProjectaggregates all modules)…then uploads two artifacts:
scala-build-target— per-moduletarget/tree (classes, test-classes, Zinc analysis, generated JOOQ sources, dists). Restored byamber/amber-integration(Linux) /platformso theirjacoco/testreuse compilation.scala-dists— just the dist zips, forplatform-integration's smoke-boot.Downstream jobs drop their own lint + compile and consume the artifacts.
Respecting the label gate:
scala-build.ifis the union of the four Scalarun_*inputs, so a docs-only / frontend-only PR never runs it and every downstream Scala job stays skipped in lockstep. Therequired-checksaggregator depends on the wholebuildreusable-workflow result, so the new job is transparent to the merge gate (no.asf.yamlchange). Artifact names are computed perbuild.ymlinvocation (fromjob_name_suffix/backport_target_branch) so the main build and the backport legs — which share one workflow run — don't collide on upload.Known caveats / follow-ups:
amber-integrationstill self-compiles (Zinc analysis is not OS-portable). Becauseneeds:is per-job, the macOS leg now waits forscala-buildbefore starting; if the measured hit is large, split it into an independent job with noneeds:.github.workspacebeing a stable path across GitHub-hosted ubuntu runners; if the analysis is ever rejected, sbt just recompiles — slower, never wrong.platformmatrix each downloadsscala-build-target; if download time dominates, slim the tar or split per service.Primary goal is deduplicating compilation / cutting runner-minutes, not necessarily wall-clock — a serial prebuild + artifact transfer is inserted before the fan-out. Opened as draft to gather real numbers (wall-clock and total runner-minutes vs. a baseline) before committing to the approach.
Any related issues, documentation, discussions?
Closes #6318
How was this PR tested?
This is a CI-only change, validated by the workflow run on this PR itself:
scala-buildruns (the PR carries thecilabel, which selects every stack) and the four downstream Scala jobs succeed off the restored artifacts.jacoco/testdo not trigger a full recompile (Zinc reuse working).amber/platformand theplatform-integrationsmoke-boot run off the restored dists.actionlintpasses on.github/workflows/build.yml(no new findings); YAML parses clean.build.ymlis a reusable workflow with no unit-test harness, so correctness is verified end-to-end by the run rather than by added tests.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)