revoltchat / backend

Monorepo for Revolt backend services.
https://developers.revolt.chat/api/
Other
1.1k stars 121 forks source link

cross compile arm64 / amd64 images #234

Closed thebearingedge closed 1 year ago

thebearingedge commented 1 year ago

Please make sure to check the following tasks before opening and submitting a PR


Hello! I've got a preliminary cross-compilation (amd64/arm64) setup going with the base, bonfire, and delta container images here. Testing has been a bit wonky, but all six images are building on my local M1 machine.

With cross compilation, buildx of base for both platforms takes about 10 minutes for me vs ??? with emulation 😄.

I plan to create a separate branch and try triggering some build and push Actions on my fork, but wanted to get the work out there sooner for comment in case my removal of cargo install in the separate service images was going to cause problems.

✌️

github-actions[bot] commented 1 year ago

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

thebearingedge commented 1 year ago

I have read the CLA Document and I hereby sign the CLA

thebearingedge commented 1 year ago

After experimenting with concurrent vs. sequential builds, the caching seemed to work out better with concurrent multi-arch builds.

Total build and publish time for complete cache miss is longer, but only around 45m instead of multiple hours due to building arm64 in emulation.

Happy to make more changes. If the approach is desirable, I'm also happy to make updates to autumn and january.

insertish commented 1 year ago

Sorry for the late response, this came in during my semester so I missed it.

Total build and publish time for complete cache miss is longer, but only around 45m instead of multiple hours due to building arm64 in emulation.

Honestly as long as its not obscenely long (> 1 hour), then it's fine. I currently use the CI as part of the production deployment so I'd get a bit impatient having to wait several hours or otherwise having to build it myself.

Happy to make more changes. If the approach is desirable, I'm also happy to make updates to autumn and january.

I read through the changes twice and it looks pretty good. In terms of autumn and january, the plan is to get those merged into this repository at some point but I haven't gotten around to it.

I've just approved the action run, so if it passes again now I'll probably be good to merge.