Upgrade Java for Jenkins
It is always a good idea to test things in PTLSBOX(Sandbox) before doing them in PROD(PTL), upgrading Java for Jenkins is no exception. Upgrade the agents first and then the built-in controller node.
Upgrade SBOX Jenkins agents
Upgrade the SDS agents first and then CFT.
- Create a PR in the CNP Jenkins Docker with the Java version incremented. You can find the updated Jenkins base image tag from the Jenkins dockerhub repo.
- Creating the PR should have automatically created a docker image with a pr- in its name.
- Check jenkins/jenkins repository for the updated tag.
- To test the agents with the new Java version alter the path to the Java runtime to point to the upgraded Java version for CFT or SDS depending on what you are upgrading.
- Keep checking for new agents(this may take 15 minutes) and then look under system information to find out what runtime is being used. Verify the log of the new agents to see if they started correctly.
- After you can see new agents are running verify that the upgrade was successful by running the Plum tests or the Toffee tests if you are upgrading SDS.
Notes
Unless you are also changing the default Java version running java -version
on the nodes will not tell you accurate info. To confirm the upgrade has occurred go under system information on Jenkins for one of the nodes.
Upgrade Jenkins sandbox built-in controller
Once the Jenkins agents are working in PTLSBOX you can then upgrade the PTLSBOX built-in controller. Upgrade the SDS built-in controller first and then the CFT built-in controller. To upgrade SDS PTLSBOX do the following:
- If you have not already done so create a PR in the CNP Jenkins Docker with the Java version incremented. You can find updated Jenkins base image tag from the Jenkins dockerhub repo.
- Creating the PR should have automatically created a Docker image with a pr- in its name.
- Check the jenkins/jenkins repository for the updated tag.
- Point the SDS flux config to use that new tag by updating PTLSBOX.
- After 10 - 15 minutes check the runtime version on Jenkins and verify that the SDS Jenkins agents are working as expected by running the Toffee tests.
Do the same for CFT by updating CFT SBOX-INTSVC and by running the Plum tests. If everything is working as expected, you can move on to upgrade the production Jenkins agents.
Upgrade production Jenkins agents
Same steps as upgrading PTLSBOX but instead use this for SDS and this for CFT.
Upgrade production Jenkins built-in controller
After the Jenkins agents have been upgraded you can look into upgrading the Jenkins built-in controller. A change request should not be needed for this, but be vigilant of any issues by checking Slack and monitoring the deployment. Upgrade SDS first and then CFT.
- Firstly merge in the changes to the Docker image that you made earlier. Make note of the tag that is created when you merge it in by checking the build log. This alone won’t upgrade the Java version as you will need to update the tag that is used. Upon merge, check the jenkins/jenkins repository for the updated tag. You should also be able to see it in the build log when you merge your changes.
- Bump the Docker image tag for SDS PTLSBOX or CFT SBOX-INTSVC.
- Bump the Docker image tag for SDS PROD or CFT PROD.
- Point the flux config to use that new tag by updating the SDS PROD flux config or the CFT PROD flux config
- After 10 - 15 minutes check the runtime version on Jenkins and verify that the upgrade was successful for SDS by running Toffee tests or for CFT run the Plum tests.
Rollback Agents
Revert changes to SDS and CFT. Decrement the Docker image version CNP Jenkins Docker.
Rollback Controller
Revert changes to SDS and CFT. Decrement the Docker image version CNP Jenkins Docker.
Examples
SDS agent node SDS built-in controller
CFT agent CFT built-in controller