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

Conversation

bistline
Copy link
Contributor

@bistline bistline commented Mar 13, 2025

BACKGROUND & CHANGES

This updates to single-cell-portal/rails-baseimage:3.0.0 which includes the following updates:

  • Ubuntu 24.04 operating system
  • Ruby 3.4.2
    • Various gem updates to deal with deprecations or removal from stdlib
  • Passenger 6.0.2
  • Nginx 1.24
  • Normal security patches/updates

Most importantly, this gets our Docker image current with the latest release in phusion/passenger-docker and allows us to update Ruby, Passenger and Nginx on a more regular basis.

MANUAL TESTING

This PR will run normal CI to confirm usage while running inside Docker, so testing for native local development is likely all that is required for reviewers. Since we rarely run local development inside Docker, it is not strictly necessary to test this, but instructions are included below should you wish to verify both.

For native local development:

  1. Install Ruby 3.4.2
    • If you see e.g. ruby-build: definition not found: 3.4.2, do as message instructs and run brew upgrade ruby-build
    • If using rbenv, this is done with rbenv install 3.4.2 - note this takes ~10 min
    • Once completed, make sure you have it loaded with rbenv shell 3.4.2, or globally with rbenv global 3.4.2
  2. Initialize your dev environment as usual and run bundle install
    • If you encounter installation errors with gems such as sassc, bootstrap-sass, or unf_ext, you may need to reinstall both your Xcode command line tools and Ruby 3.4.2. This can be done by first requesting admin access and then running the following (this can take longer than 15 min to complete - if you admin session expires, the installation will continue):
    sudo rm -rf /Library/Developer/CommandLineTools
    xcode-select --install
    
  3. Once all necessary gems are installed, boot your server as normal and verify normal usage is unaffected.
  4. Note: if you see lots of messages like warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information), you can disable these by rebooting your server and prepending RUBYOPT=--disable-frozen-string-literal to the rails s command.

To test inside Docker:

  1. Start Docker Desktop and build a local version of the portal Docker image from the project root:
REPO='gcr.io'                             
PROJECT='broad-singlecellportal-staging'
IMAGE='single-cell-portal'
IMAGE_NAME="$REPO/$PROJECT/$IMAGE"
VERSION_TAG='development'
docker build -t $IMAGE_NAME:$VERSION_TAG .
  1. Once the build completes, run the startup script to boot via docker-compose using the new -l flag to denote the locally built image:
bin/docker-compose-setup.sh -l
  1. Confirm the portal boots and normal usage is unaffected

@bistline bistline requested review from eweitz and jlchang March 13, 2025 19:57
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.60%. Comparing base (734ccf9) to head (cd7b8a9).
Report is 12 commits behind head on development.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #2221      +/-   ##
===============================================
+ Coverage        70.51%   70.60%   +0.08%     
===============================================
  Files              332      331       -1     
  Lines            28493    28290     -203     
  Branches          2518     2518              
===============================================
- Hits             20092    19974     -118     
+ Misses            8254     8169      -85     
  Partials           147      147              
Files with missing lines Coverage Δ
app/models/batch_api_client.rb 85.22% <ø> (+0.08%) ⬆️

... and 63 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bistline
Copy link
Contributor Author

There are likely some missing dependencies still, so this shouldn't merge until I can identify them. Also, I just realized another downside to scheduled instances - we can't run CI after hours. Not a big deal, but something to consider.

@bistline
Copy link
Contributor Author

@eweitz @jlchang OK all the regressions/dependencies have been updated, this is ready for review. Most of the updates are test regressions due to minitest changing how mock.expect deals with keyword arguments.

Copy link
Contributor

@jlchang jlchang left a comment

Choose a reason for hiding this comment

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

Functional review. Installed Ruby 3.4.2 and verified that my local instance works as expected.

Copy link
Member

@eweitz eweitz left a comment

Choose a reason for hiding this comment

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

Looks good! I updated locally; more notes here.

@bistline bistline merged commit 097b7b3 into development Mar 20, 2025
5 checks passed
@github-actions github-actions bot deleted the jb-rails-baseimage-3.0 branch March 20, 2025 18:50
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