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

Heroku-24 and multi-arch (arm/amd) #1439

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Heroku-24 and multi-arch (arm/amd) #1439

merged 1 commit into from
Apr 17, 2024

Conversation

schneems
Copy link
Contributor

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 PR, however we're not turning on warnings for heroku-24 yet as customers cannot currently use it.

@schneems schneems force-pushed the schneems/heroku-24 branch 8 times, most recently from 624ff61 to c96e82b Compare April 11, 2024 18:42
@schneems schneems marked this pull request as ready for review April 12, 2024 13:00
@schneems schneems requested a review from a team as a code owner April 12, 2024 13:00
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@joshwlewis joshwlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest reframing this PR as heroku-24 support (without the arm64 stuff). There's really no way to activate the arm64 codepath (aside from unit tests), so we probably shouldn't be advertising support for it (I think it's totally fine to have the arm64 codepath, though).

@schneems schneems changed the title Support Heroku-24 and multi-arch Support Heroku-24 and multi-arch - - Stacked 3/3 Apr 15, 2024
@schneems schneems force-pushed the schneems/heroku-24 branch from c96e82b to 8ea32f8 Compare April 15, 2024 20:57
@schneems schneems changed the title Support Heroku-24 and multi-arch - - Stacked 3/3 Heroku-24 and multi-arch (arm/amd) - Stacked 3/3 Apr 15, 2024
@schneems
Copy link
Contributor Author

@schneems schneems requested a review from joshwlewis April 15, 2024 21:01
lib/language_pack/base.rb Outdated Show resolved Hide resolved
@schneems schneems force-pushed the schneems/heroku-24 branch from 8ea32f8 to 9ef927c Compare April 16, 2024 16:05
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 schneems force-pushed the schneems/heroku-24 branch from 9ef927c to da64f44 Compare April 16, 2024 16:20
@schneems
Copy link
Contributor Author

Updated to use dpkg --print-architecture and rebased against main.

@schneems schneems merged commit 935fd0f into main Apr 17, 2024
3 checks passed
@schneems schneems deleted the schneems/heroku-24 branch April 17, 2024 16:37
@heroku-linguist heroku-linguist bot mentioned this pull request Apr 17, 2024
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.
@edmorley edmorley changed the title Heroku-24 and multi-arch (arm/amd) - Stacked 3/3 Heroku-24 and multi-arch (arm/amd) May 29, 2024
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.

3 participants