Skip to content
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

Proposal for a Dockerfile for OpenJ9 #884

Closed
dsouzai opened this issue Sep 19, 2019 · 12 comments · Fixed by #890
Closed

Proposal for a Dockerfile for OpenJ9 #884

dsouzai opened this issue Sep 19, 2019 · 12 comments · Fixed by #890

Comments

@dsouzai
Copy link

dsouzai commented Sep 19, 2019

I'm opening this issue as a precursor to a future PR based on this thread in the mailing list [1].

For background, I had done an experiment [2] to compare Jenkins startup and footprint in Docker using both Hotspot and OpenJ9 [3]; with a primed -Xshareclasses option, I found a ~35% improvement in startup time and a ~80% improvement in footprint when using OpenJ9. The takeaway from the email thread was that the community is open to adding a new Docker file for OpenJ9. As such, this issue is mainly to track what might be involved for this endeavour since we don't have a PR available (I'm going on vacation, so this way someone else on our side can hopefully pick this up in the mean time); it also means that we can start having the technical discussions with the Jenkins community.

As far as I can tell, what would be involved would be:

  1. Change openjdk:8-jdk-stretch to adoptopenjdk/openjdk8-openj9:latest; currently there's some issues with the latest OpenJ9 release (0.15.1 on Java 8; nightlies are fine), so this would have to wait until 0.17.
  2. Add gpg fontconfig to the set of tools apt-get has to install
  3. Add OPENJ9_JAVA_OPTIONS="-Xshareclasses -Xscmx80M" to jenkins.sh; more details on -Xshareclasses available here [4]
  4. In the Dockerfile, start and stop Jenkins so that the Shared Classes Cache (SCC) gets populated with bootstrap and core Jenkins classes + AOT code
  5. At the very end it might be necessary to update OPENJ9_JAVA_OPTIONS to be OPENJ9_JAVA_OPTIONS="-Xshareclasses,readonly -Xscmx80M . However, I'm not 100% sure about this: one the one hand, if the readonly flag doesn't exist, then if a new layer is added to the image and the JVM stores more data to the SCC, it will duplicate the SCC in the new layer which will increase on-disk image size; on the other hand, if the user sets up their Jenkins instance by installing plugins and what not, it will result in actually useful Java classes + AOT code added to the SCC which will be beneficial when they commit that new layer and start containers off of that. [5] is meant to address this so perhaps if the next OpenJ9 release has this feature, this point becomes moot.

[1] https://groups.google.com/forum/#!topic/jenkinsci-dev/Lr651X0eCgA
[2] https://blog.openj9.org/2019/09/17/comparing-jenkins-startup-in-docker/
[3] https://github.com/eclipse/openj9
[4] https://www.eclipse.org/openj9/docs/xshareclasses/
[5] eclipse-openj9/openj9#5480

@oleg-nenashev
Copy link
Member

I think it would be great to have an OpenJ9 image along with the images we currently ship. If somebody sends a pull request, I will be happy to help it to get integrated

CC @jenkinsci/sig-platform .

@jams008
Copy link

jams008 commented Oct 7, 2019

hi, i've been working on this issue in this pull request "Proposal for a Dockerfile for OpenJ9"

@oleg-nenashev
Copy link
Member

#889 FTR

kamiyaa added a commit to kamiyaa/docker that referenced this issue Oct 7, 2019
@kamiyaa
Copy link
Contributor

kamiyaa commented Oct 7, 2019

@oleg-nenashev I've also created a pull request on this issue

kamiyaa added a commit to kamiyaa/docker that referenced this issue Oct 11, 2019
kamiyaa added a commit to kamiyaa/docker that referenced this issue Oct 11, 2019
kamiyaa added a commit to kamiyaa/docker that referenced this issue Oct 12, 2019
kamiyaa added a commit to kamiyaa/docker that referenced this issue Oct 14, 2019
@james-crowley
Copy link
Contributor

@dsouzai Just tried OpenJ9 myself, and I am blown away at the speed it starts up! This is really cool, hoping for the PR to go through soon!

@james-crowley
Copy link
Contributor

Add gpg fontconfig to the set of tools apt-get has to install

@dsouzai Why are these to packages needed? I know they are needed for Jenkins to come on run, but is it because the AdoptOpenJDK base images are from Ubuntu not Debian?

@MarkEWaite
Copy link
Contributor

Add gpg fontconfig to the set of tools apt-get has to install

@dsouzai Why are these to packages needed? I know they are needed for Jenkins to come on run, but is it because the AdoptOpenJDK base images are from Ubuntu not Debian?

The gpg command is used in Dockerfile (and its derivatives) to verify the signature of /sbin/tini.

@dsouzai
Copy link
Author

dsouzai commented Oct 22, 2019

Add gpg fontconfig to the set of tools apt-get has to install

@dsouzai Why are these to packages needed? I know they are needed for Jenkins to come on run, but is it because the AdoptOpenJDK base images are from Ubuntu not Debian?

both gpg and fontconfig are available in the OpenJDK Docker images when using FROM openjdk:8-jdk-stretch, whereas they're not available in the AdoptOpenJDK Docker images.

@james-crowley
Copy link
Contributor

@dsouzai @MarkEWaite Thanks for the responses. That's what I am looking for! Interesting they are not in the AdoptOpenJDK images. Or maybe its interesting that they are including in OpenJDKs? 😕

@MarkEWaite
Copy link
Contributor

@james-crowley many images include more tools than are strictly required. Some images are even based on the wrong operating system version.

For example, there was an extended time (weeks and possibly months) when the OpenJDK 11 official image was based on Debian unstable ("sid"). It surprised me that they would base an official OpenJDK image on an operating system that the provider declares is unstable. Thankfully, that is no longer the case.

@james-crowley
Copy link
Contributor

@MarkEWaite That is some useful information. What tag was the unstable version released under for OpenJDK? Did it make it into any of the builds of Jenkins?

Odd this was not caught before It made its way in the official Docker Library.

@MarkEWaite
Copy link
Contributor

It was during the period around the release of OpenJDK 11.

OpenJDK 11 was released Sep 25, 2018. Issue 237 was opened Oct 5, 2018 reporting that official OpenJDK 11 docker image was based on Debian unstable ("sid") . Pull request 259 was applied Dec 24, 2018 to switch from unstable to stable.

I'm not sure there is really anything to do about it. OpenJDK 11 development was in a very busy time at that point.

kamiyaa added a commit to kamiyaa/docker that referenced this issue Nov 7, 2019
@slide slide closed this as completed in #890 Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants