-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Linux ARM support #577
Comments
What's needed to support it? Seems tricky to support it when the docs for it are still private? |
Good question! @dentarg If you would like to, I'm sure @lkfortuna (PM working with Github Actions) can get you into the beta, since this action is widely used. |
I was thinking in general, if you have access to the beta, you should be able to submit a PR to this repo to show what needs to be done? I've been invited to the beta (but haven't gotten access to the docs), I actually just emailed her earlier today ;-) |
@dentarg Ah, got it! I would love to help out, but I don't know the details of this action well enough, sorry. |
Ever heard about "learning by doing"? :-) If you don't dig in yourself here, don't expect any movement on this until after the private beta. |
It's the same as for any other new runner, we need access to the runner from the ruby organization to build binaries, see #494 (comment) So @lkfortuna @Steve-Glass could you make these new beta linux-aarch64 runners available for the |
@dentarg Yeah, I know 😄 I've learned a lot by doing things (self-thought), just that I haven't yet spent that much time with JS-based Github Actions. I do contribute to a few open-source projects, but I have to pick, and currently my goal is to improve the Out of curiosity, do you live in the Stockholm area, or elsewhere? 🇸🇪 |
@eregon - Thanks for reaching out. Let me bring this feedback to the team and we will get back to you next week. |
@lkfortuna @Steve-Glass Somewhat off topic, but is there a reason why the |
^ Because https://github.com/actions/setup-ruby was not actively maintained and provided too little functionality to be practical (e.g. no way to specify Ruby x.y.z, only latest x.y and only 3-4 versions available). |
hi @eregon and chat, I came around this discussion with a similar requirement for arm-based ruby installation. but I'm using self-hosted runners and not GitHub provided. For the base OS, I rely on Ubuntu 20.04-arm64 OS. Ruby binaries for arm64 for ubuntu20.04 are also publicly available. Wouldn't using those for ruby setup in arm-based Ubuntu/Linux OS allow GitHub runners (in beta) to run? |
@cb-krishnapatel The builds need to be tested automatically, so we need access to these runners and the builds must happen on GitHub runners to ensure it's exactly the same image with the same tweaks, packages installed, etc. Regarding https://ubuntu.pkgs.org/20.04/ubuntu-main-arm64/ruby_2.7+1_arm64.deb.html (the system package), of course you can |
Agreed and acknowledged @eregon |
FYI: I requested this to GitHub support for Arm runner as private beta on Ruby organization. |
I'm working on this on the Heroku side right now heroku/docker-heroku-ruby-builder#38. Having support for ARM from ruby/setup-ruby isn't a blocker there, but it's what prompted me to see if an issue was raised yet or not. @hsbt have you heard back from the request? |
We shouldn't need Ruby installed on the runner, and again the container just to be able to build Ruby versions. This commit moves functionality that doesn't **need** to be in Ruby to bash. This is needed as ruby/setup-ruby does not currently work with ARM ruby/setup-ruby#577.
We shouldn't need Ruby installed on the runner, and again the container just to be able to build Ruby versions. This commit moves functionality that doesn't **need** to be in Ruby to bash. This is needed as ruby/setup-ruby does not currently work with ARM ruby/setup-ruby#577.
* Add AMD (x86_64) and ARM (aarch64) on Heroku-24 AMD/x86_64 is the architecture used for all prior base images. Heroku-24 (Ubuntu 24.04) base image is provided with support for ARM/aarch64 (think m1 Mac or graviton AWS server) support. This PR does several things: - Introduces support for heroku-24 base image - Build both arm64 and amd64 architecture binaries * Use GHA arm runner beta * Update ruby/setup-ruby to @v1 everywhere Versions are different across the project, this commit synchronizes them all to v1 which is the latest. * Move build scripts to bash We shouldn't need Ruby installed on the runner, and again the container just to be able to build Ruby versions. This commit moves functionality that doesn't **need** to be in Ruby to bash. This is needed as ruby/setup-ruby does not currently work with ARM ruby/setup-ruby#577. * Manually install docker * Remove Ruby requirement on GHA for building binaries Remove the Ruby requirement in the local runtime to build rubies. It is still needed on the stack image, but this allows us to decouple from ruby/setup-ruby which is itself blocked on building binaries. We still need it for running unit tests on CI. - Remove Rake and Rakefile - Update README to use bash commands - Update all ci.yml and build_ruby.yml to use bash instead of Ruby * Apply suggestions from code review Co-authored-by: Colin Casey <[email protected]> * Fix linting check in CI * Remove docker file from root and ignore It is copied in to root as needed and shouldn't be checked in. * Apply suggestions from code review Co-authored-by: Colin Casey <[email protected]> --------- Co-authored-by: Colin Casey <[email protected]>
rel: ruby#577 example: ```yaml jobs: tests: runs-on: ARM-2c-8r steps: - name: Install dependencies run: sudo apt-get -qq install -y --no-install-recommends build-essential libffi-dev libreadline-dev libyaml-dev libmysqlclient-dev > /dev/null - name: Checkout uses: actions/checkout@v4 - name: Set up Ruby uses: b4b-payments/setup-ruby@arm-runners with: ruby-version: '3.2.2' bundler-cache: true should-install-with-ruby-build: true - name: Run tests run: bundle exec rake test ```
I managed to get this action to work on GitHub's ARM-based runners. Initially, what I needed to edit in this action was relatively small but as there are no pre-built ruby for ARM architecture, I ended up having to add I guess, if we start building for ARM as well, the download urls can be:
where Anyway, my changes can be seen here: b4b-payments@e0facb5. I'd be happy to make PRs for both repos if one of the maintainers weigh in to know the preferred way to approach this. Gotchas: The provided image (ubuntu-22.04) does not behave exactly as the ones that are currently in production for x64. A lot of packages are missing (expected as github has documented) but I had to do the following to get this action to install ruby:
Basically, it looks like |
@everplays While that diff is small it has the big disadvantage to have to compile CRuby from source every time (takes many minutes) and needing to manually install extra packages, and misses some other tweaks done in https://github.com/ruby/ruby-builder/blob/master/.github/workflows/build.yml. Until the ruby organization has access to these new linux arm runners, I think there is nothing we can do. |
indeed, as I said, we'd need to alter ruby-builder repo to build the ARM binary as well. If someone weights in, I can make the changes for that repo too so a full build won't be necessary. :-) |
Unfortunately, ruby org couldn't enable ARM runner with private beta. We need to wait until GA status. |
Recently, macos-latest seems to have become macos-14 running on M1. |
@nobu Could you file a separate issue, with links to the failed workflows? |
Looks like these runners have moved into public beta: https://github.blog/changelog/2024-06-03-actions-arm-based-linux-and-windows-runners-are-now-in-public-beta/ |
From https://github.blog/2024-06-03-arm64-on-github-actions-powering-faster-more-efficient-build-systems/
So it looks like linux-arm64 runners won't be available as GitHub-Hosted runners for public repositories until then. |
Is the paid-only status of ARM support a deal breaker for this project? |
Yes, see the above quote from the announcement |
I think similar 'issues' happened with macOS ARM. GitHub/MSFT adds a new platform for 'Enterprise' customers, and later make it available to OSS projects. The one problem is the CI infrastructure's 'dependencies' come from OSS orgs. Most of the Ruby CI infrastructure for Ubuntu and macOS is contained in the Ruby organization, but some of the Windows infrastructure is not... |
The only way to add linux-aarch64 support earlier is if GitHub provides free linux-aarch64 runners for the ruby organization, like it was done for macos-arm64 with |
It's possible to use qemu to run aarch64 and arm workloads on the normal linux runners. See https://github.com/flavorjones/ruby-c-extensions-explained/blob/main/.github/workflows/precompiled.yml#L172-L179 for an example of how this is done for many C extension projects. The builds will be slower than bare metal (because it's an emulator) but the tests will run. |
This comment was marked as off-topic.
This comment was marked as off-topic.
👋 apologies, but any update here now that it's available? I'm unfortunately trying to still support an older ruby version with the new runners atm |
We encountered the same problem within our CI. We resolved it by manually installing Ruby into the toolcache. However, it would be beneficial to have arm64 support in At Ubicloud, we offer managed GitHub Actions runners with arm64 support. We're happy to offer 10,000 free minutes per month on our platform for the Ruby organization. @eregon If you're interested, please let me know. As Ruby users, we're delighted to back the Ruby organization. |
Yes, this is the current solution (as the error message says), and then you can use setup-ruby in self-hosted mode (automatically detected).
This wouldn't help, no, because of these reasons. |
arm64 Linux and Windows runners have gone GA 🎉 |
So until arm64 runners are available for public repositories (https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories) there is nothing that can be done here. |
Ah, thanks @eregon I didn't realise there was a difference between a runner being GA and a runner being available for consumption (for free) by public repos. |
Just saying.. There are other build system that supports aarch64 by cross compiling. |
Here's where GitHub are tracking the work to make ARM runners available for OSS projects: |
Now that Github Actions has ARM-runners (in private beta currently), it would be awesome if this action would support ARM too.
Right now, it seems to assume Github doesn't have ARM.
https://github.com/ruby/setup-ruby/blob/master/common.js#L165
Here is a signup link for the private beta:
https://resources.github.com/devops/accelerate-your-cicd-with-arm-and-gpu-runners-in-github-actions/
The text was updated successfully, but these errors were encountered: