robot-controller 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4d443e3266f6f9ddc29eca4ca918766386ee951
4
- data.tar.gz: ae62b3f2ca4b59661636a2edbd8a6f9af53da184
3
+ metadata.gz: 803c5e4fa8d9c371645a0f74b54c2a5b65af9e40
4
+ data.tar.gz: 4f07045008301e932fba0f15fa01a1a265bbb876
5
5
  SHA512:
6
- metadata.gz: 445ffbb9be84122c5de5d2e8e07b5f5f1c7b2e5231b75b59899503d3c852d0a64babac3a872e7f20d41b6a9734b22b3985c4d132f28345a7e4afce24878ada0f
7
- data.tar.gz: d94f0dd6985e7aa7adf53ff2db612ba77b8f770c927b59d2d067ce65c550554b842ed4cb10bab3715f6b2c9d9e8fcbd6413fad9db9714c70802e9584764ea7a1
6
+ metadata.gz: 55669aa02a47f94fa2799e3207f7fb4f92a0e4e09a089b7fe21d9d39d0d597252b2c2676005ebca157325ab7d1331a1ed5d22dd21969ebbf2086b8b8e70b7002
7
+ data.tar.gz: 6d89ff076d45d76d4c675a90fc7ec62d279e91f75ad706a93f8c46e921f4a67f2396bb48fc797a516798819d7f218987acf9cdcc29e30d6551753b570636f204
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.6
1
+ 0.3.7
@@ -15,69 +15,72 @@ Bluepill.application File.basename(File.dirname(File.dirname(WORKDIR))),
15
15
  :log_file => "#{WORKDIR}/log/bluepill.log" do |app|
16
16
  app.working_dir = WORKDIR
17
17
  ROBOTS.each_index do |i|
18
- # prefix process name with index number to prevent duplicate process names
19
- prefix = sprintf("robot%02d", i+1)
20
- app.process("#{prefix}_#{ROBOTS[i][:robot]}") do |process|
21
- puts "Creating robot #{process.name}"
18
+ ROBOTS[i][:n].to_i.times do |j|
19
+ # prefix process name with index number to prevent duplicate process names
20
+ prefix = sprintf("robot%02d_%02d", i+1, j+1)
21
+ app.process("#{prefix}_#{ROBOTS[i][:robot]}") do |process|
22
+ puts "Creating robot #{process.name}"
22
23
 
23
- # queue order is *VERY* important
24
- queues = ROBOTS[i][:queues].join(',')
24
+ # queue order is *VERY* important
25
+ queues = ROBOTS[i][:queues].join(',')
25
26
 
26
- # use environment for these resque variables
27
- process.environment = {
28
- 'QUEUES' => queues,
29
- 'ROBOT_ENVIRONMENT' => robot_environment
30
- }
31
- process.environment['VERBOSE'] = 'yes' if ENV['ROBOT_VERBOSE'] == 'yes'
27
+ # use environment for these resque variables
28
+ process.environment = {
29
+ 'QUEUES' => queues,
30
+ 'ROBOT_ENVIRONMENT' => robot_environment,
31
+ 'INTERVAL' => '5'
32
+ }
33
+ process.environment['VERBOSE'] = 'yes' if ENV['ROBOT_VERBOSE'] == 'yes'
34
+ process.environment['VVERBOSE'] = 'yes' if ENV['ROBOT_VVERBOSE'] == 'yes'
35
+
36
+ # process configuration
37
+ process.group = robot_environment
38
+ process.stdout = process.stderr = "#{WORKDIR}/log/#{ROBOTS[i][:robot]}.log"
32
39
 
33
- # process configuration
34
- process.group = robot_environment
35
- process.stdout = process.stderr = "#{WORKDIR}/log/#{ROBOTS[i][:robot]}.log"
40
+ # spawn worker processes using robot-controller
41
+ process.start_command = "rake environment resque:work"
36
42
 
