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

Upgrade to actions/setup-java@v4 #24512

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ZacBlanco
Copy link
Contributor

@ZacBlanco ZacBlanco commented Feb 7, 2025

Description

Since #24493 was merged I was looking at CI and noticed that setup-java is also quite old. This PR upgrades to setup-java@v4 and removes the home-grown go-offline+cache solution in favor of the built-in solution. Internally they use actions/cache and it also simplifies the CI configs. The new cache key is the hash of all pom files in the project.

The caching behavior is actually slightly different than before. Previously we would restore the cache using two cache keys: one with a hash of the pom files, and one without any hash, such as linux-maven-2-. This downside of this approach is that the cache grows over time because when you restore from a cache which doesn't used a hash of the POMs, and make a dependency update, the cache may be saved again that contains both old dependency and new dependencies.

When I compare the size of cache hits on our actions, I see that our current cache size is quite large!

Run actions/cache@v2
Received 251658240 of 900086244 (28.0%), 240.0 MBs/sec
Received 532676608 of 900086244 (59.2%), 254.0 MBs/sec
Received 805306368 of 900086244 (89.5%), 256.1 MBs/sec
Received 900086244 of 900086244 (100.0%), 209.3 MBs/sec
Cache Size: ~858 MB (900086244 B)

Compared to restoring fresh caches with this PR:

Run actions/setup-java@v4
Installed distributions
Creating settings.xml with server-id: github
Writing to /home/runner/.m2/settings.xml
Received 209715200 of 426035899 (49.2%), 198.6 MBs/sec
Cache Size: ~406 MB (426035899 B)

Materially, it doesn't make a huge difference in time when cache restores take on the order of a few seconds, but it may save on some storage costs.

Motivation and Context

Less complex CI pipelines and access to newer java versions

Release Notes

== NO RELEASE NOTE ==

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Feb 7, 2025
@ZacBlanco ZacBlanco force-pushed the upstream-update-actions branch from baafb3e to 4d9e8d1 Compare February 7, 2025 04:55
@ZacBlanco ZacBlanco changed the title Use modern parameters in GH actions Upgrade to actions/setup-java@v4 Feb 7, 2025
@ZacBlanco ZacBlanco marked this pull request as ready for review February 7, 2025 18:03
@ZacBlanco ZacBlanco requested review from a team as code owners February 7, 2025 18:03
@ZacBlanco ZacBlanco requested a review from presto-oss February 7, 2025 18:03
Copy link
Contributor

@czentgr czentgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good and simplified and more efficient!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from:IBM PR from IBM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants