Skip to content

Commit

Permalink
for #1193 - replace bluepill with eye
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinKo committed Nov 26, 2014
1 parent 1882cb7 commit a4338e8
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 139 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ gem 'premailer-rails' # creates emails with inline css from html files with exte

# ---------- Background Processing ----------

gem 'sidekiq'
gem 'sidekiq', '>= 3.2.5'
gem 'sinatra', '>= 1.3.0', :require => nil
gem 'delayed_paperclip' # handle image processing with sidekiq
gem 'bluepill' # sidekiq process monitoring
gem 'eye' # sidekiq process monitoring
gem 'sidetiq' # process scheduling

# ---------- Tools ----------
Expand Down
120 changes: 62 additions & 58 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,34 @@ GIT
GEM
remote: http://rubygems.org/
specs:
actionmailer (4.1.7)
actionpack (= 4.1.7)
actionview (= 4.1.7)
actionmailer (4.1.8)
actionpack (= 4.1.8)
actionview (= 4.1.8)
mail (~> 2.5, >= 2.5.4)
actionpack (4.1.7)
actionview (= 4.1.7)
activesupport (= 4.1.7)
actionpack (4.1.8)
actionview (= 4.1.8)
activesupport (= 4.1.8)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
actionview (4.1.7)
activesupport (= 4.1.7)
actionview (4.1.8)
activesupport (= 4.1.8)
builder (~> 3.1)
erubis (~> 2.7.0)
active_data (0.3.0)
activemodel
activesupport
activemodel (4.1.7)
activesupport (= 4.1.7)
activemodel (4.1.8)
activesupport (= 4.1.8)
builder (~> 3.1)
activerecord (4.1.7)
activemodel (= 4.1.7)
activesupport (= 4.1.7)
activerecord (4.1.8)
activemodel (= 4.1.8)
activesupport (= 4.1.8)
arel (~> 5.0.0)
activerecord-session_store (0.1.0)
actionpack (>= 4.0.0, < 5)
activerecord (>= 4.0.0, < 5)
railties (>= 4.0.0, < 5)
activesupport (4.1.7)
activesupport (4.1.8)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
Expand All @@ -81,13 +81,7 @@ GEM
rack (>= 0.9.0)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
blue-daemons (1.1.11)
bluecloth (2.2.0)
bluepill (0.0.69)
activesupport (>= 3, < 5)
blue-daemons (~> 1.1.11)
i18n (~> 0.5)
state_machine (~> 1.1)
bourbon (4.0.2)
sass (~> 3.3)
thor
Expand Down Expand Up @@ -132,9 +126,12 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
celluloid (0.16.0)
timers (~> 4.0.0)
chewy (0.6.0)
celluloid (0.15.2)
timers (~> 1.1.0)
celluloid-io (0.15.0)
celluloid (>= 0.15.0)
nio4r (>= 0.5.0)
chewy (0.6.1)
activesupport (>= 3.2)
elasticsearch (>= 1.0.0)
choice (0.1.6)
Expand Down Expand Up @@ -197,6 +194,12 @@ GEM
erubis (2.7.0)
eventmachine (1.0.3)
execjs (2.2.2)
eye (0.6.3)
celluloid (~> 0.15.0)
celluloid-io (~> 0.15.0)
sigar (~> 0.7.2)
state_machine
thor
factory_girl (4.5.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.5.0)
Expand All @@ -215,20 +218,19 @@ GEM
actionpack (>= 3.0)
friendly_id (5.0.4)
activerecord (>= 4.0.0)
gyoku (1.1.1)
gyoku (1.2.2)
builder (>= 2.1.2)
haml (4.0.5)
tilt
highline (1.6.21)
hike (1.2.3)
hirb (0.7.2)
hitimes (1.2.2)
hogan_assets (1.6.0)
execjs (>= 1.2.9)
sprockets (>= 2.0.3)
tilt (>= 1.3.3)
htmlentities (4.3.2)
httpi (2.2.7)
httpi (2.3.0)
rack
i18n (0.6.11)
i18n-js (2.1.2)
Expand All @@ -238,7 +240,7 @@ GEM
rest-client
ice_cube (0.11.1)
interception (0.5)
jbuilder (2.2.4)
jbuilder (2.2.5)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
jquery-rails (3.1.2)
Expand Down Expand Up @@ -278,9 +280,9 @@ GEM
railties (>= 3.0.0, < 5.0.0)
metaclass (0.0.4)
method_source (0.8.2)
mime-types (2.4.3)
mime-types (1.25.1)
mini_portile (0.6.1)
minitest (5.4.2)
minitest (5.4.3)
minitest-capybara (0.7.1)
capybara (~> 2.2)
minitest (~> 5.0)
Expand Down Expand Up @@ -318,7 +320,8 @@ GEM
net-ssh (>= 2.6.5)
net-ssh (2.9.1)
netrc (0.8.0)
newrelic_rpm (3.9.6.257)
newrelic_rpm (3.9.7.266)
nio4r (1.0.1)
nokogiri (1.6.4.1)
mini_portile (~> 0.6.0)
nokogumbo (1.1.12)
Expand Down Expand Up @@ -367,7 +370,7 @@ GEM
pry (>= 0.9.11)
pundit (0.3.0)
activesupport (>= 3.0.0)
qtip2-jquery-rails (2.1.107)
qtip2-jquery-rails (2.1.108)
railties (>= 3.1)
quiet_assets (1.0.3)
railties (>= 3.1, < 5.0)
Expand All @@ -384,15 +387,15 @@ GEM
rack-rewrite (1.5.0)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.1.7)
actionmailer (= 4.1.7)
actionpack (= 4.1.7)
actionview (= 4.1.7)
activemodel (= 4.1.7)
activerecord (= 4.1.7)
activesupport (= 4.1.7)
rails (4.1.8)
actionmailer (= 4.1.8)
actionpack (= 4.1.8)
actionview (= 4.1.8)
activemodel (= 4.1.8)
activerecord (= 4.1.8)
activesupport (= 4.1.8)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.7)
railties (= 4.1.8)
sprockets-rails (~> 2.0)
rails-erd (1.1.0)
activerecord (>= 3.0)
Expand Down Expand Up @@ -428,12 +431,12 @@ GEM
json
require_all
ruby-progressbar
railties (4.1.7)
actionpack (= 4.1.7)
activesupport (= 4.1.7)
railties (4.1.8)
actionpack (= 4.1.8)
activesupport (= 4.1.8)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.3.2)
rake (10.4.0)
recaptcha (0.3.6)
redis (3.1.0)
redis-namespace (1.5.1)
Expand All @@ -459,20 +462,20 @@ GEM
crass (~> 0.2.0)
nokogiri (>= 1.4.4)
nokogumbo (= 1.1.12)
sass (3.4.7)
sass (3.4.9)
sass-rails (4.0.1)
railties (>= 4.0.0, < 5.0)
sass (>= 3.1.10)
sprockets-rails (~> 2.0.0)
savon (2.7.2)
akami (~> 1.2.0)
savon (2.8.0)
akami (~> 1.2)
builder (>= 2.1.2)
gyoku (~> 1.1.0)
httpi (~> 2.2.3)
gyoku (~> 1.2)
httpi (~> 2.3)
nokogiri (>= 1.4.0)
nori (~> 2.4.0)
nori (~> 2.4)
uuid (~> 2.3.7)
wasabi (~> 3.3.0)
wasabi (= 3.3.0)
selectivizr-rails (1.1.2)
sexp_processor (4.4.4)
shoulda (3.5.0)
Expand All @@ -481,8 +484,8 @@ GEM
shoulda-context (1.2.1)
shoulda-matchers (2.7.0)
activesupport (>= 3.0.0)
sidekiq (3.3.0)
celluloid (>= 0.16.0)
sidekiq (3.2.6)
celluloid (= 0.15.2)
connection_pool (>= 2.0.0)
json
redis (>= 3.0.6)
Expand All @@ -491,6 +494,7 @@ GEM
celluloid (>= 0.14.1)
ice_cube (= 0.11.1)
sidekiq (>= 3.0.0)
sigar (0.7.3)
simplecov (0.9.1)
docile (~> 1.1.0)
multi_json (~> 1.0)
Expand All @@ -512,7 +516,7 @@ GEM
railties (>= 3.0, < 4.2)
slim (~> 2.0)
slop (3.6.0)
spring (1.1.3)
spring (1.2.0)
sprite-factory (1.6.1)
sprockets (2.11.0)
hike (~> 1.2)
Expand Down Expand Up @@ -549,8 +553,7 @@ GEM
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
timers (4.0.1)
hitimes
timers (1.1.0)
tins (1.3.3)
tinymce-rails (4.1.6)
railties (>= 3.1.1)
Expand All @@ -567,8 +570,9 @@ GEM
macaddr (~> 1.0)
warden (1.2.3)
rack (>= 1.0)
wasabi (3.3.1)
wasabi (3.3.0)
httpi (~> 2.0)
mime-types (< 2.0.0)
nokogiri (>= 1.4.0)
wiselinks (1.2.1)
xpath (2.0.0)
Expand All @@ -586,7 +590,6 @@ DEPENDENCIES
awesome_nested_set (>= 3.0.0.rc.4)
better_errors
binding_of_caller
bluepill
bourbon
brakeman
bullet
Expand All @@ -606,6 +609,7 @@ DEPENDENCIES
devise
email_spec
enumerize (>= 0.5.1)
eye
factory_girl_rails
fakeredis
fakeweb (~> 1.3)
Expand Down Expand Up @@ -671,7 +675,7 @@ DEPENDENCIES
savon
selectivizr-rails
shoulda
sidekiq
sidekiq (>= 3.2.5)
sidetiq
simplecov
simplecov-json
Expand Down
8 changes: 4 additions & 4 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
after :publishing, :restart


