-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Add option to customize build cache volume names #28292
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
Conversation
example: bootBuildImage { cacheVolumeNames = [ "build": "example-build-cachevol", "launch": "example-launch-cachevol" ] }
@jeliebig Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@jeliebig Thank you for signing the Contributor License Agreement! |
This commit adds configuration to the Maven and Gradle plugins to allow specifying the names of build and launch cache volumes provided to the CNB builder. See gh-28292
@jeliebig Thank you very much for your contribution. Your commits have been merged with some changes that you can see in this commit. After reviewing the Cloud Native Buildpacks changes that this issue was meant to match, we decided that we needed an approach that provided a DSL for configuring the caches instead of a simpler map structure. We also have a desire to support other cache options in the future to align with the CNB direction documented in an RFC. I've added #28386 and #28387 to track these future cache options in Spring Boot. |
Thank you for doing this! For future PRs I would like to ask a few questions if you don't mind. Before I created this PR I have done a lot of local testing for a multiö-project build, because my goal is to get caching working for CI builders. During my tests I also implemented cache-images, but trying them out showed no difference to a regular build. The only way I was able to get caching working was to have a previous image of my project which would then provide the metadata and layers for the used buildpacks. Am I doing something wrong or are cache-volumes and cache-images really not used in any way? Even without my changes I wasn't able to see a difference for a regular build and a build with cache-volumes. I would like to learn more about that and already read a lot of cnb documentation about the lifecycle to get a good understanding about how caching is supposed to work. But since buildpacks can choose if and how layers should be cached, no improvements can be made if a reusable layer does not get cached in the first place. I especially noticed that Thank you for your time. I hope my questions don't bother you too much. |
This was not a case of you doing anything wrong. The original issue #25994 was written to track work that was done in the Even though further work was done, your contribution was very thorough and complete. Thanks again for that.
You are welcome to add comments to an issue to get clarity on a proposed feature or to say that you'd like to work on a PR for the issue. Sometimes that will prompt us to look closer to see if there is additional design that should be taken into account, and discuss the implementation.
I think everything else you've mentioned here is under the control of the CNB builder and buildpacks. Spring Boot can configure caches for the lifecycle but only buildpacks can decide what to cache. If you're using the Paketo builder, you can raise issues in the appropriate Paketo GitHub project or start a discussion with that community. Caching of JRE/JDK specifically has been discussed with the Paketo team in the past. |
Thank you so much for answering my questions! I hope I can create a new PR for this project soon! |
Thanks for the try (2021 i know), but buildpack and pack cli now support this kind of use case. |
This PR adds the option
cacheVolumeNames
to the spring-boot maven/gradle plugins, which allows the specification of custom build cache volume names.At the moment the name can be customized for the following volume types:
launch
build
In Gradle specifying cache volume names can be done like this:
This PR should resolve #25994.