cloudfoundry / java-buildpack

Cloud Foundry buildpack for running Java applications
Apache License 2.0
435 stars 2.58k forks source link

Offlinizing java buildpack does not support cflinuxfs4 #986

Closed AnnaAAL closed 1 year ago

AnnaAAL commented 1 year ago

We are offlinizing the java_buildpack. We've noticed that when the packaging command for the offline buildpack is executed (as it says in the README):

bundle exec rake clean package OFFLINE=true PINNED=true

In the output it's visible that it's pointing to bionic instead of jammy.

However, on cf push we get the following error: _ERROR Finalize failed with exception #<RuntimeError: Jvmkill Agent error: Unable to find cached file for https://java-buildpack.cloudfoundry.org/jvmkill/jammy/x86_64/index.yml> Jvmkill Agent error: Unable to find cached file for https://java-buildpack.cloudfoundry.org/jvmkill/jammy/x86_64/index.yml Failed to compile droplet: Failed to run finalize script: exit status 1_

We've tried locally to edit package.rb line76 with jammy, i.e. PLATFORMS = %w[bionic jammy].freeze and it works.

Could you, please review our proposal and adjust it/add it to the buildpack, so we can use it offlinized?

dmikusa commented 1 year ago

Are you able to access https://java-buildpack.cloudfoundry.org/jvmkill/jammy/x86_64/index.yml? That looks like the correct URL and that loads for me.

AnnaAAL commented 1 year ago

Hi @dmikusa , thank you for the prompt feedback. We do have access to the given index file, however when we use the given command from the README : bundle exec rake clean package OFFLINE=true PINNED=true it does not use jammy, rather than bionic. Here's a screenshot of what's being cached using rake: image

Currently, just for testing, we edited the mentioned line above manually. Could you please recheck and confirm how the buildpack can be offlinized for jammy(cflinuxfs4) using the rake command?

dmikusa commented 1 year ago

For now, I would suggest that you just edit that variable prior to packaging. It is possible something was missed in the commit for Jammy support. Jammy support is still pretty new, so I don't think this code has been exercised much yet.

The platforms list is going to control what dependencies are included. If you need one buildpack to support both platforms, then include both jammy and bionic. If you want to have support for just a single platform, then include just that single platform. If you include both, the buildpack is going to be larger. Watch that it does not go above 1G, as that will often cause problems in CF (at least it historically has).


Obviously, we should have a control/setting exposed for that. Perhaps, PLATFORMS= as an option like OFFLINE and PINNED which would override the default. If anyone would like to submit a PR, that would be appreciated.