jenkinsci / jenkinsci/docker

Optimise `multiarch` sanity check duration

Open
#2,154 10 comments 0 reactions 1 assignee Claimed by @lemeurherve View on GitHub
enhancement linux multi-arch-support
Dominant language
PowerShell
Stars
7.6k
Forks
4.6k
Avg merge
1h 36m
Merged PRs (30d)
15

Description

### What feature do you want to see added?

The multiarch stage (a sanity check one) is the longest one (taking about 45 minutes) and currently builds images for every architectures, even if the current agent architecture images are already built in other stages.

Other stages building a list of targets are calling `make build-` or `make test-` which are using `make list`, returning only targets for the current agent architecture (`amd64`):
https://github.com/jenkinsci/docker/blob/5a8f22894e335d41179ceb0183d0065f0d6cadbd/Jenkinsfile#L135-L146
https://github.com/jenkinsci/docker/blob/5a8f22894e335d41179ceb0183d0065f0d6cadbd/Makefile#L78-L79

This stage should be optimised to build only build architectures not already built in those other stages so it takes less time, to reduce the overall build duration.

### Current state

List of targets and architectures built in the multiarch stage:
```
alpine_jdk17 (amd64)
alpine_jdk21 (amd64, arm64)
debian-slim_jdk17 (amd64)
debian-slim_jdk21 (amd64, arm64)
debian_jdk17 (amd64, arm64, s390x, ppc64le)
debian_jdk21 (amd64, arm64, s390x, ppc64le)
rhel_ubi9_jdk17 (amd64, arm64, ppc64le)
rhel_ubi9_jdk21 (amd64, arm64, ppc64le)
```
Total: 20 distinct images.

Overall build duration: 47 min

https://ci.jenkins.io/job/Packaging/job/docker/job/master/13084:
Image

### Upstream changes

_No response_

### Are you interested in contributing this feature?

Yes

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.