tiny-pilot / tinypilot

Use your Raspberry Pi as a browser-based KVM.
https://tinypilotkvm.com
MIT License
3.01k stars 252 forks source link

Build Debian package using CircleCI ARM executor #1584

Closed mtlynch closed 1 year ago

mtlynch commented 1 year ago

I'm embarrassed it took me this long to realize it, but CircleCI's ARM64 (ARMv8) executors can build ARMv7 (i.e., 32-bit ARM) binaries natively.

We've been using Docker+QEMU to emulate 32-bit ARM on AMD64, but we can just use ARM-native CircleCI instances, skip the emulation, and build Debian packages in about 70s instead of the 4m we were seeing when we use QEMU.

This means we should make the following changes:

I created a quick 'n dirty proof of concept here, but it needs a bit of cleanup: https://github.com/tiny-pilot/tinypilot/compare/circleci-arm?expand=1

db39 commented 1 year ago

@mtlynch - I've taken a look at your branch and its changes, and I'm not sure what kind of cleanup you're looking for on the circleCI files.

I'm mostly unfamiliar with the circleCI config files beyond having to change the build branch when doing previous work, so I'm probably just missing some obvious stuff.

We could probably refactor these lines so that we no longer need to move all packages to a different location (assuming we never want to build AMD64)?

mtlynch commented 1 year ago

We could probably refactor these lines so that we no longer need to move all packages to a different location (assuming we never want to build AMD64)?

Right, we don't need to keep that around since we no longer want AMD64. We can revert that section back to what it used to look like.

When you merge into Pro, it's a little more complicated because we're keeping microsd_build_branch. Here's how it should look in Pro (just the .circleci stuff, you can ignore the rest):

https://github.com/tiny-pilot/tinypilot-pro/compare/arm-pro?expand=1

The other piece is adding documentation to CONTRIBUTING.md showing how to build ARMv7 from an AMD64 dev machine.