Skip to content

Commit 9309c4f

Browse files
sanketsudakeclaude
andauthored
chore(ruby): upgrade to Ruby 3.4 from EOL 2.6.1 (#442)
* chore(ruby): upgrade to Ruby 3.4 from EOL 2.6.1 - Base image ruby:2.6.1-alpine3.9 (EOL March 2020) -> ruby:3.4-alpine for env and builder; builder no longer apk-installs the distro ruby toolchain alongside the base image's ruby - Pin rack "~> 2.2" (Rack 3 removed Rack::Handler and thin's Rack 3 support is incomplete); regenerate Gemfile.lock on ruby 3.4 (rack 2.2.23, thin 2.0.1) with linux gnu/musl amd64+arm64 platforms - fission/specializer.rb: load vendored native-extension dirs for any platform instead of hardcoding x86_64-linux (the env is now musl-based and multi-arch) - builder defaultBuildCmd: replace deprecated `bundle install --deployment` with the bundler 2.x config form - Refresh examples/parse Gemfile.lock (nokogiri 1.12.5 -> 1.19.3, supersedes #366 and #384-adjacent pins) - envconfig runtimeVersion 3.4, version 1.32.0; environments.json regenerated Verified locally: env + builder images build; hello.rb specialize + invoke pass; full package path passes (builder vendors native nokogiri musl gem, directory-mode /v2/specialize 201, invoke parses XML correctly). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci(ruby): run skaffold via make instead of the stale skaffold action hiberbee/github-action-skaffold@1.27.0 pins skaffold 2.3.1, which cannot parse the repo's skaffold/v4beta13 config, so the ruby job failed whenever it triggered. Use SKAFFOLD_PROFILE=ruby make skaffold-run like the other env jobs (setup-cluster already installs a current skaffold). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7d1827f commit 9309c4f

10 files changed

Lines changed: 57 additions & 26 deletions

File tree

.github/workflows/environment.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,7 @@ jobs:
264264
- name: Setup Fission Cluster
265265
uses: ./.github/actions/setup-cluster
266266
- name: ruby
267-
uses: hiberbee/github-action-skaffold@1.27.0
268-
with:
269-
command: run
270-
profile: ruby
267+
run: SKAFFOLD_PROFILE=ruby make skaffold-run
271268
tensorflow:
272269
runs-on: ubuntu-latest
273270
needs: check

environments.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@
464464
],
465465
"name": "Ruby Environment",
466466
"readme": "https://github.com/fission/environments/tree/master/ruby",
467-
"runtimeVersion": "2.6.1",
467+
"runtimeVersion": "3.4",
468468
"shortDescription": "Ruby environment with WEBrick library",
469469
"status": "Stable",
470-
"version": "1.31.1"
470+
"version": "1.32.0"
471471
}
472472
]
473473

ruby/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:2.6.1-alpine3.9
1+
FROM ruby:3.4-alpine
22

33
RUN apk update
44
RUN apk add --no-cache build-base

ruby/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22
source "https://rubygems.org"
33

4-
gem "rack"
4+
gem "rack", "~> 2.2"
55
gem "thin"

ruby/Gemfile.lock

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
daemons (1.3.1)
4+
daemons (1.4.1)
55
eventmachine (1.2.7)
6-
rack (2.1.4)
7-
thin (1.7.2)
6+
logger (1.7.0)
7+
rack (2.2.23)
8+
thin (2.0.1)
89
daemons (~> 1.0, >= 1.0.9)
910
eventmachine (~> 1.0, >= 1.0.4)
10-
rack (>= 1, < 3)
11+
logger
12+
rack (>= 1, < 4)
1113

1214
PLATFORMS
15+
aarch64-linux-musl
1316
ruby
17+
x86_64-linux
18+
x86_64-linux-musl
1419

1520
DEPENDENCIES
16-
rack
21+
rack (~> 2.2)
1722
thin
1823

1924
BUNDLED WITH
20-
1.15.1
25+
2.6.9

