ARM Your GitHub Actions
Building ARM64 Artifacts with Self-Hosted Action Runners
Who doesn't love Github Actions? We can't even live without them anymore!
Perfect in any way, and essentially free to use, they only have a limitation: They are x86 only and offer no native ARM64 support - if not through super-slow emulation.
For chDB this is quite a limitation since our build process is heavy and demanding!
How can we build native ARM64 binaries without QEMU and with no extra costs?
Hello, Oracle. Now, I'm not their biggest fan but respect where it's due:
Their "Always-Freeβ Oracle Cloud tier generously allows running ARM Ampere A1 instances with 3,000 CPU hours and 18,000 GB hours per month, which affords exactly 4 CPUs and 24GB of RAM with a ~100GB of storage volume. For free. Forever.
.... what's next is obvious!
Grab a FREE AMPERE ARM64 Instance
First, sign up to Oracle Cloud to gain access to their Always-Free Tier.
Once ready, jump to the Compute section and Create a New Instance
Next, modify the parameters in the Image and Shape section by clicking Edit
From the options, choose an AMPERE shape, and max out the resources:
A few more clicks and you're ready to go. Refer to the Oracle docs for more options!
Configure ARM64 Self-Hosted Runner
It's time to use our instance for our self-hosted runner using your GitHub account:
Always make sure to use the latest instructions! For reference, here's the procedure:
sudo apt-get install gcc libz-dev build-essential
mkdir actions-runner && cd actions-runner
curl -o actions-runner-linux-arm64-2.296.1.tar.gz -L https://github.com/actions/runner/releases/download/v2.296.1/actions-runner-linux-arm64-2.296.1.tar.gz
echo "ce11e5d9c1cc299bd8a197b7807f6146fbe7494abb19765fb04664afbdb3755e actions-runner-linux-arm64-2.296.1.tar.gz" | shasum -a 256 -c
tar xzf ./actions-runner-linux-arm64-2.296.1.tar.gz
./config.sh --url https://github.com/your-org/your-repo --token your-token
./run.sh
If you want to run your Runner as a service, use the following extra commands:
sudo ./svc.sh install
sudo ./svc.sh start
sudo ./svc.sh status
Once the setup procedure is complete, your Action Runner should be ready!
Public Repositories
If your repository is public you'll need to enable the following option:
π WARNING
Your Actions will run ON THE INSTANCE. Not Docker. Every step will be VERY real!
It's Action Time!
It's time to configure our Action to use our ARM64 self-hosted runner:
jobs:
build_arm64_linux:
runs-on:
- self-hosted
- ARM64
π That's it!
Simple and powerful. Enjoy your fast, native & free ARM64 builds!