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 AMD (x86_64) and ARM (aarch64) on Heroku-24 #38

Merged
merged 10 commits into from
Apr 2, 2024
Merged

Conversation

schneems
Copy link
Contributor

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

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
Versions are different across the project, this commit synchronizes them all to v1 which is the latest.
@schneems schneems force-pushed the schneems/arm branch 2 times, most recently from 070f3f1 to 88a4849 Compare March 25, 2024 18:15
@schneems schneems force-pushed the schneems/arm branch 6 times, most recently from 819511c to b37a98b Compare March 26, 2024 20:51
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.
@schneems schneems force-pushed the schneems/arm branch 2 times, most recently from fd519eb to 9de34d2 Compare March 27, 2024 00:32
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
@schneems schneems marked this pull request as ready for review March 28, 2024 14:07
@schneems schneems requested a review from a team as a code owner March 28, 2024 14:07
README.md Outdated Show resolved Hide resolved
lib/build_script.rb Outdated Show resolved Hide resolved
schneems and others added 2 commits March 28, 2024 10:03
Co-authored-by: Colin Casey <casey.colin@gmail.com>
bin/print_changelog Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
schneems and others added 2 commits March 28, 2024 12:53
It is copied in to root as needed and shouldn't be checked in.
Co-authored-by: Colin Casey <casey.colin@gmail.com>
@schneems schneems merged commit 66353f7 into main Apr 2, 2024
24 checks passed
@schneems schneems deleted the schneems/arm branch April 2, 2024 18:01
schneems added a commit to heroku/heroku-buildpack-ruby that referenced this pull request Apr 17, 2024
Heroku-24 base image supports two architectures amd64 and arm64. We've built binaries for these two architectures heroku/docker-heroku-ruby-builder#38. Effectively this means that the s3 bucket that holds the Ruby binaries has an additional folder. Previously files were at `<stack>/ruby-<version>.tgz` now they are at `<stack>/<arch>/ruby-<version>.tgz` but only for `heroku-24` and future stacks moving forward.

To support multiple architectures, the buildpack needs to detect the current architecture and whether or not the current stack supports multiple architectures.

Beyond downloading binaries, the buildpack is aware of the S3 structure to travers version numbers in order to warn customers when a newer version of a ruby version is available. We also warn customers if their current Ruby version is not available on the next stack. This behavior is implemented and tested in this commit, however we're not turning on warnings for `heroku-24` yet as customers cannot currently use it.
schneems added a commit to heroku/buildpacks-ruby that referenced this pull request May 17, 2024
* Support Heroku-24 and ARM architecture

Heroku 24 stack image supports both arm64 and amd64. The Ruby binaries are available on heroku-24 compiled to these two stacks heroku/docker-heroku-ruby-builder#38. The buildpack adds support by:

- Updating the `buildpackl.toml` to include ARM architecture
- Using architecture information to build the URL for Ubuntu 24.04 (heroku-24)
- Integration testing on all supported Ubuntu versions

* Fix multi arch test compilation


From: https://github.com/heroku/buildpacks-ruby/pull/284/files#r1603946649. The tests currently fail locally on a Mac (arm64/aarch64) because tests are always being compiled for amd64/x86. This change is a workaround to force compilation to the current target architecture.

* Apply suggestions from code review

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>

* Fix variable name

---------

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
schneems added a commit to heroku/docker-heroku-jruby-builder that referenced this pull request May 23, 2024
- Rewrites the project to use a pre-built JRuby binary. Links to downloads are at https://www.jruby.org/download.
- Adds the heroku-24 base image as a build target
- Re-uses the ARM url format for S3 that was introduced in heroku/docker-heroku-ruby-builder#38. Both the Ruby classic buildpack and CNB are tightly coupled to this format and will attempt to download binaries from S3 with cpu architecture information on heroku-24. Once built and uploaded to S3 there should be no changes needed to the buildpack to acquire support for heroku-24 and ARM due to:
  - heroku/heroku-buildpack-ruby#1439
  - heroku/buildpacks-ruby#284
schneems added a commit to heroku/docker-heroku-jruby-builder that referenced this pull request May 23, 2024
* Add Heroku-24 and ARM support

- Rewrites the project to use a pre-built JRuby binary. Links to downloads are at https://www.jruby.org/download.
- Adds the heroku-24 base image as a build target
- Re-uses the ARM url format for S3 that was introduced in heroku/docker-heroku-ruby-builder#38. Both the Ruby classic buildpack and CNB are tightly coupled to this format and will attempt to download binaries from S3 with cpu architecture information on heroku-24. Once built and uploaded to S3 there should be no changes needed to the buildpack to acquire support for heroku-24 and ARM due to:
  - heroku/heroku-buildpack-ruby#1439
  - heroku/buildpacks-ruby#284

* Remove unused directory

Prior to #33 a script was generated for every Ruby version on every stack to execute docker. This is no longer needed, we can get rid of this directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants