JDK installer for AdoptOpenJDK

47 views
Skip to first unread message

Mads Mohr Christensen

unread,
May 3, 2019, 4:20:14 PM5/3/19
to Jenkins Dev
As a fun project and because it might be useful I’ve been working on a JDK installer plugin for installing OpenJDK from AdoptOpenJDK.net.

It still needs some work in order to be released as an actual plugin but perhaps someone would like to have a look now?


I need to finish error handling and I would like to write some tests as well. 

Especially the part where OS and CPU is detected is something I’m not really sure about, but I would be happy to get any feedback that will improve this plugin in order for it to be released.

Devin Nusbaum

unread,
May 3, 2019, 4:28:20 PM5/3/19
to jenkin...@googlegroups.com
Interesting! Assuming your approach is robust I’d vote for just putting this directly in jdk-tool (and then very visibly deprecating the existing installer for Oracle Java) and adding you as a maintainer. You might be able to reuse the platform and CPU detection that already exists in the plugin today, and even if you want to keep a separate plugin looking through that code could be useful.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/56A31800-AFEA-47B5-A886-BAC196E606BF%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Martin Weber

unread,
May 4, 2019, 3:10:21 PM5/4/19
to jenkin...@googlegroups.com
Am Freitag, 3. Mai 2019, 22:20:05 CEST schrieb Mads Mohr Christensen:
> As a fun project and because it might be useful I’ve been working on a JDK
> installer plugin for installing OpenJDK from AdoptOpenJDK.net
> <http://adoptopenjdk.net/>.
...
>
> Especially the part where OS and CPU is detected is something I’m not really
> sure about, but I would be happy to get any feedback that will improve this
> plugin in order for it to be released.

Here is how cmakebuilder handles that
<https://github.com/jenkinsci/cmakebuilder-plugin/blob/master/src/main/java/
hudson/plugins/cmake/CmakeInstaller.java#L422>


--
E-Mails sollten Text sein, Text und nur Text.
Wenn Gott gewollt hätte, dass E-Mails in HTML geschrieben würden,
endeten Gebete traditionell mit </amen>.


Baptiste Mathus

unread,
May 6, 2019, 10:07:05 AM5/6/19
to Jenkins Developers
I think this is a nice idea to see how we can help existing users to not be fully stuck, even if many of us agree this is the setup we should recommend for a durably stable CI/CD environnement.

IOW we actually want to drive users off the jdk-tool plugin /way/.
Making it too easy for users to download JDKs from outside your company network, or anything else, is IMO dangerous. Bandwidth is not infinite, has to be paid by someone, network glitches happen, and then suddenly all your builds start failing at the very same time and there's nothing really you can do about it (without reconfiguring everything in top priority).

As explained/discussed in the related JIRA (otp right now, harder to find the id), we likely want to encourage users to either download tools from their internal network, or use alternative ways like building in containers where tools are preinstalled.

I've had that thought rolling in my head for some time, maybe a best-of-both-worlds solution could be that a new spin of the JDK/tools plugin would be able to:
* download things from outside once, 
* *and* make it dead-simple to upload it to your binary internal server (artifactory, Nexus...),
* and then download tools from there (your internal binary server).

My 2 cents.

-- Baptiste

Mads Mohr Christensen

unread,
May 6, 2019, 2:05:22 PM5/6/19
to Jenkins Dev


On 3 May 2019, at 22.28, Devin Nusbaum <dnus...@cloudbees.com> wrote:

Interesting! Assuming your approach is robust I’d vote for just putting this directly in jdk-tool (and then very visibly deprecating the existing installer for Oracle Java) and adding you as a maintainer. You might be able to reuse the platform and CPU detection that already exists in the plugin today, and even if you want to keep a separate plugin looking through that code could be useful.


The jdk-tool plugin contains a lot more complicated logic and I like to keep it simple. It’s executing the installer for Windows and MacOS while my plugin just unzips the archive. Also I think that the Oracle installer is stil useful.

I used jdk-tool plugin as a heavy inspiration and I think my approach to platform detection is pretty much the same. 
The thing I’m most unsure of are the actual values for “os.name” and “os.arch” for the additional platforms supported by AdoptOpenJDK and how I test it without having access to any of these platforms.

I’ve been able to test the current version on Linux, MacOS and Windows and it looks good so far for these platforms.

/M

Mads Mohr Christensen

unread,
May 6, 2019, 2:09:04 PM5/6/19
to Jenkins Dev


On 6 May 2019, at 16.06, Baptiste Mathus <m...@batmat.net> wrote:

* download things from outside once, 
* *and* make it dead-simple to upload it to your binary internal server (artifactory, Nexus...),
* and then download tools from there (your internal binary server).

The jdk-tool plugin downloads the binary from Oracle and uses a cache on the master for uploading to other nodes.
I thought about adding this to my new plugin but chose to keep it simple.

It shouldn’t be too hard to add this later. 

/M

Oleg Nenashev

unread,
May 13, 2019, 11:02:53 AM5/13/19
to Jenkins Developers
Belated +1 for a standalone plugin here. On my instances I would like to disable Oracle JDK installer and eventually remove it, so I am totally in favor of having a separate plugin. 

I also created tickets to make the scope of the jdk-tool plugin more clear:

BR, Oleg
Reply all
Reply to author
Forward
0 new messages