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

Rework multi-platform Docker builds in GitHub Actions #156

Closed
bradlarsen opened this issue Mar 22, 2024 · 2 comments · Fixed by #214
Closed

Rework multi-platform Docker builds in GitHub Actions #156

bradlarsen opened this issue Mar 22, 2024 · 2 comments · Fixed by #214
Labels
enhancement New feature or request help wanted Extra attention is needed packaging Related to packaging and distribution testing Related to testing

Comments

@bradlarsen
Copy link
Collaborator

Nosey Parker's currently uses GitHub Actions to build Docker images, including a multi-platform x86_64 and aarch64 image for releases.

There are a few deficiencies with this current setup:

  • The multi-platform images use QEMU to build both platforms on a single x86_64 machine. This is very slow, taking nearly 2 hours, with almost all of that time spent building for the non-native aarch64 platform
  • Because the multi-platform images are so expensive to build, they are only done for release builds, and not every single commit
  • The multi-platform images lack fully populated Docker image metadata, due to bugs / limitations in the docker/build-push-action action (Fix Docker metadata labels in prebuilt images #91)

GitHub Actions now has native aarch64 runners. It is probably possible to build the x86_64 and aarch64 Docker images separately within just a few minutes, each on a native runner, and then in a later Actions job, stitch those two Docker images together with the appropriate metadata into a multi-platform Docker image.

@bradlarsen bradlarsen added enhancement New feature or request help wanted Extra attention is needed testing Related to testing packaging Related to packaging and distribution labels Mar 22, 2024
@bradlarsen
Copy link
Collaborator Author

Although GitHub has native ARM runners, it appears that they are still in private beta that you have to sign up for: https://github.blog/changelog/2023-10-30-accelerate-your-ci-cd-with-arm-based-hosted-runners-in-github-actions/

@bradlarsen
Copy link
Collaborator Author

We are now using the new Linux ARM64 runners for regular CI jobs and for building release artifacts: #197. (The runners that we set up for that are named ubuntu-22.04-arm64-8-core and ubuntu-24.04-arm64-8-core.)

The Docker-building workflows still need to be updated to use those runners, build each single platform's image independently, and then merge them together into a multi-platform image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed packaging Related to packaging and distribution testing Related to testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant