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

Improve build cache strategy #9165

Merged
merged 1 commit into from
Oct 25, 2024
Merged

Conversation

yrodiere
Copy link
Member

Ripped off from Quarkus

Here's how it will work:

  1. We create a cache entry on push only. Pull requests only restore it.
  2. We create a new cache entry every day, prefixed with something like
    2024-10-25.
  3. When restoring the cache, we try the entry for the day first
    (2024-10-25) and default to the one for the month (2024-10-*).
    Critically, this means we will build each day's cache based on the
    previous day's cache.
  4. Atlas infra uses its own, separate cache entries.

Opening as draft, because this is based on #9163, which must be merged first.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Oct 25, 2024

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

Ripped off from Quarkus.

Here's how it will work:

1. We create a cache entry on push only. Pull requests only restore it.
2. We create a new cache entry every day, prefixed with something like
   2024-10-25.
3. When restoring the cache, we try the entry for the day first
   (2024-10-25) and default to the one for the month (2024-10-*).
   Critically, this means we will build each day's cache based on the
   previous day's cache.
4. Atlas infra uses its own, separate cache entries.

Co-Authored-By: Guillaume Smet <[email protected]>
@yrodiere yrodiere marked this pull request as ready for review October 25, 2024 10:01
@yrodiere
Copy link
Member Author

Merging so we can see the effects in practice -- let's revert if someone disagrees.

@yrodiere yrodiere merged commit 5eaaff2 into hibernate:main Oct 25, 2024
6 of 21 checks passed
@yrodiere
Copy link
Member Author

yrodiere commented Oct 25, 2024

@marko-bekhta @DavideD This might make sense on Search/Reactive too? Up to you, but I see that:

  • Search almost uses up its cache limit, probably because using the POM hash in the cache key is very, very strict (add a space somewhere and you'll store another 1GB)
  • Search doesn't cache the Maven install downloaded by Maven wrapper
  • Reactive makes no use of the GitHub Actions cache at all.

If you apply something like what we have here, make sure that you apply #9166 too.

@yrodiere
Copy link
Member Author

Also cc @gsmet -- thanks for the example!

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