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:
parent
dbda82ac9b
commit
185b7b7162
@ -3,8 +3,11 @@
|
|||||||
- Improved display of the icons alerting about an outdated version
|
- Improved display of the icons alerting about an outdated version
|
||||||
- Improved mime-type checking (back & front)
|
- Improved mime-type checking (back & front)
|
||||||
- Updated CarrierWave to 2.1.0
|
- 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
|
- 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] `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
|
## v4.4.4 2020 May 25
|
||||||
|
|
||||||
|
4
Gemfile
4
Gemfile
@ -96,9 +96,7 @@ gem 'friendly_id', '~> 5.1.0'
|
|||||||
gem 'aasm'
|
gem 'aasm'
|
||||||
|
|
||||||
# Background job processing
|
# Background job processing
|
||||||
gem 'redis-namespace'
|
gem 'sidekiq', '>= 6.0.7'
|
||||||
gem 'sidekiq', '>= 3.4.2'
|
|
||||||
gem 'sinatra', require: false
|
|
||||||
# Recurring jobs for Sidekiq
|
# Recurring jobs for Sidekiq
|
||||||
gem 'sidekiq-cron'
|
gem 'sidekiq-cron'
|
||||||
|
|
||||||
|
28
Gemfile.lock
28
Gemfile.lock
@ -116,7 +116,7 @@ GEM
|
|||||||
sass-rails (< 5.1)
|
sass-rails (< 5.1)
|
||||||
sprockets (< 4.0)
|
sprockets (< 4.0)
|
||||||
concurrent-ruby (1.1.6)
|
concurrent-ruby (1.1.6)
|
||||||
connection_pool (2.2.2)
|
connection_pool (2.2.3)
|
||||||
coveralls (0.8.23)
|
coveralls (0.8.23)
|
||||||
json (>= 1.8, < 3)
|
json (>= 1.8, < 3)
|
||||||
simplecov (~> 0.16.1)
|
simplecov (~> 0.16.1)
|
||||||
@ -250,8 +250,6 @@ GEM
|
|||||||
multi_json (1.14.1)
|
multi_json (1.14.1)
|
||||||
multi_xml (0.6.0)
|
multi_xml (0.6.0)
|
||||||
multipart-post (2.1.1)
|
multipart-post (2.1.1)
|
||||||
mustermann (1.1.1)
|
|
||||||
ruby2_keywords (~> 0.0.1)
|
|
||||||
nio4r (2.5.2)
|
nio4r (2.5.2)
|
||||||
nokogiri (1.10.9)
|
nokogiri (1.10.9)
|
||||||
mini_portile2 (~> 2.4.0)
|
mini_portile2 (~> 2.4.0)
|
||||||
@ -347,9 +345,7 @@ GEM
|
|||||||
recurrence (1.3.0)
|
recurrence (1.3.0)
|
||||||
activesupport
|
activesupport
|
||||||
i18n
|
i18n
|
||||||
redis (4.1.3)
|
redis (4.1.4)
|
||||||
redis-namespace (1.6.0)
|
|
||||||
redis (>= 3.0.4)
|
|
||||||
repost (0.3.2)
|
repost (0.3.2)
|
||||||
responders (2.4.1)
|
responders (2.4.1)
|
||||||
actionpack (>= 4.2.0, < 6.0)
|
actionpack (>= 4.2.0, < 6.0)
|
||||||
@ -367,7 +363,6 @@ GEM
|
|||||||
ruby-rc4 (0.1.5)
|
ruby-rc4 (0.1.5)
|
||||||
ruby-vips (2.0.17)
|
ruby-vips (2.0.17)
|
||||||
ffi (~> 1.9)
|
ffi (~> 1.9)
|
||||||
ruby2_keywords (0.0.2)
|
|
||||||
rubyzip (1.3.0)
|
rubyzip (1.3.0)
|
||||||
safe_yaml (1.0.5)
|
safe_yaml (1.0.5)
|
||||||
sass (3.4.25)
|
sass (3.4.25)
|
||||||
@ -386,11 +381,11 @@ GEM
|
|||||||
activerecord (>= 4)
|
activerecord (>= 4)
|
||||||
activesupport (>= 4)
|
activesupport (>= 4)
|
||||||
sha3 (1.0.1)
|
sha3 (1.0.1)
|
||||||
sidekiq (5.2.7)
|
sidekiq (6.0.7)
|
||||||
connection_pool (~> 2.2, >= 2.2.2)
|
connection_pool (>= 2.2.2)
|
||||||
rack (>= 1.5.0)
|
rack (~> 2.0)
|
||||||
rack-protection (>= 1.5.0)
|
rack-protection (>= 2.0.0)
|
||||||
redis (>= 3.3.5, < 5)
|
redis (>= 4.1.0)
|
||||||
sidekiq-cron (1.1.0)
|
sidekiq-cron (1.1.0)
|
||||||
fugit (~> 1.1)
|
fugit (~> 1.1)
|
||||||
sidekiq (>= 4.2.1)
|
sidekiq (>= 4.2.1)
|
||||||
@ -399,11 +394,6 @@ GEM
|
|||||||
json (>= 1.8, < 3)
|
json (>= 1.8, < 3)
|
||||||
simplecov-html (~> 0.10.0)
|
simplecov-html (~> 0.10.0)
|
||||||
simplecov-html (0.10.2)
|
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)
|
spring (2.0.2)
|
||||||
activesupport (>= 4.2)
|
activesupport (>= 4.2)
|
||||||
spring-watcher-listen (2.0.1)
|
spring-watcher-listen (2.0.1)
|
||||||
@ -516,7 +506,6 @@ DEPENDENCIES
|
|||||||
rails_12factor
|
rails_12factor
|
||||||
rb-readline
|
rb-readline
|
||||||
recurrence
|
recurrence
|
||||||
redis-namespace
|
|
||||||
repost
|
repost
|
||||||
responders (~> 2.0)
|
responders (~> 2.0)
|
||||||
rolify
|
rolify
|
||||||
@ -526,9 +515,8 @@ DEPENDENCIES
|
|||||||
sdoc (~> 0.4.0)
|
sdoc (~> 0.4.0)
|
||||||
seed_dump
|
seed_dump
|
||||||
sha3
|
sha3
|
||||||
sidekiq (>= 3.4.2)
|
sidekiq (>= 6.0.7)
|
||||||
sidekiq-cron
|
sidekiq-cron
|
||||||
sinatra
|
|
||||||
spring
|
spring
|
||||||
spring-watcher-listen (~> 2.0.0)
|
spring-watcher-listen (~> 2.0.0)
|
||||||
stripe (= 5.1.1)
|
stripe (= 5.1.1)
|
||||||
|
@ -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+
|
- Ubuntu LTS 14.04+ / Debian 8+
|
||||||
- Ruby 2.6
|
- Ruby 2.6
|
||||||
- Redis 2.8.4+
|
- Redis 6
|
||||||
- Sidekiq 3.3.4+
|
- Sidekiq 6
|
||||||
- Elasticsearch 5.6
|
- Elasticsearch 5.6
|
||||||
- PostgreSQL 9.6
|
- PostgreSQL 9.6
|
||||||
|
|
||||||
|
@ -1,16 +1,10 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
namespace = if Rails.env.staging?
|
|
||||||
'fablab_staging'
|
|
||||||
else
|
|
||||||
'fablab'
|
|
||||||
end
|
|
||||||
|
|
||||||
redis_host = ENV['REDIS_HOST'] || 'localhost'
|
redis_host = ENV['REDIS_HOST'] || 'localhost'
|
||||||
redis_url = "redis://#{redis_host}:6379"
|
redis_url = "redis://#{redis_host}:6379"
|
||||||
|
|
||||||
Sidekiq.configure_server do |config|
|
Sidekiq.configure_server do |config|
|
||||||
config.redis = { url: redis_url, namespace: namespace }
|
config.redis = { url: redis_url }
|
||||||
|
|
||||||
# load sidekiq-cron schedule config
|
# load sidekiq-cron schedule config
|
||||||
schedule_file = 'config/schedule.yml'
|
schedule_file = 'config/schedule.yml'
|
||||||
@ -22,7 +16,7 @@ Sidekiq.configure_server do |config|
|
|||||||
end
|
end
|
||||||
|
|
||||||
Sidekiq.configure_client do |config|
|
Sidekiq.configure_client do |config|
|
||||||
config.redis = { url: redis_url, namespace: namespace }
|
config.redis = { url: redis_url }
|
||||||
end
|
end
|
||||||
|
|
||||||
Sidekiq::Extensions.enable_delay!
|
Sidekiq::Extensions.enable_delay!
|
||||||
|
@ -52,7 +52,7 @@ services:
|
|||||||
# - "5601:5601"
|
# - "5601:5601"
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:5
|
image: redis:6-alpine
|
||||||
volumes:
|
volumes:
|
||||||
- ${PWD}/redis:/data
|
- ${PWD}/redis:/data
|
||||||
restart: always
|
restart: always
|
||||||
|
86
scripts/redis-upgrade.sh
Executable file
86
scripts/redis-upgrade.sh
Executable 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 "$@"
|
@ -44,7 +44,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:3.0
|
image: redis:6-alpine
|
||||||
volumes:
|
volumes:
|
||||||
- ${PWD}/redis:/data
|
- ${PWD}/redis:/data
|
||||||
restart: always
|
restart: always
|
||||||
|
Loading…
x
Reference in New Issue
Block a user