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

Build for arm64 as well as amd64 #1066

Closed
wants to merge 1 commit into from
Closed

Build for arm64 as well as amd64 #1066

wants to merge 1 commit into from

Conversation

jellybob
Copy link
Contributor

@jellybob jellybob commented Apr 3, 2022

I'm not sure whether this actually works or not, but theoretically it should result in making arm64 images available for people running on recent Apple machines rather than having to translate from amd64 which sucks up battery life at an impressive rate.

Annoyingly this isn't a complete solution as PostGIS doesn't have ARM builds on Docker Hub, but it does get us most of the way there I believe.

@marksteward
Copy link
Member

marksteward commented Apr 3, 2022

I'm guessing this doubles the build time. Can we use a build matrix to target simultaneously?

@jellybob jellybob force-pushed the build-arm64-images branch 2 times, most recently from ee3b27d to e6a10c8 Compare May 7, 2022 11:07
@jellybob
Copy link
Contributor Author

jellybob commented May 7, 2022

This might be doing a matrix build, assuming I've properly read the Github Actions docs. I've got no idea how to actually test it since builds only happen for main.

@marksteward
Copy link
Member

Looks right to me!

@jayaddison
Copy link
Contributor

I've got no idea how to actually test it since builds only happen for main.

One important-ish note for testing: it's probably best to change the image tags from latest to testing-1066 or something so that they don't risk being deployed unintentionally.

Because this branch/PR are opened from within Website repo, I think you could modify the trigger conditions to on: push, branch: build-arm64-images or similar, and that should initiate a workflow run from this branch (just make sure to remember to revert that when satisfied with the testing results).

(I say this as someone who generally tests GHA changes by hackily making changes from a repository main branch :/ )

@jayaddison
Copy link
Contributor

it's probably best to change the image tags from latest to testing-1066 or something so that they don't risk being deployed unintentionally

This was a result of a misunderstanding on my behalf, I think: the deployment workflow uploads the container image(s) to Docker Hub, so the presence of an ARM64 image in addition to existing images shouldn't cause any problems, I suppose? (if so: no need for the image tag rename, after all)

@jellybob had you seen / are you following along with postgis/docker-postgis#256?

In an ideal world this would be resolved by having the base image
built for ARM as well as amd64, but without ARM runners for GitHub
Actions this is infeasibly slow (I aborted a test build after 30
minutes - it takes less than a minute to do a build on my M1 Pro
laptop).
@jellybob
Copy link
Contributor Author

Closing until Github Actions has ARM runners, at which point I'll take another pass at this.

@jellybob jellybob closed this Dec 15, 2023
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.

3 participants