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

Updating to newest base image, Ruby 3.4 (SCP-5959) #2221

Merged
merged 11 commits into from
Mar 20, 2025
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# use SCP base Rails image, configure only project-specific items here
FROM gcr.io/broad-singlecellportal-staging/rails-baseimage:2.3.0
FROM gcr.io/broad-singlecellportal-staging/rails-baseimage:3.0.0

# Set ruby version
RUN bash -lc 'rvm --default use ruby-3.2.2'
RUN bash -lc 'rvm --default use ruby-3.4.2'
RUN bash -lc 'rvm rvmrc warning ignore /home/app/webapp/Gemfile'

# Set up project dir, install gems, set up script to migrate database and precompile static assets on run
Expand Down
14 changes: 11 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.2.2'
ruby '3.4.2'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '6.1.7.9'
Expand Down Expand Up @@ -29,7 +29,7 @@ gem 'sdoc', group: :doc
# gem 'capistrano-rails', group: :development

gem 'bootsnap', require: false
gem 'minitest', '5.15.0'
gem 'minitest'
gem 'minitest-rails'
gem 'minitest-reporters'

Expand Down Expand Up @@ -71,7 +71,6 @@ gem 'rack-brotli'
gem 'time_difference'
gem 'sys-filesystem', require: 'sys/filesystem'
gem 'browser'
gem 'ruby-prof'
gem 'carrierwave', '~> 2.2'
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
gem 'uuid'
Expand All @@ -81,6 +80,14 @@ gem 'net-imap'
gem 'net-pop'
gem 'exponential-backoff'
gem 'concurrent-ruby', '1.3.4'
# gems removed from stdlib in 3.4
gem 'bigdecimal'
gem 'mutex_m'
gem 'observer'
gem 'ostruct'
gem 'logger'
gem 'benchmark'
gem 'drb'

group :development, :test do
# Access an IRB console on exception pages or by using <%= console %> in views
Expand All @@ -93,6 +100,7 @@ group :development, :test do
gem 'puma'
gem 'rubocop', require: false
gem 'rubocop-rails', require: false
gem 'csv'

# Profiling
gem 'rack-mini-profiler'
Expand Down
35 changes: 25 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ GEM
execjs
base64 (0.2.0)
bcrypt (3.1.16)
benchmark (0.4.0)
bigdecimal (3.1.9)
bootsnap (1.13.0)
msgpack (~> 1.2)
brakeman (5.0.1)
Expand Down Expand Up @@ -129,6 +131,7 @@ GEM
coffee-script-source (1.12.2)
concurrent-ruby (1.3.4)
crass (1.0.6)
csv (3.3.2)
daemons (1.4.0)
date (3.4.1)
declarative (0.0.20)
Expand All @@ -146,9 +149,10 @@ GEM
warden (~> 1.2.3)
digest-crc (0.6.4)
rake (>= 12.0.0, < 14.0.0)
docile (1.3.5)
docile (1.4.1)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
drb (2.2.1)
dry-cli (0.7.0)
easy_diff (1.0.0)
erubi (1.13.1)
Expand Down Expand Up @@ -258,6 +262,7 @@ GEM
listen (3.5.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.6)
loofah (2.24.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand All @@ -277,7 +282,7 @@ GEM
mime-types-data (3.2021.0225)
mini_magick (4.12.0)
mini_mime (1.1.5)
minitest (5.15.0)
minitest (5.25.5)
minitest-hooks (1.5.0)
minitest (> 5.3)
minitest-rails (6.1.0)
Expand Down Expand Up @@ -317,6 +322,7 @@ GEM
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.3.0)
mutex_m (0.3.0)
naturally (2.2.1)
net-imap (0.5.6)
date
Expand All @@ -341,6 +347,7 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
observer (0.1.2)
omniauth (2.0.4)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
Expand All @@ -358,6 +365,7 @@ GEM
omniauth (~> 2.0)
orm_adapter (0.5.0)
os (1.1.4)
ostruct (0.6.1)
parallel (1.22.1)
parser (3.1.2.1)
ast (~> 2.4.1)
Expand Down Expand Up @@ -446,7 +454,6 @@ GEM
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
ruby-prof (1.7.0)
ruby-progressbar (1.11.0)
ruby-vips (2.2.1)
ffi (~> 1.12)
Expand All @@ -473,13 +480,13 @@ GEM
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simplecov (0.21.2)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov-html (0.13.1)
simplecov-lcov (0.8.0)
simplecov_json_formatter (0.1.3)
simplecov_json_formatter (0.1.4)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
Expand Down Expand Up @@ -541,9 +548,12 @@ PLATFORMS
x86_64-darwin-20
x86_64-darwin-21
x86_64-darwin-23
x86_64-darwin-24
x86_64-linux

