Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multi-arch builds #566

Merged
merged 1 commit into from
Dec 4, 2023
Merged

Conversation

StopMotionCuber
Copy link
Contributor

Trying a fresh run for supporting multi-arch builds, see #546, #562, #563, #564 and #565 for some reference.

In this run, I've tested the changes end to end, with additional modifications (not present in this PR).
Here you can take a look at the additional modifications that went into my branch (not using dockerhub and quay.io, only ghcr.io, where the path was modified to my personal namespace).
The Action for that was passing.

You can see published packages here. To inspect them, run e.g.

podman manifest inspect ghcr.io/stopmotioncuber/pulp:3.41.1

There are issues with the base image, which is only published for amd64. I identified the issue, it's that the according Dockerfile is using

FROM docker.io/centos/nginx-116-centos7:1.16

as base. This image is not multi-arch (and therefore neither are their descendants) and has seen the last update two years ago according to DockerHub. Is anyone still using the web images? They don't seem that well maintained.

podman build --format docker --file images/Containerfile.core.base --tag pulp/base:${TEMP_BASE_TAG} .
podman build --format docker --file images/pulp_ci_centos/Containerfile --tag pulp/pulp-ci-centos:${TEMP_BASE_TAG} --build-arg FROM_TAG=${TEMP_BASE_TAG} .
sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes
for ARCH in arm64 amd64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have different workflows/steps for each arch? So we don't have to use more bash magic here...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too familiar with GitHub Actions, but we would need to shift the complexity to some kind of fanout and collection (multiple artifacts via podman save instead of one including ID management, gathering all the images at one place for manifest push in the end).
I don't know whether and/or how that is possible with a single definition of the desired architectures.

So IMO we would just exchange bash magic with Github Actions magic, which I think wouldn't be worth it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StopMotionCuber I agree, let's stick with this for now.

Copy link
Member

@lubosmj lubosmj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me from the index building and pushing perspective. ARM64 and AMD64 images should be part of one OCI index.

podman build --format docker --file images/Containerfile.core.base --tag pulp/base:${TEMP_BASE_TAG} .
podman build --format docker --file images/pulp_ci_centos/Containerfile --tag pulp/pulp-ci-centos:${TEMP_BASE_TAG} --build-arg FROM_TAG=${TEMP_BASE_TAG} .
sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes
for ARCH in arm64 amd64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StopMotionCuber I agree, let's stick with this for now.

@mikedep333 mikedep333 merged commit 78acca9 into pulp:latest Dec 4, 2023
15 checks passed
@StopMotionCuber
Copy link
Contributor Author

Thanks for merging this 🎉
CI seems to have failed again after merging, but at least it looks like a failure I'm not responsible for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants