diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9d84bca..d33c798 100755 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,10 +51,10 @@ jobs: AWS_REGION: ${{ secrets.AWS_REGION }} steps: - uses: actions/checkout@v3 - - name: Set up Ruby 2.6 + - name: Set up Ruby 3.1.4 uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6 + ruby-version: 3.1.4 - uses: actions/cache@v3 with: path: vendor/bundle @@ -66,8 +66,8 @@ jobs: MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} run: | cp .env.build .env - gem install rubygems-update -v 3.4.22 - gem install bundler:2.4.20 + gem install rubygems-update -v 3.5.6 + gem install bundler:2.5.6 bundle config path vendor/bundle bundle install --jobs 4 --retry 3 sudo /etc/init.d/mysql start diff --git a/Dockerfile b/Dockerfile index 0f13bf8..62c6464 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM phusion/passenger-full:2.1.0 +FROM phusion/passenger-full:2.5.1 LABEL maintainer="kgarza@datacite.org" LABEL maintainer_name="Kristian Garza" @@ -13,8 +13,8 @@ RUN usermod -a -G docker_env app # Use baseimage-docker's init process. CMD ["/sbin/my_init"] -# Install Ruby 2.6.9 -RUN bash -lc 'rvm --default use ruby-2.6.9' +# Install Ruby 3.1.4 +RUN bash -lc 'rvm --default use ruby-3.1.4' # Update installed APT packages RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold" && \ @@ -46,8 +46,8 @@ RUN mkdir -p /home/app/webapp/tmp/pids && \ # Install Ruby gems WORKDIR /home/app/webapp -RUN gem install rubygems-update -v 3.4.22 && \ - gem install bundler:2.4.20 && \ +RUN gem install rubygems-update -v 3.5.6 && \ + gem install bundler:2.5.6 && \ /sbin/setuser app bundle config set --local path 'vendor/bundle' && \ /sbin/setuser app bundle install diff --git a/Gemfile b/Gemfile index fbba1e8..0febcb6 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ gem 'equivalent-xml', '~> 0.6.0' gem 'nokogiri', '~> 1.13.6' gem 'iso8601', '~> 0.12.1' gem 'maremma', '~> 4.9.6' -gem "dalli", "~> 2.7.6" +gem "dalli", "~> 3.2", ">= 3.2.8" gem "lograge", "~> 0.11.2" gem "logstash-event", "~> 1.2", ">= 1.2.02" gem "logstash-logger", "~> 0.26.1" @@ -29,7 +29,6 @@ gem 'shoryuken', '~> 3.2', '>= 3.2.2' gem "aws-sdk-s3", require: false gem 'aws-sdk-sqs', '~> 1.22' gem 'iso_country_codes' -# gem "rack-timeout" gem 'sentry-raven', '~> 2.9' gem 'git', '~> 1.5' gem "sprockets", "~> 3.7", ">= 3.7.2" @@ -41,7 +40,6 @@ group :development, :test do gem 'rubocop', '~> 0.77.0' gem 'rubocop-performance', '~> 1.5', '>= 1.5.1' gem 'rubocop-rails', '~> 2.4' - #gem "better_errors" gem "binding_of_caller" gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end diff --git a/Gemfile.lock b/Gemfile.lock index 33b2ea1..148550a 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,7 +88,8 @@ GEM aws-sigv4 (~> 1.1) aws-sigv4 (1.5.1) aws-eventstream (~> 1, >= 1.0.2) - base32-url (0.5) + base32-url (0.7.0) + uuidtools (~> 2.1, >= 2.1.5) bcrypt (3.1.18) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) @@ -115,7 +116,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - dalli (2.7.11) + dalli (3.2.8) database_cleaner (2.0.1) database_cleaner-active_record (~> 2.0.0) database_cleaner-active_record (2.0.1) @@ -182,10 +183,9 @@ GEM mime-types mimemagic (~> 0.3.0) terrapin (~> 0.6.0) - listen (3.1.5) + listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) lograge (0.11.2) actionpack (>= 4) activesupport (>= 4) @@ -310,7 +310,6 @@ GEM rubocop-rspec (1.41.0) rubocop (>= 0.68.1) ruby-progressbar (1.11.0) - ruby_dep (1.5.0) sentry-raven (2.13.0) faraday (>= 0.7.6, < 1.0) shoryuken (3.3.1) @@ -342,6 +341,7 @@ GEM tzinfo (2.0.5) concurrent-ruby (~> 1.0) unicode-display_width (1.6.1) + uuidtools (2.2.0) vcr (3.0.3) webmock (3.17.1) addressable (>= 2.8.0) @@ -370,7 +370,7 @@ DEPENDENCIES cancancan (~> 3.0) capybara codeclimate-test-reporter (~> 1.0.0) - dalli (~> 2.7.6) + dalli (~> 3.2, >= 3.2.8) database_cleaner dotenv equivalent-xml (~> 0.6.0) @@ -414,4 +414,4 @@ DEPENDENCIES webmock (~> 3.1) BUNDLED WITH - 2.3.10 + 2.5.6 \ No newline at end of file diff --git a/app/models/heartbeat.rb b/app/models/heartbeat.rb index 1ef0c6e..fff78b3 100644 --- a/app/models/heartbeat.rb +++ b/app/models/heartbeat.rb @@ -19,7 +19,7 @@ def services_up? def memcached_up? host = ENV["MEMCACHE_SERVERS"] - memcached_client = Dalli::Client.new("#{host}:11211") + memcached_client = Dalli::Client.new(ENV["MEMCACHE_SERVERS"]) memcached_client.alive! true rescue diff --git a/bin/setup b/bin/setup index 104e40c..3a00b1e 100755 --- a/bin/setup +++ b/bin/setup @@ -15,7 +15,7 @@ chdir APP_ROOT do # Add necessary setup steps to this file. puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' + system! 'gem install bundler -v 2.5.6 --conservative' system('bundle check') || system!('bundle install') diff --git a/bin/update b/bin/update index a8e4462..0b5e7a4 100755 --- a/bin/update +++ b/bin/update @@ -15,7 +15,7 @@ chdir APP_ROOT do # Add necessary update steps to this file. puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' + system! 'gem install bundler -v 2.5.6 --conservative' system('bundle check') || system!('bundle install') puts "\n== Updating database ==" diff --git a/config/application.rb b/config/application.rb index 55e3930..0e98663 100644 --- a/config/application.rb +++ b/config/application.rb @@ -91,7 +91,7 @@ class Application < Rails::Application end # configure caching - config.cache_store = :dalli_store, nil, { :namespace => ENV['APPLICATION'] } + config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"], { namespace: ENV["APPLICATION"] } # raise error with unpermitted parameters config.action_controller.action_on_unpermitted_parameters = :raise diff --git a/config/environments/development.rb b/config/environments/development.rb index 1eabffa..23ae1ea 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -28,7 +28,7 @@ # config.action_controller.perform_caching = true config.action_controller.perform_caching = true - config.cache_store = :dalli_store + config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"], { namespace: ENV["APPLICATION"] } HttpLog.configure do |config| config.enabled = false diff --git a/config/environments/test.rb b/config/environments/test.rb index 6b1f5bc..0620141 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -24,7 +24,7 @@ # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false - config.cache_store = :dalli_store + config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"], { namespace: ENV["APPLICATION"] } # Raise exceptions instead of rendering exception templates. diff --git a/docker-compose.local.yml b/docker-compose.local.yml new file mode 100644 index 0000000..8bb4319 --- /dev/null +++ b/docker-compose.local.yml @@ -0,0 +1,5 @@ +version: "2" + +services: + web: + build: .