Skip to content

Optimize CI/CD: share build artifacts, eliminate redundant compilation#824

Draft
dkropachev wants to merge 10 commits intoscylladb:scylla-4.xfrom
dkropachev:optimize-cicd
Draft

Optimize CI/CD: share build artifacts, eliminate redundant compilation#824
dkropachev wants to merge 10 commits intoscylladb:scylla-4.xfrom
dkropachev:optimize-cicd

Conversation

@dkropachev
Copy link

Summary

  • Build job now installs all modules and uploads SNAPSHOT artifacts via actions/upload-artifact, so downstream jobs skip full recompilation
  • All jobs (verify, unit-tests, Cassandra ITs, Scylla ITs) depend on build and download pre-built artifacts
  • Removed the empty setup-integration-tests job that only checked out source and set up Python
  • Disabled Maven -X debug logging in CI (kept for local dev) to reduce log output from ~278K lines to manageable levels
  • Used $(MVNCMD) consistently across all Makefile targets instead of hardcoded mvn -B
  • In CI, IT targets use -pl integration-tests to restrict the reactor to only the integration-tests module
  • Added settings-security.xml to suppress noisy FileNotFoundException stack traces in Maven logs

Test plan

  • Verify build job completes and uploads artifacts successfully
  • Verify verify, unit-tests jobs download artifacts and run without full recompilation
  • Verify Cassandra and Scylla IT jobs download artifacts and run ITs correctly
  • Verify local make test-unit and make compile-all still work (guava-shaded installed, full reactor)
  • Verify local make test-integration-scylla still works (full reactor, no -pl restriction)

…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>
dkropachev and others added 9 commits March 2, 2026 12:44
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant