Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI for Mac on Apple Sillicon #451

Closed
adamrodger opened this issue Apr 9, 2023 · 10 comments
Closed

Add CI for Mac on Apple Sillicon #451

adamrodger opened this issue Apr 9, 2023 · 10 comments
Assignees
Labels
feature request Indicates new feature requests

Comments

@adamrodger
Copy link
Contributor

adamrodger commented Apr 9, 2023

Depends on GitHub Actions feature github/roadmap#528

Apple Sillicon (i.e. ARM64-based M1 and M2 processors) will only have alpha-level support until we can run CI fully on this OS/arch combination. This means that we ship the necessary binaries to make it work on a best-effort basis, but any bugs specific to that OS/arch may not be fixed until after this issue is resolved.

Alpha support was added in #365 and the binaries were included from release 4.3.0

@YOU54F
Copy link
Member

YOU54F commented Apr 11, 2023

Hey, 110% agree on this, but don't think we should wait until GitHub Actions adds the appropriate hardware as it might be a while.

Cirrus-CI offers the use of M1 mac's for free for public projects

It is pretty nice

https://cirrus-ci.org/guide/quick-start/

and can be hooked up with https://tart.run/ where a user can run the same CI run on their local machine (similar to https://github.com/nektos/act ) as long as they are running MacOS M1/M2 machines

They also offer the use of an ARM64 Linux Machine (as do CircleCI).

Wonder if it worth setting up an account per pact-foundation project (to avoid concurrency issues on the m1 resources)

As a non-scalable aside - I've managed to setup ephemeral runners on the mac m1 machine for linux/windows/mac github action runners, which at least allow for manual testing / validation of arm64 platforms.

@adamrodger
Copy link
Contributor Author

I'm not really looking to migrate CI off GitHub Actions currently because the support here is really good. The only problem being ARM-based Mac support.

There was talk about the Pact Foundation paying for a self hosted ARM runner, but not sure where that's got to.

The only consequence is just that ARM for Mac isn't fully supported officially, but in practice we know that it does actually work because there are plenty of users already with no reported issues.

I'm not sure how much we can even officially support it ourselves anyway given ARM/Mac isn't a Tier 1 arch for Rust itself either. They're also waiting for GH to add ARM runners before they'll promote it from Tier 2. See: rust-lang/rust#73908

@YOU54F
Copy link
Member

YOU54F commented Apr 11, 2023

I'm not really looking to migrate CI off GitHub Actions currently because the support here is really good. The only problem being ARM-based Mac support.

Not suggesting we migrate everything, but we can add support for an m1 runner via cirrus, or another means for free, with a very easy way to test locally setup locally. Seems like a no brainer

There was talk about the Pact Foundation paying for a self hosted ARM runner, but not sure where that's got to.

There is money in the pact-foundation kitty open collective, however paid for m1 runners are prohibitively expensive from a cursory glance for my own personal needs (read: happy to use SaaS products, don't want to pay any money 😅 )

With a community hat on, we would need someone to invest time in setting up the infra and ascertaining the usage/costs - we don't want a big bill we cant pay, its a fair point, and it's worth bringing up as we get together as a maintainer group to decide what is the best way forward.

I'm mainly talking from my own perspective here, I want things to be free and easy for the average user to run. Act is incredible for linux images, cirrus/tart offers free usage of m1 machines, very easy to setup ci, and plugs into github to report checks as per our existing github actions (so they could all remain as is)

I'm not sure how much we can even officially support it ourselves anyway given ARM/Mac isn't a Tier 1 arch for Rust itself either. They're also waiting for GH to add ARM runners before they'll promote it from Tier 2. See: rust-lang/rust#73908

Agreed, it's best efforts, official support of an open-source project is a grey area, even when it is a tier 1 arch, there will still be issues.

@YOU54F
Copy link
Member

YOU54F commented Jul 25, 2023

Working CI runs for

  • arm64/amd64 linux
  • arm64 macos
    • with rosetta using x64 dotnet binaries
    • without rosetta using arm64 dotnet binaries

https://github.com/YOU54F/pact-net/blob/arm64_ci/.cirrus.yml
https://cirrus-ci.com/build/5775306234003456

@mefellows
Copy link
Member

There was talk about the Pact Foundation paying for a self hosted ARM runner, but not sure where that's got to.

Just on this - PactFlow/SmartBear are more than happy to supply the AWS runners for it (it just needs someone to create the GH custom agents I think).

But I think the solution Saf has proposed is much better!

@YOU54F
Copy link
Member

YOU54F commented Jul 25, 2023

FWIW I documented it here

https://docs.pact.io/contributing/ci

I like the fact that it is available for free to open source users, and therefore they have a path to contributing rather than being locked into to needing to potentially pay for aws runners if they want to replicate it on their own.

@mefellows
Copy link
Member

Agree!

@TDavtyan-ST
Copy link

well, the day has come, and now it is added to github actions
https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/

@mefellows
Copy link
Member

Yep! See also https://pact-foundation.slack.com/archives/C9VPNUJR2/p1706824238218649.

Yousaf has been adding runners to other projects, but I think we can progress this now. Open to a PR @TDavtyan-ST ? I'm assuming it should be straightforward.

adamrodger added a commit that referenced this issue Feb 15, 2024
The target platform is explicitly noted so that the CI will flag up
if/when GitHub runners change their defaults. This ensures we're very
explicitly doing both an x64 and ARM build for MacOS instead of
accidentally doing only ARM if/when the defaults are changed.
@adamrodger
Copy link
Contributor Author

Added explicit ARM support for MacOS (as well as existing x64) and marked the documentation that this is now fully supported from 5.0.0-beta.2 onwards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Indicates new feature requests
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

4 participants