1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

updated sidekiq & redis to v6

This commit is contained in:
Sylvain 2020-06-09 16:23:07 +02:00
parent dbda82ac9b
commit 185b7b7162
8 changed files with 104 additions and 35 deletions

View File

@ -3,8 +3,11 @@
- Improved display of the icons alerting about an outdated version
- Improved mime-type checking (back & front)
- Updated CarrierWave to 2.1.0
- Updated redis to v6, with alpine image
- Updated Sidekiq to 6.0.7
- Fix a bug: managers do not see the name of the user who reserved a slot
- [TODO DEPLOY] `rails fablab:setup:env_to_db`
- [TODO DEPLOY] `\curl -sSL https://raw.githubusercontent.com/sleede/fab-manager/master/scripts/redis-upgrade.sh | bash`
## v4.4.4 2020 May 25

View File

@ -96,9 +96,7 @@ gem 'friendly_id', '~> 5.1.0'
gem 'aasm'
# Background job processing
gem 'redis-namespace'
gem 'sidekiq', '>= 3.4.2'
gem 'sinatra', require: false
gem 'sidekiq', '>= 6.0.7'
# Recurring jobs for Sidekiq
gem 'sidekiq-cron'

View File

@ -116,7 +116,7 @@ GEM
sass-rails (< 5.1)
sprockets (< 4.0)
concurrent-ruby (1.1.6)
connection_pool (2.2.2)
connection_pool (2.2.3)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
@ -250,8 +250,6 @@ GEM
multi_json (1.14.1)
multi_xml (0.6.0)
multipart-post (2.1.1)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
nio4r (2.5.2)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
@ -347,9 +345,7 @@ GEM
recurrence (1.3.0)
activesupport
i18n
redis (4.1.3)
redis-namespace (1.6.0)
redis (>= 3.0.4)
redis (4.1.4)
repost (0.3.2)
responders (2.4.1)
actionpack (>= 4.2.0, < 6.0)
@ -367,7 +363,6 @@ GEM
ruby-rc4 (0.1.5)
ruby-vips (2.0.17)
ffi (~> 1.9)
ruby2_keywords (0.0.2)
rubyzip (1.3.0)
safe_yaml (1.0.5)
sass (3.4.25)
@ -386,11 +381,11 @@ GEM
activerecord (>= 4)
activesupport (>= 4)
sha3 (1.0.1)
sidekiq (5.2.7)
connection_pool (~> 2.2, >= 2.2.2)
rack (>= 1.5.0)
rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5)
sidekiq (6.0.7)
connection_pool (>= 2.2.2)
rack (~> 2.0)
rack-protection (>= 2.0.0)
redis (>= 4.1.0)
sidekiq-cron (1.1.0)
fugit (~> 1.1)
sidekiq (>= 4.2.1)
@ -399,11 +394,6 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
sinatra (2.0.8.1)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.8.1)
tilt (~> 2.0)
spring (2.0.2)
activesupport (>= 4.2)
spring-watcher-listen (2.0.1)
@ -516,7 +506,6 @@ DEPENDENCIES
rails_12factor
rb-readline
recurrence
redis-namespace
repost
responders (~> 2.0)
rolify
@ -526,9 +515,8 @@ DEPENDENCIES
sdoc (~> 0.4.0)
seed_dump
sha3
sidekiq (>= 3.4.2)
sidekiq (>= 6.0.7)
sidekiq-cron
sinatra
spring
spring-watcher-listen (~> 2.0.0)
stripe (= 5.1.1)

View File

@ -28,8 +28,8 @@ Fab-manager is a Ruby on Rails / AngularJS web application that runs on the foll
- Ubuntu LTS 14.04+ / Debian 8+
- Ruby 2.6
- Redis 2.8.4+
- Sidekiq 3.3.4+
- Redis 6
- Sidekiq 6
- Elasticsearch 5.6
- PostgreSQL 9.6

View File

@ -1,16 +1,10 @@
# frozen_string_literal: true
namespace = if Rails.env.staging?
'fablab_staging'
else
'fablab'
end
redis_host = ENV['REDIS_HOST'] || 'localhost'
redis_url = "redis://#{redis_host}:6379"
Sidekiq.configure_server do |config|
config.redis = { url: redis_url, namespace: namespace }
config.redis = { url: redis_url }
# load sidekiq-cron schedule config
schedule_file = 'config/schedule.yml'
@ -22,7 +16,7 @@ Sidekiq.configure_server do |config|
end
Sidekiq.configure_client do |config|
config.redis = { url: redis_url, namespace: namespace }
config.redis = { url: redis_url }
end
Sidekiq::Extensions.enable_delay!

View File

@ -52,7 +52,7 @@ services:
# - "5601:5601"
redis:
image: redis:5
image: redis:6-alpine
volumes:
- ${PWD}/redis:/data
restart: always

86
scripts/redis-upgrade.sh Executable file
View File

@ -0,0 +1,86 @@
#!/usr/bin/env bash
config()
{
if [ "$(whoami)" = "root" ]
then
echo "It is not recommended to run this script as root. As a normal user, elevation will be prompted if needed."
read -rp "Continue anyway? (Y/n) " confirm </dev/tty
if [[ "$confirm" = "n" ]]; then exit 1; fi
else
if ! groups | grep docker; then
echo "Please add your current user to the docker group."
echo "You can run the following as root: \"usermod -aG docker $(whoami)\", then logout and login again"
echo "current user is not allowed to use docker, exiting..."
exit 1
fi
fi
FM_PATH=$(pwd)
TYPE="NOT-FOUND"
read -rp "Is Fab-manager installed at \"$FM_PATH\"? (y/N) " confirm </dev/tty
if [ "$confirm" = "y" ]; then
test_docker_compose
if [[ "$TYPE" = "NOT-FOUND" ]]
then
echo "Redis was not found on the current system, exiting..."
exit 2
fi
else
echo "Please run this script from the Fab-manager's installation folder"
exit 1
fi
}
test_docker_compose()
{
if [[ -f "$FM_PATH/docker-compose.yml" ]]
then
docker-compose ps | grep redis
if [[ $? = 0 ]]
then
TYPE="DOCKER-COMPOSE"
fi
fi
}
yq() {
docker run --rm -i -v "${FM_PATH}:/workdir" mikefarah/yq yq "$@"
}
docker_down()
{
docker-compose down
}
proceed_upgrade()
{
yq w -i docker-compose.yml services.redis.image redis:6-alpine
}
docker_up()
{
docker-compose pull redis
docker-compose up -d
}
function trap_ctrlc()
{
echo "Ctrl^C, exiting..."
exit 2
}
upgrade_redis()
{
config
read -rp "Continue with upgrading? (y/N) " confirm </dev/tty
if [[ "$confirm" = "y" ]]; then
trap "trap_ctrlc" 2 # SIGINT
docker_down
proceed_upgrade
docker_up
fi
}
upgrade_redis "$@"

View File

@ -44,7 +44,7 @@ services:
restart: always
redis:
image: redis:3.0
image: redis:6-alpine
volumes:
- ${PWD}/redis:/data
restart: always