Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RATIS-2226. Enable Develocity local build cache #1196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adoroszlai
Copy link
Contributor

@adoroszlai adoroszlai commented Dec 22, 2024

What changes were proposed in this pull request?

The [Develocity] Build Cache speeds up your builds by reusing outputs from any previous build
[The] local Build Cache [...] allows other subsequent builds on the same machine to reuse the outputs whenever they execute a goal with the same inputs.
(source)

This PR enables cache for local builds, but not for CI builds.

Develocity can also publish build scans (information about build/test runs), which could be enabled in a follow-up task.

https://issues.apache.org/jira/browse/RATIS-2226

How was this patch tested?

First build with cache (can be reproduced later by adding -Ddevelocity.cache.local.enabled=false):

$ ./mvnw -Prelease -DskipTests clean verify
...
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  41.167 s
...
[INFO] 417 goals, 417 executed

Re-build uses output from build cache for several steps:

$ ./mvnw -Prelease -DskipTests clean verify
...
[INFO] --- javadoc:3.3.2:jar (module-javadocs) @ ratis ---
[INFO] Loaded from the build cache
...
[INFO] --- compiler:3.10.0:compile (default-compile) @ ratis-proto ---
[INFO] Loaded from the build cache, saving 1.854s
...
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  14.471 s
...
[INFO] 417 goals, 366 executed, 51 from cache, saving at least 23s

As a follow-up, we may check if other builds steps (e.g. jar, shade, etc.) can be tweaked to allow caching.

CI build:

[INFO] 436 goals, 436 executed

https://github.com/adoroszlai/ratis/actions/runs/12453457990/job/34763583099#step:5:3079

@adoroszlai adoroszlai self-assigned this Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant