Page MenuHomePhabricator

Switch Jenkins servers to Java 11
Closed, ResolvedPublic

Description

When we have upgraded the Jenkins master from Debian Stretch to Debian Buster, we have kept using Java 8 notably because of the Gearman plugin on the CI ones. The releases one can be switched though.

The Jenkins agents are already running using Java 11.

A prerequisite for CI is to upgrade the Gearman plugin. There is a fork of the OpenDev plugin somewhere on Github and it will need to be forked on our Gerrit and re build.

  • releases1002.eqiad.wmnet
  • releases2001.codfw.wmnet
  • New Gearman plugin
    • contint2001.wikimedia.org
    • contint1001.wikimedia.org
  • Remove Java 8 from hosts

Event Timeline

Change 645075 had a related patch set uploaded (by Hashar; owner: Hashar):
[operations/puppet@production] jenkins: support changing $JAVA_HOME

https://gerrit.wikimedia.org/r/645075

Change 645075 merged by Dzahn:
[operations/puppet@production] jenkins: support changing $JAVA_HOME

https://gerrit.wikimedia.org/r/645075

hashar triaged this task as Medium priority.Feb 5 2021, 1:37 PM

I have ported the Jenkins Gearman plugin to JDK 11, we can now upgrade the CI Jenkins.

Let's start with the releases Jenkins install? Given jenkins being managed by profile::java we only need to tweak the Hiera settings in hieradata/role/common/releases.yaml

Change 670767 had a related patch set uploaded (by Hashar; owner: Hashar):
[operations/puppet@production] ci: switch Jenkins to Java 11

https://gerrit.wikimedia.org/r/670767

Change 670768 had a related patch set uploaded (by Hashar; owner: Hashar):
[operations/puppet@production] releases: switch Jenkins to Java 11

https://gerrit.wikimedia.org/r/670768

Change 670768 merged by Muehlenhoff:
[operations/puppet@production] releases: switch Jenkins to Java 11

https://gerrit.wikimedia.org/r/670768

Change 670767 merged by Muehlenhoff:
[operations/puppet@production] ci: switch Jenkins to Java 11

https://gerrit.wikimedia.org/r/670767

@MoritzMuehlenhoff and I have conducted the Java upgrade for all Jenkins instances. Notably the CI one is working properly (after Gearman support got updated via T271683). I will keep monitoring it but it seems to behave properly.

Left to do will be to clean up the Java 8 package once we are sure everything works fine.

Change 670776 had a related patch set uploaded (by Muehlenhoff; owner: Muehlenhoff):
[operations/puppet@production] releases/ci: Remove now obsolete Java 8 packages

https://gerrit.wikimedia.org/r/670776

Change 670776 merged by Muehlenhoff:
[operations/puppet@production] releases/ci: Remove now obsolete Java 8 packages

https://gerrit.wikimedia.org/r/670776

Mentioned in SAL (#wikimedia-operations) [2021-03-16T08:42:39Z] <moritzm> remove Java 8 from contint/releases T269354

Thank you @MoritzMuehlenhoff for the assistance in deploying the puppet patch and the overall java expertise.

I have checked the various Jenkins agents and some are still running Java 8.

We can check them with https://github.com/jenkinsci/jenkins-scripts/blob/master/scriptler/showAgentJavaVersion.groovy

import hudson.model.Node
import hudson.model.Slave
import jenkins.model.Jenkins

Jenkins jenkins = Jenkins.instance
for (Node node in jenkins.nodes) {
  // Make sure slave is online
  if (!node.toComputer().online) {
    println "Node '$node.nodeName' is currently offline - skipping check"
    continue;
  } else {
    props = node.toComputer().getSystemProperties();
    println "Node '$node.nodeName' is running " + props.get('java.runtime.version');
  }
}

To be pasted at:

releases (good)
Node 'releases1002.eqiad.wmnet' is running 11.0.9.1+1-post-Debian-1deb10u2
contint
Node 'compiler1001.puppet-diffs.eqiad.wmflabs' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'compiler1002.puppet-diffs.eqiad.wmflabs' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'compiler1003.puppet-diffs.eqiad.wmflabs' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'contint1001' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'contint2001' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'deployment-deploy01' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1001' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1002' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1003' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1004' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1005' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1006' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1007' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1008' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1009' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1010' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1011' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1012' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1013' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1014' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1016' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-docker-1020' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-pkgbuilder-1001' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'integration-agent-pkgbuilder-1002' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'integration-agent-puppet-docker-1002' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-agent-qemu-1001' is running 1.8.0_275-8u275-b01-1~deb9u1-b01
Node 'integration-castor03' is running 1.8.0_275-8u275-b01-1~deb9u1-b01

Which is a bit unexpected since I am pretty sure I did the agents migration a while back :\

Change 672658 had a related patch set uploaded (by Hashar; owner: Hashar):
[operations/puppet@production] contint: use Java 11 on Jenkins agents

https://gerrit.wikimedia.org/r/672658

Change 672660 had a related patch set uploaded (by Hashar; owner: Hashar):
[operations/puppet@production] puppet_compiler: stop installing openjdk

https://gerrit.wikimedia.org/r/672660

Change 672660 merged by Jbond:
[operations/puppet@production] puppet_compiler: stop installing openjdk

https://gerrit.wikimedia.org/r/672660

Change 672658 merged by Muehlenhoff:
[operations/puppet@production] contint: use Java 11 on Jenkins agents

https://gerrit.wikimedia.org/r/672658

I have some trouble to set the java version for Jenkins agents using hiera. The spin off task is T277526#6916812

Change 673286 had a related patch set uploaded (by Hashar; owner: Hashar):
[operations/puppet@production] contint: remove erroneous hiera setting for labs

https://gerrit.wikimedia.org/r/673286

Via Horizon ( https://horizon.wikimedia.org/project/puppet/ ) I have set:

profile::java::java_packages:
- variant: jre-headless
  version: "11"

On integration and puppet-diffs projects.

For the deployment-prep project, I have set it in https://horizon.wikimedia.org/project/prefixpuppet/ for the prefix deployment-deploy so that would only affect the deployment servers.

Mentioned in SAL (#wikimedia-releng) [2021-03-18T15:52:44Z] <hashar> Disconnecting a bunch of Jenkins agents to upgrade them to Java 11 # T269354

All agents switched:

Node 'compiler1001.puppet-diffs.eqiad.wmflabs' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'compiler1002.puppet-diffs.eqiad.wmflabs' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'compiler1003.puppet-diffs.eqiad.wmflabs' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'contint1001' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'contint2001' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'deployment-deploy01' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1001' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1002' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1003' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1004' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1005' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1006' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1007' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1008' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1009' is currently offline - skipping check
Node 'integration-agent-docker-1010' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1011' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1012' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1013' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1014' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1016' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-docker-1020' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-pkgbuilder-1001' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'integration-agent-pkgbuilder-1002' is running 11.0.9.1+1-post-Debian-1deb10u2
Node 'integration-agent-puppet-docker-1002' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-agent-qemu-1001' is running 11.0.6+10-post-Debian-1bpo91
Node 'integration-castor03' is running 11.0.6+10-post-Debian-1bpo91

I have removed openjdk-8 packages from all instances. The packages were already removed from the production machines contint2001 / contint1001 / releases1002 / releases2002.

So it is done!

Mentioned in SAL (#wikimedia-releng) [2021-03-18T16:48:58Z] <hashar> Purging openjdk-8 packages from Jenkins agents # T269354

Change 673286 merged by Dzahn:

[operations/puppet@production] contint: remove erroneous hiera setting for labs

https://gerrit.wikimedia.org/r/673286