37
- # spawn worker processes using robot-controller
38
- process.environment['COUNT'] = ROBOTS[i][:n]
39
- process.start_command = "rake workers"
43
+ # we use bluepill to daemonize the resque workers rather than using
44
+ # resque's BACKGROUND flag
45
+ process.daemonize = true
40
46
 
41
- # we use bluepill to daemonize the resque workers rather than using
42
- # resque's BACKGROUND flag
43
- process.daemonize = true
47
+ # bluepill manages pid files
48
+ # process.pid_file = "#{WORKDIR}/run/#{process.name}.pid"
44
49
 
45
- # bluepill manages pid files
46
- # process.pid_file = "#{WORKDIR}/run/#{process.name}.pid"
50
+ # graceful stops
51
+ process.stop_grace_time = 360.seconds # must be greater than stop_signals total
52
+ process.stop_signals = [
53
+ :quit, 300.seconds, # waits for jobs, then exits gracefully
54
+ :term, 10.seconds, # kills jobs and exits
55
+ :kill # no mercy
56
+ ]
47
57
 
48
- # graceful stops
49
- process.stop_grace_time = 360.seconds # must be greater than stop_signals total
50
- process.stop_signals = [
51
- :quit, 300.seconds, # waits for jobs, then exits gracefully
52
- :term, 10.seconds, # kills jobs and exits
53
- :kill # no mercy
54
- ]
58
+ # process monitoring
55
59
 
56
- # process monitoring
60
+ # backoff if process is flapping between states
61
+ # process.checks :flapping,
62
+ # :times => 2, :within => 30.seconds,
63
+ # :retry_in => 7.seconds
57
64
 
58
- # backoff if process is flapping between states
59
- # process.checks :flapping,
60
- # :times => 2, :within => 30.seconds,
61
- # :retry_in => 7.seconds
65
+ # restart if process runs for longer than 15 mins of CPU time
66
+ # process.checks :running_time,
67
+ # :every => 5.minutes, :below => 15.minutes
62
68
 
63
- # restart if process runs for longer than 15 mins of CPU time
64
- # process.checks :running_time,
65
- # :every => 5.minutes, :below => 15.minutes
69
+ # restart if CPU usage > 75% for 3 times, check every 10 seconds
70
+ # process.checks :cpu_usage,
71
+ # :every => 10.seconds,
72
+ # :below => 75, :times => 3,
73
+ # :include_children => true
74
+ #
75
+ # restart the process or any of its children
76
+ # if MEM usage > 100MB for 3 times, check every 10 seconds
77
+ # process.checks :mem_usage,
78
+ # :every => 10.seconds,
79
+ # :below => 100.megabytes, :times => 3,
80
+ # :include_children => true
66
81
 
67
- # restart if CPU usage > 75% for 3 times, check every 10 seconds
68
- # process.checks :cpu_usage,
69
- # :every => 10.seconds,
70
- # :below => 75, :times => 3,
71
- # :include_children => true
72
- #
73
- # restart the process or any of its children
74
- # if MEM usage > 100MB for 3 times, check every 10 seconds
75
- # process.checks :mem_usage,
76
- # :every => 10.seconds,
77
- # :below => 100.megabytes, :times => 3,
78
- # :include_children => true
79
-
80
- # NOTE: there is an implicit process.keepalive
82
+ # NOTE: there is an implicit process.keepalive
83
+ end
81
84
  end
82
85
  end
83
86
  end
@@ -1,12 +1 @@
1
- require 'resque/tasks'
2
-
3
- desc "Start multiple Resque workers using environment"
4
- task :workers => [ :environment ] do
5
- threads = []
6
- (ENV['COUNT'] || '1').to_i.times do
7
- threads << Thread.new do
8
- system "rake environment resque:work" # XXX is better way to do this?
9
- end
10
- end
11
- threads.each { |thread| thread.join }
12
- end
1
+ require 'resque/tasks'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robot-controller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Hardy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-07 00:00:00.000000000 Z
11
+ date: 2014-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bluepill