sous-chefs / java

Development repository for the java cookbook
https://supermarket.chef.io/cookbooks/java
Apache License 2.0
386 stars 637 forks source link

Corretto `version` property should accept specific versions, not just latest major versions #628

Closed jakauppila closed 2 years ago

jakauppila commented 4 years ago

:speaking_head: Foreword

Thank for taking the time to fill this feature request fully. Without it we may not be able to , and the issue may be closed without resolution.

:person_frowning: Problem Statement

Currently, the version property on the corretto_install resource accepts a major version which then builds the latest major version url with default_corretto_url, which means I could not specify 11.0.7.10.1 without providing the full url and checksum value myself.

:grey_question: Possible Solution

Add the ability to specify specific versions and build the appropriate URL to download the correct package. We could maintain the current ability by detecting only a major version and downloading the latest version.

Along with #607, we should also dynamically pull back the MD5 checksum as well.

:heavy_plus_sign: Additional context

URL download format is documented here: https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html

Though it appears to only be clearly documented for the latest version. I have submitted feedback for AWS to provide additional documentation for downloading specific versions rather than just guessing; I will also follow-up with AWS with support.

damacus commented 4 years ago

I think this is actually working as I designed. Limiting Corretto down to a current/previous minor version will probably lead to code sprawl.

jakauppila commented 4 years ago

So this is what I want to do, install a specific version and not just grab the latest 11 release.

corretto_install 'install 11.0.7.10.1' do
  version '11.0.7.10.1'
end

My thought is this:

I figured this sort of behavior is probably beneficial for all rather than keeping the URL-building in our wrapper cookbook.

I'm happy to work on this, just wanted to make sure we were on the same page first.

damacus commented 4 years ago

Oh this makes loads of sense! I like it.

having it match only 8 or 11 then falling back to helping you construct the URL makes sense.

jakauppila commented 4 years ago

I have opened an issue over on corretto/corretto11 asking about documentation around the specific version url structure, just to have more clarity: https://github.com/corretto/corretto-11/issues/112

jakauppila commented 3 years ago

I'll work on this functionality and may submit a WIP PR, but may not want it merged until AWS publishes/documents a structured version URL for specific Corretto versions.

I've heard from our AWS TAM that the Corretto team will be doing this, but won't commit to a timeframe yet.

jakauppila commented 3 years ago

Here's some rambling thoughts about this issue.

Today, the resource takes both version and full_version.

version is used for the following:

full_version is used for the sole purpose of defining the full path of the default java_home directory structure.

So I'm thinking:

One caveat on the checksum is that currently the resource passes it directly to remote_file which appears to expect SHA256, whereas the AWS published the MD5 on the "friendly" urls.

Or:

We also deploy java on application servers and configure those apps to use an explicit version, so I'd probably look to add a property to skip the alternatives configuration.

jakauppila commented 3 years ago

There's another issue out on corretto/corretto-jdk about exposing an API for fetching versions, I think this is the ideal state for being able to bring in this functionality into the cookbook. https://github.com/corretto/corretto-jdk/issues/14