Adding ppc64le support back into the Jenkins CI SSH agent Docker build. #220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The following are the steps I have automated to build Jenkins CI controller and agents for a foreign architecture. My build workstation architecture is amd64.
I use
docker.io/multiarch/qemu-user-static
to emulate the build processes only, I do not use fullqemu-system-ppc64le
emulation of a complete Operating System. It is unecessary and slow to attempt full emuluation of kernel etc. to build software, a container is much more efficient and you are always using the latest code, versus maintaining a full Operating System.If the Jenkins infrastructure team is not already doing so, I suggest switching to this containerized method of building foreign target architecures, as these steps work well for s390x and aarch64 (just substitute
ARCH=ppc64le
below withARCH=s390x
orARCH=arm64v8
).Build times on a modest 2-core 4-thread Intel i5 M520 @2.40GHz system:
The build time for two controller images (debian_jdk11 and rhel_ubi9_jdk17 simultaneously) was 11 minutes and 23.9 seconds.
The build time for the docker-agent was 4 minutes and 30.8 seconds.
The build time for the docker-ssh-agent was 3 minutes and 57.1 seconds.
Step 1: set ARCH environment variable to desired target architecture
Step 2: run privileged qemu-user-static container to set host's kernel binfmt_misc magic to execute foreign arch binaries with appropriate /usr/bin/qemu-ARCH-static interpreter. IMPORTANT: must use
--credential yes
parameter.Step 3: create Docker buildx container with target ARCH. Important: you must mount your host's Docker socket
/var/run/docker.sock
in the container, so that we can eliminate the need to run the Docker service inside the emulated container.Step 4: build Jenkins CI inside target ARCH Docker container with buildx
Step 5 (optional): run Jenkins CI Docker controller and agent containers on Docker host to test (since we shared the
/var/run/docker.sock
of the host, all images are accessible from the host that were exported from the buildx container)Results: