From cb683e774d976356ddc7e9fb70367808f56e15ca Mon Sep 17 00:00:00 2001 From: Max Kadel Date: Wed, 27 Mar 2024 11:43:44 -0400 Subject: [PATCH] Upgrade Sidekiq and Sidekiq-pro --- .circleci/config.yml | 2 +- .lando.yml | 2 +- Gemfile | 4 ++-- Gemfile.lock | 22 ++++++++++++---------- config/initializers/sidekiq.rb | 10 +++++----- config/redis.yml | 1 + 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c029d6d5..fb2de2d74 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -106,7 +106,7 @@ jobs: POSTGRES_USER: bibdata POSTGRES_DB: bibdata_test POSTGRES_HOST_AUTH_METHOD: trust - - image: redis:4.0.9-alpine + - image: cimg/redis:7.2 - image: pulibrary/ci-solr:8.4-v2.0.0 command: server/scripts/ci-start.sh diff --git a/.lando.yml b/.lando.yml index ab97aecd6..d4ef8b879 100644 --- a/.lando.yml +++ b/.lando.yml @@ -17,7 +17,7 @@ services: type: postgres:13 portforward: true bibdata_redis: - type: redis:4.0.9 + type: redis:7 portforward: true proxy: bibdata_test_solr: diff --git a/Gemfile b/Gemfile index 000a20c64..d44e885b8 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' source "https://gems.contribsys.com/" do - gem 'sidekiq-pro', '5.5.5' + gem 'sidekiq-pro' end gem 'alma', github: 'tulibraries/alma_rb', branch: 'main' @@ -59,7 +59,7 @@ gem 'rubyXL' gem 'rubyzip', '>= 1.2.2' gem 'sass-rails' gem 'selenium-webdriver' -gem 'sidekiq', '<7' +gem 'sidekiq' gem 'stomp' gem 'stringex', github: "pulibrary/stringex", tag: 'vpton.2.5.2.2' gem 'terser' diff --git a/Gemfile.lock b/Gemfile.lock index d36a6c0fb..2d5b65e8a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -50,8 +50,8 @@ GIT GEM remote: https://gems.contribsys.com/ specs: - sidekiq-pro (5.5.5) - sidekiq (~> 6.0, >= 6.5.6) + sidekiq-pro (7.2.0) + sidekiq (>= 7.2.0, < 8) GEM remote: https://rubygems.org/ @@ -419,7 +419,7 @@ GEM puma (5.6.8) nio4r (~> 2.0) racc (1.7.3) - rack (2.2.8.1) + rack (2.2.9) rack-conneg (0.1.6) rack (>= 1.0) rack-test (2.1.0) @@ -458,7 +458,8 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.1.0) - redis (4.8.1) + redis-client (0.21.1) + connection_pool regexp_parser (2.9.0) request_store (1.5.1) rack (>= 1.4) @@ -535,10 +536,11 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sidekiq (6.5.10) - connection_pool (>= 2.2.5, < 3) - rack (~> 2.0) - redis (>= 4.5.0, < 5) + sidekiq (7.2.2) + concurrent-ruby (< 2) + connection_pool (>= 2.3.0) + rack (>= 2.2.4) + redis-client (>= 0.19.0) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -709,8 +711,8 @@ DEPENDENCIES rubyzip (>= 1.2.2) sass-rails selenium-webdriver - sidekiq (< 7) - sidekiq-pro (= 5.5.5)! + sidekiq + sidekiq-pro! simplecov solargraph solr_wrapper diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 9666422ce..59ca82fa4 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,18 +1,18 @@ # frozen_string_literal: true -require "redis" +require "redis-client" # nosemgrep -redis_config = YAML.safe_load(ERB.new(File.read(Rails.root.join("config", "redis.yml"))).result, aliases: true)[Rails.env].with_indifferent_access -redis_client = Redis.new(redis_config.merge(thread_safe: true))._client +redis_config_from_yml = YAML.safe_load(ERB.new(File.read(Rails.root.join("config", "redis.yml"))).result, aliases: true)[Rails.env].with_indifferent_access +redis_config = RedisClient.config(host: redis_config_from_yml[:host], port: redis_config_from_yml[:port], db: redis_config_from_yml[:db]) Sidekiq::Client.reliable_push! unless Rails.env.test? Sidekiq.configure_server do |config| - config.redis = redis_client.options + config.redis = { url: redis_config.server_url } config.super_fetch! config.reliable_scheduler! end Sidekiq.configure_client do |config| - config.redis = redis_client.options + config.redis = { url: redis_config.server_url } end diff --git a/config/redis.yml b/config/redis.yml index 6b0686e55..36d361817 100644 --- a/config/redis.yml +++ b/config/redis.yml @@ -1,6 +1,7 @@ development: host: <%= ENV["lando_bibdata_redis_conn_host"] || "localhost" %> port: <%= ENV["lando_bibdata_redis_conn_port"] || 6379 %> + db: 1 test: host: <%= ENV["lando_bibdata_redis_conn_host"] || "localhost" %> port: <%= ENV["lando_bibdata_redis_conn_port"] || 6379 %>