cross-platform-actions / action

Cross-platform GitHub action
MIT License
128 stars 19 forks source link

Inquiry: Advantage of macOS vs Linux runners? #70

Closed beamerblvd closed 10 months ago

beamerblvd commented 10 months ago

Other than mentioning various features that the macOS and/or Linux runners do or do not support, the documentation doesn't mention any particular benefits of one over the other, or of xhyve vs qemu (which might inform a macOS vs Linux decision).

Assuming I have a fairly simple freebsd and netbsd matrix and I don't have any particular version or architecture requirements, is there a reason that I should choose macOS over Linux or Linux over macOS? Trying to figure out if I can expect better performance (faster builds) from a particular runner config.

Thanks in advance for bringing some clarity to my decision making.

beamerblvd commented 10 months ago

One of the reasons I'm asking is that about half of my runs are failing with this:

  hdiutil: couldn't eject "disk2" - Resource busy

  /Users/runner/work/_actions/cross-platform-actions/action/v0.21.0/webpack:/cross-platform-action/node_modules/@actions/exec/lib/toolrunner.js:574

And I'm wondering if switching runners to Ubuntu would fix this (which I'm about to try), but there may be other reasons why macOS is generally better that would negate that decision.

jacob-carlborg commented 10 months ago

macOS runners are preferred because they supported hardware accelerated nested virtualization. This was mentioned in the readme in the "Under the Hood" section. But I made it more clear and explicit now and added it to the "Runners" section: https://github.com/cross-platform-actions/action#runners.

beamerblvd commented 10 months ago

That is kinda the conclusion that I came to, too. When I switched to Ubuntu as the runner, things really slowed down. However, when I switched to Ubuntu as the runner, things became much more reliable. I have a matrix of six builds using this action. When using Ubuntu as the runner, they never fail (unless I've broken my own code). When using macOS as the runner, at least one build (usually two) in the matrix always fails every single run, with the disk ejection problem mentioned in another issue. So I'll stick with Ubuntu for now due to the reliability.

jacob-carlborg commented 10 months ago

with the disk ejection problem mentioned in another issue

I fixed that two days ago (hopefully) in https://github.com/cross-platform-actions/action/releases/tag/v0.21.1. You can also try using QEMU as the hypervisor on macOS for better stability.

beamerblvd commented 10 months ago

That did, indeed, seem to fix the disk ejection issue on macOS runners. I'll also try QEMU on macOS to see if it works any better or faster for my specific use case.

Out of curiosity, why can xhyve be used only for OpenBSD and FreeBSD, but not NetBSD, on macOS?

jacob-carlborg commented 10 months ago

Out of curiosity, why can xhyve be used only for OpenBSD and FreeBSD, but not NetBSD, on macOS?

OpenBSD and FreeBSD are the only operating systems I've managed to boot in xhyve.