Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Experimental support for osx-arm64 (Apple M1) #2

Closed
wants to merge 10 commits into from

Conversation

hkratz
Copy link
Owner

@hkratz hkratz commented Aug 16, 2021

This is an unofficial experimental patch to make the GitHub Actions Runner work on Apple Silicon.

Try out the version based on v2.291.1:

git clone https:/hkratz/gha-runner-osx-arm64.git -b macos-arm64
cd gha-runner-osx-arm64/src/
./dev.sh layout
cd ../_layout/
./config.sh --url  {repo-url} --token AA... # use your repo URL and your runner registration token

Known issues:

  • Auto-updates are disabled as this is not an official runner.

Changes compared to upstream release:

  • Fall back to Node 16 instead of Node 12 as earlier versions do not support ARM64.
  • Add osx-arm64 runtime identifier at various places and remove implicit assumption that Darwin/osx implies X64 arch.
  • Fixed failing test DetermineNodeRuntimeVersionInAlpineContainerAsync, which apparently requires x86-64 to pass.
  • Disable auto-update on Macos ARM64.
  • Add checksums for dotnet runtime and externals.
  • Minor: Print checksum of dotnet runtime and externals in assertion failure.

Hacks could possibly be removed in the future.

@hkratz hkratz force-pushed the macos-arm64 branch 11 times, most recently from fffcf92 to 77f45e5 Compare August 16, 2021 10:44
@hkratz hkratz marked this pull request as draft August 16, 2021 11:10
@hkratz hkratz changed the base branch from main to releases/m280 August 16, 2021 20:04
@paulz
Copy link

paulz commented Aug 27, 2021

Thank you, would love to try it.

What is the repo-url in this context?

And where we can lookup the runner registration token? Is there a file on our self hosted runner?

@hkratz
Copy link
Owner Author

hkratz commented Sep 2, 2021

Thank you, would love to try it.

What is the repo-url in this context?

And where we can lookup the runner registration token? Is there a file on our self hosted runner?

@paulz Navigate to the Actions -> Runner section of your repository settings and press the Add runner button. Use the URL and token from the $ ./config.sh --url ... command in the Configure section.

@hkratz hkratz changed the base branch from releases/m280 to releases/m281 September 2, 2021 12:22
@hkratz hkratz changed the base branch from releases/m281 to releases/m282 September 16, 2021 20:10
@hkratz
Copy link
Owner Author

hkratz commented Sep 16, 2021

Rebased on v2.282.1.

@hkratz hkratz force-pushed the macos-arm64 branch 2 times, most recently from af3f50c to 12d9800 Compare September 16, 2021 21:24
@whalemare
Copy link

whalemare commented Sep 24, 2021

How to disable auto-update?

After one day of using I have next message:

./run.sh

√ Connected to GitHub

2021-09-24 08:35:52Z: Listening for Jobs
An error occurred: A package with type agent, platform osx-arm64, version 2.283.1 was not found.

I suppose this is exist, because runner try to update themselves


Yes, after changing code version detection, runner start works again

@hkratz
Copy link
Owner Author

hkratz commented Sep 25, 2021

I currently plan to automate rebasing+testing whenever a new version is released.

@hkratz
Copy link
Owner Author

hkratz commented Nov 9, 2021

Rebased on v2.284.0 and updated to use the release version of .NET 6.0.

@hkratz hkratz changed the base branch from releases/m282 to releases/m284 November 9, 2021 09:19
@hkratz
Copy link
Owner Author

hkratz commented Mar 23, 2022

Rebased on the most current version, v2.289.1. It was a bit more involved due to new checksum code.

Should work again now, running the build of this repo with a runner on my M1 Mac worked fine.

@hkratz hkratz changed the base branch from releases/m287 to releases/m289 March 23, 2022 21:18
@ahoereth
Copy link

ahoereth commented Apr 3, 2022

Again had to rebase for it to pickup jobs. Sadly cannot contribute here as I would need to overwrite your changes, but the following did the job:

git remote add github [email protected]:actions/runner.git
git pull github main
git rebase -X ours main

Had to rerun config.sh tho.

Thanks for the work!

@hkratz
Copy link
Owner Author

hkratz commented Apr 4, 2022

Updated to v2.289.2.

@hkratz
Copy link
Owner Author

hkratz commented Apr 4, 2022

git remote add github [email protected]:actions/runner.git
git pull github main
git rebase -X ours main

@ahoereth Better not to rebase on main, because it frequently contains unreleased changes. Instead rebase on the most current release branch. The current release branch is releases/m289.

@hkratz hkratz changed the base branch from releases/m289 to releases/m290 April 12, 2022 16:21
@hkratz
Copy link
Owner Author

hkratz commented Apr 12, 2022

Updated to v2.290.0.

@daiyam
Copy link

daiyam commented Apr 24, 2022

git remote add github [email protected]:actions/runner.git
git pull github main
git rebase -X ours main

@ahoereth Better not to rebase on main, because it frequently contains unreleased changes. Instead rebase on the most current release branch. The current release branch is releases/m289.

I had also to rebase with releases/m290 so the jobs can be picked up. Thx for your work.

@hkratz
Copy link
Owner Author

hkratz commented Apr 24, 2022

Updated to v2.290.1.

@runmael
Copy link

runmael commented May 11, 2022

Hey @hkratz thanks for providing the ARM64 runner, I went and installed it but it seems the runner isn't picking any jobs. Based on discussion, it seems that rebasing usually helped, but even with rebasing to the latest release (releases/m291) it still isn't picking any jobs. Could you jump in and check why is this happening, or provide some steps how to reenable it in those situations? Thank you

@daiyam
Copy link

daiyam commented May 11, 2022

I did had to rebase my runner to releases/m291 and it's picking the jobs.

Here my commands:

git remote add github https:/actions/runner.git

git pull github releases/m291
git update-ref -d MERGE_HEAD
git rebase -X ours github/releases/m291

@hkratz hkratz changed the base branch from releases/m290 to releases/m291 May 16, 2022 15:41
@hkratz
Copy link
Owner Author

hkratz commented May 16, 2022

Updated to v2.291.1.

@hkratz
Copy link
Owner Author

hkratz commented Mar 29, 2023

No longer needed as the functionality is implemented upstream.

@hkratz hkratz closed this Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.