Skip to content

Commit

Permalink
Revert "Use sidekiq as email delivery queue"
Browse files Browse the repository at this point in the history
  • Loading branch information
sandbergja authored and maxkadel committed Jan 14, 2025
1 parent bcab118 commit 0220cf1
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
type: postgres:15
portforward: true
orangelight_redis:
type: redis:7
type: redis:6.0.16
portforward: true
proxy:
orangelight_test_solr:
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ gem 'rsolr'
# Should this be in the test, development group?
gem 'rspec-rails'
gem 'rubyzip', '>= 1.2.2'
gem 'sidekiq'
gem 'simple_form'
gem 'sneakers'
gem 'sprockets-es6'
Expand Down
6 changes: 0 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -615,11 +615,6 @@ GEM
serverengine (2.0.7)
sigdump (~> 0.2.2)
set (1.1.1)
sidekiq (7.3.7)
connection_pool (>= 2.3.0)
logger
rack (>= 2.2.4)
redis-client (>= 0.22.2)
sigdump (0.2.5)
simple_form (5.3.1)
actionpack (>= 5.2)
Expand Down Expand Up @@ -831,7 +826,6 @@ DEPENDENCIES
rubocop-rspec_rails
rubyzip (>= 1.2.2)
selenium-webdriver
sidekiq
simple_form
sneakers
solargraph
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,15 @@ bundle exec cap staging deploy # deploys main branch to staging
```

## Staging Mail Catcher
To see mail that has been sent from the staging environment you must ssh tunnel into the staging indexer servers.
To see mail that has been sent on the staging server you must ssh tunnel into the server
```
ssh -L 1082:localhost:1080 pulsys@catalog-indexer-staging1
ssh -L 1085:localhost:1080 pulsys@catalog-indexer-staging2
ssh -L 1082:localhost:1080 pulsys@catalog-staging1
```
To see mail that has been sent on the qa server you must ssh tunnel into the server
```
ssh -L 1082:localhost:1080 pulsys@catalog-indexer-qa1
ssh -L 1085:localhost:1080 pulsys@catalog-indexer-qa2
ssh -L 1082:localhost:1080 pulsys@catalog-qa1
```
Once the tunnel is open [you can see the mail that has been sent on indexer1 here]( http://localhost:1082/) and [indexer2 here]( http://localhost:1085/)
Once the tunnel is open [you can see the mail that has been sent on staging here]( http://localhost:1082/)

## Testing

Expand Down Expand Up @@ -247,7 +245,6 @@ Start the Bibdata server, and then set the ```bidata_base``` value in OrangeLigh
```
run every time
```
bundle exec sidekiq -q default -q mailers
mailcatcher
```
Expand Down
2 changes: 0 additions & 2 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class Application < Rails::Application
# config.time_zone = 'Central Time (US & Canada)'
config.time_zone = 'Eastern Time (US & Canada)'

config.active_job.queue_adapter = :sidekiq

# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
Expand Down
12 changes: 2 additions & 10 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

set :branch, ENV.fetch('BRANCH', 'main')

# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call

# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/opt/orangelight'
Expand Down Expand Up @@ -157,15 +159,5 @@
end
end

namespace :sidekiq do
task :restart do
on roles(:indexer) do
execute :sudo, :service, :sidekiq, :restart
end
end
end

after 'deploy:reverted', 'sneakers:restart'
after 'deploy:published', 'sneakers:restart'
after 'deploy:reverted', 'sidekiq:restart'
after 'deploy:published', 'sidekiq:restart'
6 changes: 3 additions & 3 deletions config/deploy/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
server 'catalog3', user: 'deploy', roles: %i[web app db worker]
server 'catalog4', user: 'deploy', roles: %i[web app db worker]
server 'catalog5', user: 'deploy', roles: %i[web app db worker]
server 'catalog-indexer1', user: 'deploy', roles: %i[cron_prod1 cron_db worker indexer]
server 'catalog-indexer2', user: 'deploy', roles: %i[cron_prod2 worker indexer]
server 'catalog-indexer3', user: 'deploy', roles: %i[cron_prod3 worker indexer]
server 'catalog-indexer1', user: 'deploy', roles: %i[cron_prod1 cron_db worker]
server 'catalog-indexer2', user: 'deploy', roles: %i[cron_prod2 worker]
server 'catalog-indexer3', user: 'deploy', roles: %i[cron_prod3 worker]

set :deploy_to, '/opt/orangelight'
set :log_level, :info
4 changes: 2 additions & 2 deletions config/deploy/qa.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

server 'catalog-qa1.princeton.edu', user: 'deploy', roles: %i[web app db worker mailcatcher]
server 'catalog-qa2.princeton.edu', user: 'deploy', roles: %i[web app db worker mailcatcher cron_db]
server 'catalog-indexer-qa1', user: 'deploy', roles: %i[worker indexer]
server 'catalog-indexer-qa2', user: 'deploy', roles: %i[cron_db worker indexer]
server 'catalog-indexer-qa1', user: 'deploy', roles: %i[worker]
server 'catalog-indexer-qa2', user: 'deploy', roles: %i[cron_db worker]

namespace :env do
desc 'Set an Orangelight environment variable'
Expand Down
4 changes: 2 additions & 2 deletions config/deploy/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

server 'catalog-staging1', user: 'deploy', roles: %i[web app db worker mailcatcher cron_db]
server 'catalog-staging2', user: 'deploy', roles: %i[web app worker mailcatcher]
server 'catalog-indexer-staging1', user: 'deploy', roles: %i[cron_db worker indexer]
server 'catalog-indexer-staging2', user: 'deploy', roles: %i[cron_db worker indexer]
server 'catalog-indexer-staging1', user: 'deploy', roles: %i[cron_db worker]
server 'catalog-indexer-staging2', user: 'deploy', roles: %i[cron_db worker]

namespace :env do
desc 'Set an Orangelight environment variable'
Expand Down
18 changes: 0 additions & 18 deletions config/initializers/sidekiq.rb

This file was deleted.

6 changes: 0 additions & 6 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'sidekiq/web'

Rails.application.routes.draw do
scope module: 'orangelight' do
get 'browse', to: 'browsables#browse'
Expand Down Expand Up @@ -67,10 +65,6 @@
get "sign_out", to: "sessions#destroy"
end

authenticate :user, ->(user) { user.admin? } do
mount Sidekiq::Web => '/sidekiq'
end

get '/catalog/oclc/:id', to: 'catalog#oclc'
get '/catalog/isbn/:id', to: 'catalog#isbn'
get '/catalog/lccn/:id', to: 'catalog#lccn'
Expand Down
18 changes: 0 additions & 18 deletions spec/requests/sidekiq_spec.rb

This file was deleted.

0 comments on commit 0220cf1

Please sign in to comment.