ruby/builder/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
ARG BUILDER_IMAGE=fission/builder:latest
22
FROM ${BUILDER_IMAGE}
33

4-
FROM ruby:2.6.1-alpine3.9
4+
FROM ruby:3.4-alpine
55
COPY --from=0 /builder /builder
66

77
RUN apk update
8-
RUN apk add --no-cache ruby ruby-dev ruby-bundler build-base
8+
RUN apk add --no-cache build-base
99

1010
ADD defaultBuildCmd /usr/local/bin/build
1111

ruby/builder/defaultBuildCmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
set -euxo pipefail
33

44
if [ -f ${SRC_PKG}/Gemfile.lock ]
5-
then
5+
then
66
cd $SRC_PKG
7-
bundle install --deployment
7+
# --deployment is deprecated in bundler 2.x; the config form is equivalent.
8+
bundle config set --local deployment true
9+
bundle install
810
fi
911
cp -r ${SRC_PKG} ${DEPLOY_PKG}

ruby/envconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
],
2323
"name": "Ruby Environment",
2424
"readme": "https://github.com/fission/environments/tree/master/ruby",
25-
"runtimeVersion": "2.6.1",
25+
"runtimeVersion": "3.4",
2626
"shortDescription": "Ruby environment with WEBrick library",
2727
"status": "Stable",
28-
"version": "1.31.1"
28+
"version": "1.32.0"
2929
}
3030
]

ruby/examples/parse/Gemfile.lock

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,42 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
mini_portile2 (2.6.1)
5-
nokogiri (1.12.5)
6-
mini_portile2 (~> 2.6.1)
4+
mini_portile2 (2.8.9)
5+
nokogiri (1.19.3)
6+
mini_portile2 (~> 2.8.2)
77
racc (~> 1.4)
8-
racc (1.5.2)
8+
nokogiri (1.19.3-aarch64-linux-gnu)
9+
racc (~> 1.4)
10+
nokogiri (1.19.3-aarch64-linux-musl)
11+
racc (~> 1.4)
12+
nokogiri (1.19.3-arm-linux-gnu)
13+
racc (~> 1.4)
14+
nokogiri (1.19.3-arm-linux-musl)
15+
racc (~> 1.4)
16+
nokogiri (1.19.3-arm64-darwin)
17+
racc (~> 1.4)
18+
nokogiri (1.19.3-x86_64-darwin)
19+
racc (~> 1.4)
20+
nokogiri (1.19.3-x86_64-linux-gnu)
21+
racc (~> 1.4)
22+
nokogiri (1.19.3-x86_64-linux-musl)
23+
racc (~> 1.4)
24+
racc (1.8.1)
925

1026
PLATFORMS
27+
aarch64-linux-gnu
28+
aarch64-linux-musl
29+
arm-linux-gnu
30+
arm-linux-musl
31+
arm64-darwin
1132
ruby
33+
x86_64-darwin
34+
x86_64-linux
35+
x86_64-linux-gnu
36+
x86_64-linux-musl
1237

1338
DEPENDENCIES
1439
nokogiri (>= 1.12.5)
1540

1641
BUNDLED WITH
17-
1.17.3
42+
2.6.9

ruby/fission/specializer.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ module Specializer
3030

3131
def self.load_vendor(path)
3232
gems = Dir[File.join(path, 'vendor/bundle/ruby/*/gems/*/lib')]
33-
exts = Dir[File.join(path, 'vendor/bundle/ruby/*/extensions/x86_64-linux/*/*')]
33+
# Match any platform dir (x86_64-linux-musl, aarch64-linux-musl, ...)
34+
# instead of hardcoding x86_64-linux.
35+
exts = Dir[File.join(path, 'vendor/bundle/ruby/*/extensions/*/*/*')]
3436

3537
$LOAD_PATH.unshift(*gems)
3638
$LOAD_PATH.unshift(*exts)

0 commit comments

Comments
 (0)