Optimize CI/CD: share build artifacts, eliminate redundant compilation#824
Draft
dkropachev wants to merge 10 commits intoscylladb:scylla-4.xfrom
Draft
Optimize CI/CD: share build artifacts, eliminate redundant compilation#824dkropachev wants to merge 10 commits intoscylladb:scylla-4.xfrom
dkropachev wants to merge 10 commits intoscylladb:scylla-4.xfrom
Conversation
e838a59 to
73a5a32
Compare
…ompilation - Build job installs all modules and uploads .m2/repository/com/scylladb/ as artifacts for downstream jobs to reuse - Downstream jobs (verify, unit-tests, integration-tests) download pre-built artifacts and run `make install-all` offline to populate target/ directories without recompilation - Integration test jobs now set CI=true and MAVEN_OFFLINE_FLAG=-o to use cached artifacts and avoid network fetches - Makefile: add CI-aware variables (GUAVA_SHADED_DEP, INSTALL_ALL_DEP, MAVEN_IT_PL_ARGS) to skip redundant steps when artifacts are pre-built - Makefile: add install-all and check targets to separate fast install from full verification (fmt, clirr, animal-sniffer) - Remove compile-all dependency from download-all-dependencies since install-all already covers compile-scoped deps - Extract validate-build-artifacts into reusable composite action - Remove guava-shaded:jar dependency from integration-tests/pom.xml (handled by install-all in both CI and local builds) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
73a5a32 to
3328c7c
Compare
When the build job's cache save fails (e.g., due to 10GB cache limit), downstream jobs could not find the exact cache key and all failed. Add restore-keys fallback to downstream jobs so they can use an older cache via prefix matching, and use cache-matched-key output instead of cache-hit to verify that some cache was actually restored. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After make install-all, Maven generates pom.xml files in target/
directories which changes the hashFiles('**/pom.xml') result. Use the
cache-primary-key output from the restore step to ensure the save step
uses the same key.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cassandra CCM (apache/cassandra-ccm) uses pkg_resources in its entry point script, which requires setuptools. Python 3.13 no longer bundles setuptools, so we need to install it explicitly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The surefire-junit4 provider is resolved at test runtime, not during install. The old approach using -Dtest=TestThatDoesNotExists did not trigger provider resolution. Use dependency:go-offline which is specifically designed to download everything needed for offline builds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The apache/cassandra-ccm `ccm` script imports `pkg_resources` at line 23. Python 3.13 doesn't bundle setuptools (which provides pkg_resources). Installing setuptools before ccm didn't work because the PBR-based build process may interfere with the setuptools installation. Moving setuptools installation after ccm and adding a verification step ensures pkg_resources is available at runtime. On the main branch this was masked because test-integration-cassandra incorrectly depended on .prepare-scylla-ccm, which overwrote the ccm binary with scylla-ccm (which doesn't use pkg_resources). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two fixes: 1. Pin setuptools<82 for Cassandra CCM: setuptools 82.0.0 (Feb 2026) removed pkg_resources, which apache/cassandra-ccm's ccm script imports at line 23. Pin to setuptools<82 which still includes it. Install setuptools before ccm to ensure pkg_resources is available during installation. 2. Bust maven cache with v2 prefix: the existing cache was populated before dependency:go-offline was added, so it's missing surefire-junit4 provider. Also remove cache-hit condition from download step to always ensure dependencies are complete. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1. Explicitly download surefire provider JARs (surefire-junit4, surefire-junit47, surefire-testng) during dependency pre-fetch. Maven's dependency:go-offline doesn't resolve these because surefire lazy-loads providers at test runtime based on detected test framework. 2. Pin setuptools<81 (was <82) to avoid deprecation warning. Setuptools 81 deprecated pkg_resources with a warning; 82 removed it entirely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Apache cassandra-ccm has issues starting Cassandra nodes on GitHub Actions runners (times out waiting for pidfile). The main branch works around this by having test-integration-cassandra depend on .prepare-scylla-ccm, which overwrites the ccm binary. Explicitly install scylla-ccm after cassandra-ccm in the Cassandra IT workflow so that: 1. cassandra-ccm is available for downloading Cassandra images 2. scylla-ccm is used for actually starting/managing Cassandra nodes This matches the effective behavior of the main branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In CI, the workflow explicitly installs CCM in separate steps: 1. install-cassandra-ccm for downloading Cassandra images 2. install-scylla-ccm before running tests (scylla-ccm handles Cassandra node startup better than apache-ccm) The .prepare-cassandra-ccm Makefile target was re-installing apache-ccm during test execution (because scylla-ccm sets ccm-type to SCYLLA), overwriting the working scylla-ccm binary. Skip the preparation step in CI by making PREPARE_CCM_DEP empty. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
actions/upload-artifact, so downstream jobs skip full recompilationbuildand download pre-built artifactssetup-integration-testsjob that only checked out source and set up Python-Xdebug logging in CI (kept for local dev) to reduce log output from ~278K lines to manageable levels$(MVNCMD)consistently across all Makefile targets instead of hardcodedmvn -B-pl integration-teststo restrict the reactor to only the integration-tests modulesettings-security.xmlto suppress noisyFileNotFoundExceptionstack traces in Maven logsTest plan
make test-unitandmake compile-allstill work (guava-shaded installed, full reactor)make test-integration-scyllastill works (full reactor, no -pl restriction)