Skip to content

Commit

Permalink
Add Heroku-24 and ARM support (#33)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
schneems authored May 23, 2024
1 parent bef16c7 commit 5d6f856
Show file tree
Hide file tree
Showing 19 changed files with 261 additions and 1,861 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/build_jruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,24 @@ jobs:
strategy:
fail-fast: false
matrix:
stack: ["heroku-20", "heroku-22"]
base_image: ["heroku-20", "heroku-22", "heroku-24"]
env:
STACK: ${{ matrix.stack }}
BASE_IMAGE: ${{ matrix.base_image }}
runs-on: pub-hk-ubuntu-22.04-xlarge
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up system to run build scripts
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.1'
- name: Install dependencies
run: bundle install
uses: actions/checkout@v4
- name: Print changelog
run: bin/print_changelog ${{ inputs.jruby_version }} | tee $GITHUB_STEP_SUMMARY
- name: Build Docker image
run: bundle exec rake "generate_image[$STACK]"
- name: Generate JRuby Dockerfile
run: bundle exec rake "new[${{ inputs.jruby_version }},$STACK]"
run: bin/activate_docker $BASE_IMAGE
- name: Build and package JRuby runtime
run: bash "rubies/$STACK/jruby-${{ inputs.jruby_version }}.sh"
run: bin/build_jruby $BASE_IMAGE ${{ inputs.jruby_version }}
- name: Test JRuby runtime
run: bin/print_summary $BASE_IMAGE ${{ inputs.jruby_version }} | tee $GITHUB_STEP_SUMMARY
- name: Upload JRuby runtime archive to S3 dry run
if: (inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}" --dryrun
- name: Upload JRuby runtime archive to S3 production
if: (!inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}"
- name: Output CHANGELOG
if: (!inputs.dry_run)
run: bundle exec rake "changelog[${{inputs.jruby_version}}]"
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
- push
- pull_request

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run ShellCheck
run: |
shellcheck *.sh -x &&
shellcheck bin/* -x
integration_test:
runs-on: ${{ matrix.arch == 'arm64' && 'pub-hk-ubuntu-22.04-arm-large' || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
base_image: ["heroku-20", "heroku-22", "heroku-24"]
jruby_version: ["9.4.7.0"]
arch: ["amd64", "arm64"]
exclude:
- base_image: "heroku-20"
arch: "arm64"
- base_image: "heroku-22"
arch: "arm64"
env:
BASE_IMAGE: ${{ matrix.base_image }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Docker and missing development libs (ARM64 only)
if: matrix.arch == 'arm64'
run: |
sudo apt-get update --error-on=any
sudo apt-get install -y --no-install-recommends acl docker.io docker-buildx libc6-dev
sudo usermod -aG docker $USER
sudo setfacl --modify user:$USER:rw /var/run/docker.sock
- name: Print changelog
run: bin/print_changelog ${{ matrix.jruby_version }} | tee $GITHUB_STEP_SUMMARY
- name: Build Docker image
run: bin/activate_docker ${{ matrix.base_image }}
- name: Build and package JRuby runtime
run: bin/build_jruby ${{ matrix.base_image }} ${{ matrix.jruby_version }}
- name: Test JRuby runtime with ARCH
if: matrix.base_image == 'heroku-24'
run: bin/print_summary ${{ matrix.base_image }} ${{ matrix.jruby_version }} ${{ matrix.arch }}
- name: Test JRuby runtime without ARCH
if: matrix.base_image != 'heroku-24'
run: bin/print_summary ${{ matrix.base_image }} ${{ matrix.jruby_version }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ builds/
cache/
vendor/bundle/
.env
bin/
.DS_Store
Dockerfile
rubies/
7 changes: 0 additions & 7 deletions Gemfile

This file was deleted.

Loading

0 comments on commit 5d6f856

Please sign in to comment.