remix logo

Hacker Remix

GitHub Linux ARM64 hosted runners now available for free in public repositories

177 points by Aissen 2 days ago | 49 comments

geerlingguy 2 days ago

This is excellent news, as it should unblock having precompiled packages available for a number of applications for arm64—for me, most notably, OpenZFS: https://github.com/openzfs/zfs/issues/14511

sebazzz 2 days ago

Was cross compilation not an option?

saurik 1 day ago

My experience asking this question is that effectively no one understands how cross-compilation works (as is also seen here from the response involving nested virtualization)... which is really disappointing given that it causes even more chaos when people fail to understand that even deploying to their same architecture on Linux should be set up more similar to a cross-compiled build (to avoid any properties of the system bleeding into the resulting binary). As far as I can tell, people just think that compilers only can target the system they are on, and if they want to target other architectures, other operating systems, or even merely older systems, they have to run their build system on a machine equivalent to their eventual deployment.

pjmlp 1 day ago

What to expect when many don't even understand how linkers work, and include files scripting style to avoid learning them?

Installing a cross-platform targeting compiler toolchain is next level.

DrillShopper 19 hours ago

I work for a healthcare company, and one of the things that we have to be able to do is reproduce our software for investigations. As a result, we build static cross-compilers pointing to a small system root extracted from the distribution we're building for but targeting the same architecture we're building on. In that way we can ensure that the host system dependencies are not embedded in the built result which means we can pull our compiler and system root out of archive and run it on practically any Linux system.

We usually keep archives of the software releases (even ones that are really, REALLY old and not out in service for the most part except for refurbs of old product), but being able to rebuild them and more importantly build a fixed version targeting the OS it originally targeted is really nice.

nixosbestos 14 hours ago

Nix would handle this trivially.

tliltocatl 21 hours ago

Somewhat tangential, cross-compilation seems to have been frowned upon in Unix historically. A lots of things out there just assume HOST==TARGET.

relistan 1 day ago

Our workload took nearly 18 minutes to cross-compile on their AMD64 runners. It builds on the AArch64 runners in 4 minutes. (Whole container I mean)

justincormack 1 day ago

Thats probably not a cross compile then, its an emulated compile. Cross compiling is basically the same speed.

relistan 15 hours ago

Sure you know what I meant. It’s an emulated compiler compiling natively. But the point is that building Aarch64 containers under emulation sucks and it doesn’t suck under a native build.

hdjdjdn 12 hours ago

But why would you do this instead of cross compiling in the first place?

ecnahc515 2 days ago

While this is great, for people claiming they can now built multi-arch images without emulation, how are you planning on doing so? As far as I know, if you want to build multi-arch images on native runners for each platform, you basically need to:

* Configure a workflow with 1 job for each arch, each building a standalone single-arch image, tagging it with a unique tag, and pushing each to your registry

* Configure another job which runs at the completion of the previous jobs that creates a combined manifest containing each image using `docker manifest create`.

Basically, doing the steps listed in https://www.docker.com/blog/multi-arch-build-and-images-the-... under "The hard way with docker manifest ".

Does anyone have a better approach, or some reusable workflows/GHA that make this process simpler? I know about Depot.dev which basically abstracts the runners away and handles all of this for you, but I don't see a good way to do this yourself without GitHub offering some better abstraction for building docker images.

Edit: I just noticed https://news.ycombinator.com/item?id=42729529 which has a great example of exactly these steps (and I just realized you can just push the digests, instead of tags too, which is nice).

jhardy54 1 day ago

Does build-push-action solve this? I haven’t used their multi-arch configs but I was under the impression that it was pretty smooth.

https://github.com/docker/build-push-action

trumpvoter 1 day ago

It runs in a single job, where single job = single runner. To use two runners/jobs to build multiplatform, each will need to push an untagged image and the shas are aggregated into a manifest in a third job. Definitely doable and the recipes will come out.

Personally prefer just using Go/ko whenever possible ;)

agartner 2 days ago

Here's a quick example I put together on how to use these runners to accelerate docker builds: https://github.com/gartnera/actions-arm64-native-example

jimmydoe 2 days ago

amazing, exactly what I was looking for. thank you

kylegalbraith 2 days ago

This is exciting to see as arm64 is really a growing space, as we've seen since first launching our Docker image build acceleration [0]. Free for public repos is definitely a strong pull if you can live with some of the quirks.

Even with this, building multi-platform Docker images with fast persistent caching in GitHub Actions will still be slow in the worst case and tedious in the best case.

We've also expanded into GitHub Actions runners, bringing our fast caching and faster compute into the actual runner.

We've done some cool things like making caching and disk access faster using ramdisks, Ceph, and blob storage [1]. We're offering Intel, ARM, and macOS runners at half the cost of what GitHub offers to private repos. We're also focused on accelerating even more builds outside of the runner. [2]

[0] https://depot.dev/products/container-builds

[1] https://depot.dev/blog/introducing-github-actions-ultra-runn...

[2] https://depot.dev/blog/introducing-depot-cache

eltondegeneres 2 days ago

Your landing and product pages don't mention macOS, only the pricing page, but the docs make it look like the macOS runners are the same price as Github's.

kylegalbraith 2 days ago

Yeah, this is definitely lacking on our pricing page; thank you for flagging it.

We charge $0.08/minute for macOS runners [0] which has 8 CPUs, 24 GB of memory, and 150 GB of disk. They run with M2 chips, so the closest GitHub-hosted macOS runner is the arm64 one with 6 CPUs at $0.16/minute [1].

It's also worth mentioning that we charge by the minute but track by the second. Whereas GitHub actually rounds up to the closest minute. So a 10-second build on Depot is 10 seconds, and you don't get charged a minute until you've accumulated a minutes worth of build time.

[0] https://depot.dev/docs/github-actions/runner-types#macos-run...

[1] https://docs.github.com/en/billing/managing-billing-for-your...