Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/buildenv/jenkins/docker-nodes/README.md
12926 views

Docker

About

Dockerfiles are used to define how a docker container/image should be built. Docker containers are essentially virtual machines designed for short term use. This makes them very useful for testing purposes as you can generate a new container for every test and you are guaranteed to run against the same environment every time.

Status of Dockerfiles on different Platforms

x86s390xppc64le
Ubuntu16Test OnlyBuild & TestTest Only
Ubuntu18Test OnlyTest OnlyTest Only
Centos6Build & TestNot AvailableNot Available
Centos7To be AddedTo be AddedBuild & Test
WindowsTo be AddedNot AvailableNot Available

Eclipse OpenJ9 CI

Generated Dockerfiles are used by two Jenkins jobs at Eclipse to build docker images. The first job is run manually by supplying the architecture and os. It should be run after changes to mkdocker.sh have been merged. The second job is used to test pull requests. Whenever a PR makes changes to mkdocker.sh, a PR build should be launched for each affected architecture and os combination. A PR build can be launched by making a comment in the PR with the following format

Jenkins build docker <ARCH> <OS>

Both jobs will push the Docker images to Docker Hub under the repo eclipseopenj9/jenkins-agent-<ARCH>-<OS>:<TAG> If a manual build is run the tag will be the build number of the job, as well as the latest tag. If a PR build is run the tag will contain PR followed by the ID of the pull request used to build the job.

Using containers from a terminal

If you have docker installed then you can run docker pull eclipseopenj9/jenkins-agent-<ARCH>-<OS>:<TAG> to pull a docker image of the specified architecture and os. You can use docker run -it eclipseopenj9/jenkins-agent-<ARCH>-<OS>:<TAG> /bin/bash to start up a new container and enter it. Once inside of a container, run su - jenkins to switch to the jenkins user. This way when you run your code you won't have root privileges. If the container is capable of building openj9 it will also have reference repos and bootJDKs. The reference repos can be used to improve clone times, and the bootJDKs can be used for compiling openj9. The locations of the reference repos and bootJDKs can be found here. A full list of docker commands for managing/using containers can be found here.

Docker and Jenkins

There is a Docker plugin for Jenkins which allows Jenkins to orchestrate running Docker containers on remote machine(s). Details of the plugin can be found here. After the plugin is installed, you need a machine with Docker installed, and enable its remote API. In the Jenkins Configure System page under the Cloud section, add a new Docker Cloud. Fill in the details for the remote host and add one or more Agent templates with the appropriate details. Add the labels as you would a normal agent. Additionally add label hw.arch.docker to indicate that the agent is running inside a container.