before :updated, 'bluepill:quiet'
after :published, 'bluepill:quit'
after :published, 'bluepill:init'
after :published, 'bluepill:start'
before :updated, 'eye:quiet'
after :published, 'eye:quit'
after :published, 'eye:init'
after :published, 'eye:start'

after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
Expand Down
33 changes: 33 additions & 0 deletions config/production.eye
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
rails_root = ENV['RAILS_ROOT'] || File.expand_path(".")
rails_env = ENV['RAILS_ENV'] || 'production'

# Eye self-configuration section
Eye.config do
logger "#{rails_root}/log/eye.log"
end

Eye.application 'fairmondo' do
working_dir = rails_root

group 'sidekiq' do
2.times do |i|
process "sidekiq#{i}" do

_pidfile = "#{rails_root}/tmp/pids/sidekiq#{i}.pid"
pid_file _pidfile

start_command "sidekiq -e #{rails_env} -P #{_pidfile} -d -L #{rails_root}/log/sidekiq.log -C #{rails_root}/config/sidekiq.yml -i #{i}"
stop_command "sidekiqctl stop #{_pidfile}"

start_grace = 60.seconds
stop_grace = 3.minutes
restart_grace = 4.minutes

#check :cpu, every: 10.seconds, below: 5, times: 3
check :memory, every: 10.seconds, below: 500.megabytes, :times => [2,3]
check :runtime, every: 10.minutes, below: 12.hours

end
end
end
end
26 changes: 0 additions & 26 deletions config/production.pill

This file was deleted.

Loading

0 comments on commit a4338e8

Please sign in to comment.