-
Notifications
You must be signed in to change notification settings - Fork 695
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
JENKINS-69581: Install java-11-openjdk #777
JENKINS-69581: Install java-11-openjdk #777
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! How was this PR tested? This page states that the command to install Java 11 on Amazon Linux is sudo amazon-linux-extras install java-openjdk11
, which is the same command we use in the Jenkins packaging test suite. There, the (tested) algorithm is as follows:
- On Amazon Linux, check for
/usr/lib/jvm/jre-11-openjdk
; if it does not exist, runamazon-linux-extras install java-openjdk11 -y
. - On all RPM-based distributions (including Amazon Linux), run
yum install -y fontconfig java-11-openjdk
(on Amazon Linux, thejava11-openjdk
portion will be a no-op because of the previous command, while on other RPM-based distributions that will be the place where Java 11 is installed).
I am not the maintainer of this plugin, but I would expect this needs to work out of the box for the default EC2 Linux image at the very least, if not other common RPM-based distributions.
Of course yeap! I can work on that now and will run it through on a staging server I have. If we need unit tests for this I might need some help with that, I wouldn't say I'm especially familiar with Java :) |
aa42596
to
ea11667
Compare
Although I am not the maintainer of this plugin, I think the primary concern is avoiding regressions for the 11,802 users of this plugin rather than achieving a perfect work of software engineering. That is why my comments were mostly centered around testing. We are happy to have your contribution regardless of your Java experience. Regarding testing, I think there are two main use cases we need to think about:
|
I gave it a go trying to do it in Java but didn't really know enough about input and output streams and buffers etc so I'll just leave what I did here sorry. I imagine someone will want to add this support in the future if they use the feature and upgrade to a version of jenkins that doesn't support Java8. If I were able to just do it in bash I'd do something like |
This PR was a promising start but lacks sufficient testing and cannot be merged as-is. If nobody else picks up this work I would suggest closing this PR. |
When is this going to be fixed? This plugin is currently broken. |
When someone submits an acceptable pull request that fixes it, I suppose. |
I might have some time this weekend to take another look at this. If I’m not able to get it working and test it I’ll close this PR as suggested but keep JENKINS-69581 open for further discussion. |
294c8ee
to
ddea6d1
Compare
Here's the config that I used to test this build on Jenkins version 2.361.4: Here's the console outputs of my testing: Given that this is my first contribution to this repository I might suggest someone else verifying that this is working for them. Happy to make any modifications as needed! As I mentioned in my commit it would be cool to check the version of Java installed, but at this point I wanted to focus on fixing this regression for current users more than implementing a new feature. |
In the meantime if anyone finds this you can resolve this issue temporarily by adding the following commands to your init scripts: # For Amazon Linux 2
sudo amazon-linux-extras install java-openjdk11 -y
# For RedHat Enterprise Linux
sudo yum install -y fontconfig java-11-openjdk
# For Ubuntu
sudo apt-get install openjdk-11-jdk cc @nfplatzke |
As of Jenkins Weekly 2.357 and LTS 2.361 the minimum required java version is java 11. If the command java -fullversion fails we will try to install openjdk-11. We first try and install it using amazon-linux-extras. If this passes then the launch continues. If it fails (for example we're launching a linux node on a distribution other than amazon-linux we try and install openjdk-11 using yum. If both of these commands fail we won't launch the node. At this point we don't explicitly check the java version, but this could perhaps be a future addition.
ddea6d1
to
80f27fa
Compare
Just force pushed a change to the commit. I had previously been joining the commands together with |
@thoulen tagging you in this PR as a maintainer, sorry I don't have permission to add reviewers as suggested in the contributing docs. This PR also fixes https://issues.jenkins.io/browse/JENKINS-68946 and https://issues.jenkins.io/browse/JENKINS-69383 |
Perhaps @res0nance would be interested in merging this as he was the last active maintainer. If not, my apologies for the obtrusive notification. |
If Jenkins recieves a non-zero error code when runing
java -fullversion
on the remote agent then it will install java 11 using yum.Previously this installed java 8 which is no longer supported on Jenkins agents where the controller is running version 2.361.x or higher.
This issue is discussed further in JENKINS-69581