DEPENDENCIES
benchmark
bigdecimal
bootsnap
bootstrap-sass!
brakeman
Expand All @@ -554,10 +564,12 @@ DEPENDENCIES
carrierwave-mongoid
coffee-rails
concurrent-ruby (= 1.3.4)
csv
daemons
delayed_job
delayed_job_mongoid
devise
drb
exponential-backoff
factory_bot_rails
flamegraph
Expand All @@ -573,22 +585,26 @@ DEPENDENCIES
jquery-fileupload-rails
jquery-rails
listen
logger
memory_profiler
minitest (= 5.15.0)
minitest
minitest-hooks
minitest-rails
minitest-reporters
mongoid
mongoid-encrypted-fields
mongoid-history
mongoid_rails_migrations
mutex_m
naturally
nested_form!
net-imap
net-pop
net-smtp
observer
omniauth-google-oauth2
omniauth-rails_csrf_protection
ostruct
parallel
puma
rack-brotli
Expand All @@ -597,7 +613,6 @@ DEPENDENCIES
rest-client
rubocop
rubocop-rails
ruby-prof
ruby_native_statistics
rubyzip
sass-rails (>= 6)
Expand All @@ -619,7 +634,7 @@ DEPENDENCIES
will_paginate_mongoid

RUBY VERSION
ruby 3.2.2p53
ruby 3.4.2p28

BUNDLED WITH
2.6.1
2.6.2
2 changes: 0 additions & 2 deletions app/models/batch_api_client.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true
#
# Wrapper around Google Batch API for submitting for submitting/reporting scp-ingest-service jobs
class BatchApiClient
extend ServiceAccountManager
Expand Down
11 changes: 9 additions & 2 deletions bin/docker-compose-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ $0 [OPTION]
-i {IMAGE_TAG} override default GCR image tag of development
-p {PORTAL_RAM_GB} specify as integer the amount of RAM in GB for the single_cell container
-v {VITE_RAM_GB} specify as integer the amount of RAM in GB for the single_cell_vite container
-l use a local copy of GCR_IMAGE (for testing build updates)
-h print this text
EOF
)

DETACHED=""
VITE_FRONTEND_SERVICE_WORKER_CACHE="false"
IMAGE_TAG="development"
LOCAL="false"
export PORTAL_RAM_GB="6"
export VITE_RAM_GB="2"
while getopts "dchi:p:v:" OPTION; do
while getopts "dchi:p:v:l" OPTION; do
case $OPTION in
d)
echo "### SETTING DETACHED ###"
Expand All @@ -48,6 +50,9 @@ case $OPTION in
echo "### SETTING VITE_RAM_GB TO $OPTARG ###"
VITE_RAM_GB="$OPTARG"
;;
l)
LOCAL="true"
;;
*)
echo "unrecognized option"
echo "$usage"
Expand All @@ -66,9 +71,11 @@ CHANGED=$(git diff "$LOCAL_BRANCH" development --name-only -- Dockerfile)
if [[ "$CHANGED" = "Dockerfile" ]]; then
echo "### DOCKERFILE CHANGES DETECTED, BUILDING $GCR_IMAGE LOCALLY ###"
docker build -t "$GCR_IMAGE" .
else
elif [[ "$LOCAL" = "false" ]]; then
echo "### PULLING UPDATED IMAGE FOR $GCR_IMAGE ###"
docker pull "$GCR_IMAGE"
else
echo "### USING LOCAL COPY OF $GCR_IMAGE ###"
fi
echo "### STARTING SERVICES ###"
VITE_FRONTEND_SERVICE_WORKER_CACHE="$VITE_FRONTEND_SERVICE_WORKER_CACHE" \
Expand Down
24 changes: 1 addition & 23 deletions bin/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,8 @@ RETURN_CODE=0
THIS_DIR="$(cd "$(dirname "$BASH_SOURCE")"; pwd)"
BASE_DIR="$(dirname $THIS_DIR)"

function setup_burp_cert {
if [ -n "$BURP_PROXY" ]; then
# we will store Burp certificate here
local BURP_CERT="/usr/local/share/ca-certificates/burp.crt"

# fetch Burp certificate from Burp proxy localhost endpoint and store it into $BURP_CERT
curl -s --proxy "$BURP_PROXY" burp/cert | openssl x509 -inform DER -out "$BURP_CERT"

# update system-wide certificate store
update-ca-certificates

# override cacert store for httpclient package (used by Google libraries)
ln -sf "$BURP_CERT" /usr/local/rvm/gems/default/gems/httpclient-*/lib/httpclient/cacert.pem

# override cafile for Yarn (used during package fetching)
yarn config set cafile "$BURP_CERT" -g

# set http_proxy variable, which will make HTTP connections go through the Burp proxy
export http_proxy="$BURP_PROXY"
fi
}

export PASSENGER_APP_ENV=test
export RUBYOPT=--disable-frozen-string-literal

function clean_up {
echo "Cleaning up..."
Expand Down Expand Up @@ -90,7 +69,6 @@ else
rm -f "$TMP_PIDS_DIR/delayed_job.*.pid"
fi

setup_burp_cert
clean_up

echo "*** STARTING DELAYED_JOB for $PASSENGER_APP_ENV env ***"
Expand Down
Loading