Skip to content

Add ARM + MacOS target to be able to use on self-hosted runners #805

Closed

Description

@senorflor

Describe the enhancement
A new architecture+OS build target to enable adding runners on the new Apple Silicon (ARM) Macs.

Additional information
This would be useful both for GitHub-hosted and self-hosted runners. I have no idea how much work would be necessary :)

Activity

  1. senorflor commented on Nov 12, 2020

    @senorflor
    Author

    (seems like dotnet/core#4879 is entailed, though)

  2. michaelst commented on Nov 18, 2020

    @michaelst

    for now you can run it with arch -x86_64 at the beginning of the commands

    for example

    arch -x86_64 ./config.sh ...
    arch -x86_64 ./run.sh
    
  3. paulz commented on Dec 7, 2020

    @paulz

    the arch did not help us:

    arch -x86_64  ./config.sh --url https://github.com/sparta-science --token <GENERATED-TOKEN>
    arch: posix_spawnp: ./config.sh: Bad CPU type in executable
    

    we are using preview version of the new Mac mini:

    uname -v
    Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:18 PDT 2020; root:xnu-7195.50.7~2/RELEASE_ARM64_T8020
    
  4. MikeMcQuaid commented on Dec 9, 2020

    @MikeMcQuaid

    @paulz do you have Rosetta 2 installed? It's working for us on Homebrew.

  5. gregorymfoster commented on Dec 9, 2020

    @gregorymfoster

    At my company, we use mac mini's + github actions to trigger xcodebuild in order to run XCUITests. By starting the github action runner, we find that all subprocesses also boot in Rosetta, causing the xcodebuild to create x86 artifacts. The mac mini is then unable to run the XCUITest because it only supports arm iOS simulators.

    When we boot xcode without rosetta by hand, the tests run fine. We'd really appreciate it if Github added support for ARM + MacOS target.

    cc @tomasreimers

  6. gregorymfoster commented on Dec 14, 2020

    @gregorymfoster

    Made forward progress here. We are able to boot the runner using intel emulation, and then escape the emulation when our CI script calls xcodebuild using:

    arch -arm64 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild ...
    

    The big win came from realizing that arch can be used to escape emulation, though it's not documented.

    Detailed writeup here: https://gregmfoster.medium.com/using-m1-mac-minis-to-power-our-github-actions-ios-ci-540c55af13ea

  7. violet-athena commented on Jan 4, 2021

    @violet-athena

    Just an addendum to @gregorymfoster's post. You can find out which architecture you are running on your mac with uname -m. This will output arm64 for AS and x86_64 for Intel. I suspect that you can just run all the bash commands from within the runner prefixed with arch -$(uname -m) my_command and this code will execute for the appropriate platform.

    Maybe this can act as a substitute until the team provides an arm64 compiled version for the M1?

    EDIT: just realised that if you call uname -m from within Rosetta 2 it will output x86_64 😆

  8. smorimoto commented on Jan 29, 2021

    @smorimoto

    Note that if you launch the Actions runner though Rosetta, everything executed internally will be in x86_64 mode. Maybe that's not what you're trying to do, and there's no easy way to address it at this point. I recommend using a self-host runner on Cirrus CI for the time being.

  9. smorimoto commented on Feb 24, 2021

    @smorimoto

    It will be officially released in November, so it will be a long time until we can build using the stable release, but I think we will be able to officially support Apple Silicon in .NET 6: https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-1

  10. ioquatix commented on Mar 4, 2021

    @ioquatix

    Has anyone got this working?

  11. paulz commented on Mar 4, 2021

    @paulz

    We have Apple silicon Mac mini as self hosted runner working

  12. 65 remaining items

  13. jshier commented on May 25, 2022

    @jshier

    @thboop This is mainly about deployment, not ongoing maintenance, which I'm happy to let the runner handle automatically. Most of this isn't GitHub's problem since there's no good solution for deploying macOS build nodes, but I use Ansible to deploy files and run commands when setting up nodes. Having to constantly determine which architecture I'm on to pull the right file is something I try to avoid, but it looks like it's unavoidable here. I'd also like to avoid hardcoding versions but an API call is too much for my limited Ansible knowledge.

    What I'd really like is for the runner software to be available through brew so I can install and manage it like everything else, but I realize that would require a different configuration for that deployment vs. the manual deployment.

  14. jshier commented on May 25, 2022

    @jshier

    @thboop Also, it looks like the "Add Runner" interface still only allows x64 runners, so that needs to be updated as well. Thankfully that just customizes the directions.

  15. TingluoHuang commented on May 25, 2022

    @TingluoHuang
    Member

    The downside of Universal binaries would be the package size since the dotnet runtime size will be doubled and we need to package multiple versions of node.js with the runner. 😢
    (x64 node + arm64 node) *2 (if we support node 16 + node 20 in the future)

  16. jshier commented on May 25, 2022

    @jshier

    From the current release that would be 136.2MB. This is trivial, especially since it's only downloaded on install or update. Of course, if you're building a VM from scratch every day that can add up, but for hardware runners it doesn't seem to be an issue. Plus you could keep offering the architecture-specific downloads at the same time.

  17. aaronsarkissian commented on Jul 6, 2022

    @aaronsarkissian

    Just went for it today, and it works fine and available in the UI interface to choose from.

  18. Steve-Glass commented on Aug 9, 2022

    @Steve-Glass

    👋 official support is now GA! You can find additional details in the change log post here: https://github.blog/changelog/2022-08-09-github-actions-self-hosted-runners-now-support-apple-m1-hardware/

  19. andreped commented on Sep 22, 2022

    @andreped

    👋 official support is now GA! You can find additional details in the change log post here: https://github.blog/changelog/2022-08-09-github-actions-self-hosted-runners-now-support-apple-m1-hardware/

    Any update on GitHub-hosted runners? I don't own a macbook with M1-chip myself, but sadly lots of users do.


    EDIT: I am also aware that according to this, it should be possible to enable M1 silicon options for GitHub-hosted runners, but how do I enable it?

  20. robtaylor commented on Oct 10, 2022

    @robtaylor

    EDIT: I am also aware that according to this, it should be possible to enable M1 silicon options for GitHub-hosted runners, but how do I enable it?

    You need to add the runner under organisation settings/actions/runners. It needs approving from github though..

  21. andreped commented on Oct 10, 2022

    @andreped

    You need to add the runner under organisation settings/actions/runners. It needs approving from github though..

    @robtaylor I'm talking about GitHub-hosted runners, not self-hosted/local runners.

    What Im talking about was mentioned here:
    github/roadmap#528

    I guess it is just part of the roadmap and not yet supported. However, would be great to have an update.

  22. robtaylor commented on Oct 10, 2022

    @robtaylor
  23. andreped commented on Oct 10, 2022

    @andreped

    There’s now a button to add a GitHub hosted runner!

    I think you misunderstand what I want. I want this:
    actions/runner-images#2187

    Perhaps I was a little unclear. I don't see that this is supported as of now. By checking one of my org's settings/actions/runners, I also did not see such a button.

  24. nebuk89 commented on Feb 21, 2023

    @nebuk89
    Contributor

    As per the roadmap we are targeting some time later this year for GitHub hosted M1 support :)
    We have nothing public on this yet, but thanks for your interest and watch this space.. it is coming!

  25. borkdude commented on Feb 21, 2023

    @borkdude

    @nebuk89 This is good to hear! It's the main reason I'm using Cirrus CI now in addition to Github. Will Github also support creating linux arm64 binaries? This would complete the full spectrum for my needs.

  26. nebuk89 commented on Feb 21, 2023

    @nebuk89
    Contributor

    @borkdude a fair ask! We intend to 'at some point' but honestly - I need to start planning it 😁 as a result I don't have a timeframe for it right now 😞 (we will also do Win arm64 as well 😱 but it's in the same state of needing the plan creating!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions