-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Pinned Offline Buildpack chooses non included versions #892
Comments
Thanks, I'll take a look at this and see what is going on here. |
This while not what you expect is what the code is supposed to do. java-buildpack/rakelib/dependency_cache_task.rb Lines 128 to 144 in fd50c13
When you pin, the code has to do some special handling for JREs because it's the only component where we bundle multiple versions. This is kind of a hack, but instead of plugging in a specific version, it'll insert records for I would agree that this is not what's intended and that you'd likely expect to get the time-locked versions. Unfortunately, those are not in the commit (there's only one An easy fix, I could add env variables where you could override the Java 11 & 16 versions at package time? So it would default to Actually fixing this would only be possible in versions going forward, as we'd need to save the Java 11 & 16 versions in the commit somehow & we cannot go back and change past commits. Still looking into the other half of this issue, just wanted to mention this first so you could provide feedback. Thanks |
Hi @dmikusa-pivotal thanks for the feedback, we will discuss that internally and will let you know afterwards. :) |
OK, so in regards to the other issue:
This is happening for a similar reason. When you package the buildpack, it will go and download resources and include them with the buildpack. One of the resources that it is downloading is the The problem this causes is that new versions of a resource, like the JRE, may have been added to index.yml since the buildpack was released. When you specify Because you packaged your buildpack later, after a new JRE has been released, your cached You can get around this by not setting the version for Java 8, because that's the default, or set the exact version like I'm not sure there's an easy fix for this. In theory you could modify the Can you expand on the impact of this particular issue to you? Would it work to simply not specify the version like that and rely on the default or set the exact version you want (probably not the best idea as you'd have to change this in the app when the buildpack updates)? Just trying to understand the impact of this issue. Thanks! |
Hi @dmikusa-pivotal thanks for that information. That really helps to understand the overall issue. I am wondering if we on our side should just check the timing when we prepare offline buildpacks instead of re-adjusting the whole logic of the buildpack. |
That's one way you could handle it. You would need to package buildpacks around the time of the release. Then persist the packages you create somewhere since you can't easily recreate them at the moment. I do feel like we can do better here. The way things are now, it's not possible to reproduce a package of a particular buildpack version. I think short-term, I can document these caveats in our packaging docs on the README. Long term, I think we should have a solution such that it does not depend on when you run a command and that you can get a reasonably consistent (different timestamps, but the same versions) package. I'll work on getting the README updated this week and leave this issue open so that we can circle back and make some changes to the package tools at a later date. If you have any use-case details you can share, feel free. That helps with scheduling the work. Thanks! |
FYI, update to README -> https://github.com/cloudfoundry/java-buildpack#packaging-caveats |
Could we provide a list of major java versions instead of hard coding them? |
So perfect reproducible builds of previously released Java buildpack versions are never going to really work. There are a number of non-fixable problems (registries that have gone away, versions removed from registries, and the fact that older versions don't pin non-default JRE versions). Despite that, I have made some changes which will improve the behavior in #957. Please check out the PR for details, I've outlined the changes there & in the README update part of the PR. If you are interested, please take a look and add comments to the PR. We'll likely merge the PR in about a week unless there are objections/active discussions. |
PR #957 merged. |
Hi there,
I am currently seeing a strange behavior when using offline buildpacks, where the version used is not included in the offline package and therefore fails to stage the app.
Steps to reproduce the issue:
Manifest looks like this:
We are using spring-music to test the behavior.
In our env we can see that the staging fails due to this error:
We would expect the buildpack to choose the included version
1.8.0_282
.Beside that, for me
v4.37
pins version to11.0.11_9
but according to the release notes it should be11.0.10_9
.The text was updated successfully, but these errors were encountered: