godhead 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/README.textile +2 -2
- data/Rakefile +3 -3
- data/VERSION +1 -1
- data/lib/godhead/god_recipe.rb +2 -0
- data/lib/godhead/recipes/generic_worker_recipe.rb +6 -6
- data/lib/godhead/recipes/unicorn_recipe.rb +2 -1
- metadata +24 -40
- data/godhead.gemspec +0 -91
data/.gitignore
CHANGED
data/README.textile
CHANGED
@@ -34,7 +34,7 @@ The @examples/@ directory holds:
|
|
34
34
|
|
35
35
|
h2. Our use case for godhead
|
36
36
|
|
37
|
-
At infochimps, we have a lot of boxen set up as "scrapers":http://github.com/
|
37
|
+
At infochimps, we have a lot of boxen set up as "scrapers":http://github.com/infochimps/monkeyshines and as "feed endpoints.":http://github.com/mrflip/flood_monkey These typically talk to a lightweight database of some sort, pull or push to a queue, and are controlled through a simple sinatra admin panel.
|
38
38
|
|
39
39
|
With Godhead we describe the platonic form of, say, a "god config to monitor Tokyo Tyrant". The god files for a project using Tokyo Tyrant specifies only those few ways (port numbers, memory limits, etc) that its tasks differ from any other project's Tokyo Tyrant tasks. Configuration is still done in Ruby, through any combination of config params and subclassing.
|
40
40
|
|
@@ -47,4 +47,4 @@ h2. Links
|
|
47
47
|
** "god recipe":http://pastie.textmate.org/private/ovgxu2ihoicli2ktrwtbew
|
48
48
|
* "delayed_job":http://github.com/blog/229-dj-god
|
49
49
|
* "init.d/god script":http://www.johnwulff.com/2008/04/30/deploy-typo-using-capistrano
|
50
|
-
* backgroundRb: "this one":http://effectif.com/articles/monitoring-backgroundrb-with-god - or "this one":http://blog.jonathanrwallace.com/2008/08/monitoring-backgroundrb-workers-with-god/
|
50
|
+
* backgroundRb: "this one":http://effectif.com/articles/monitoring-backgroundrb-with-god - or "this one":http://blog.jonathanrwallace.com/2008/08/monitoring-backgroundrb-workers-with-god/
|
data/Rakefile
CHANGED
@@ -7,9 +7,9 @@ begin
|
|
7
7
|
gem.name = "godhead"
|
8
8
|
gem.summary = %Q{God recipes that separate configuration for processes, site policy and notifications; comes with many examples}
|
9
9
|
gem.description = %Q{Configure God monitored processes according to their concerns the servers (path and so forth), site policy (number, ports, etc), and notification (email groups, mailserver, etc).}
|
10
|
-
gem.email = "
|
11
|
-
gem.homepage = "http://github.com/
|
12
|
-
gem.authors = ["Philip (flip) Kromer"]
|
10
|
+
gem.email = "coders@infochimps.org"
|
11
|
+
gem.homepage = "http://github.com/infochimps/godhead"
|
12
|
+
gem.authors = ["Philip (flip) Kromer, Dhruv Bansal, Carl Knutson"]
|
13
13
|
gem.add_development_dependency "yard", ">= 0"
|
14
14
|
gem.add_development_dependency "rspec"
|
15
15
|
gem.add_dependency 'god'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/lib/godhead/god_recipe.rb
CHANGED
@@ -4,6 +4,7 @@ module Godhead
|
|
4
4
|
:monitor_group => nil,
|
5
5
|
:uid => nil,
|
6
6
|
:gid => nil,
|
7
|
+
:env => nil,
|
7
8
|
:crash_notify => nil,
|
8
9
|
:restart_notify => nil,
|
9
10
|
:flapping_notify => nil,
|
@@ -69,6 +70,7 @@ module Godhead
|
|
69
70
|
watcher.pid_file = pid_file if pid_file
|
70
71
|
watcher.uid = options[:uid] if options[:uid]
|
71
72
|
watcher.gid = options[:gid] if options[:gid]
|
73
|
+
watcher.env = options[:env] if options[:env]
|
72
74
|
watcher.interval = options[:default_interval]
|
73
75
|
watcher.start_grace = options[:start_grace_time]
|
74
76
|
watcher.restart_grace = options[:restart_grace_time] || (options[:start_grace_time] + 2.seconds)
|
@@ -8,7 +8,7 @@ module Godhead
|
|
8
8
|
:max_mem_usage => 50.megabytes,
|
9
9
|
#
|
10
10
|
:user => nil,
|
11
|
-
:runner_path => nil
|
11
|
+
:runner_path => nil
|
12
12
|
}
|
13
13
|
def self.default_options() super.deep_merge(DEFAULT_OPTIONS) ; end
|
14
14
|
|
@@ -36,13 +36,13 @@ module Godhead
|
|
36
36
|
|
37
37
|
def start_command
|
38
38
|
cmd = [
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
"sudo",
|
40
|
+
(options[:user] ? "-u #{options[:user]}" : nil),
|
41
|
+
options[:runner_path],
|
42
|
+
].flatten.compact.join(" ")
|
43
43
|
p ['worker command', cmd]
|
44
44
|
cmd
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
end
|
48
48
|
end
|
@@ -36,7 +36,8 @@ module Godhead
|
|
36
36
|
|
37
37
|
# # USR2 causes the master to re-create itself and spawn a new worker pool
|
38
38
|
def restart_command
|
39
|
-
|
39
|
+
old_pid_file = pid_file
|
40
|
+
"old_pid=`cat #{old_pid_file}`; kill -USR2 $old_pid ; sleep 4 ; kill -QUIT $old_pid"
|
40
41
|
end
|
41
42
|
end
|
42
43
|
end
|
metadata
CHANGED
@@ -1,72 +1,59 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: godhead
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 4
|
9
|
-
version: 0.0.4
|
4
|
+
version: 0.0.5
|
10
5
|
platform: ruby
|
11
6
|
authors:
|
12
|
-
- Philip (flip) Kromer
|
7
|
+
- Philip (flip) Kromer, Dhruv Bansal, Carl Knutson
|
13
8
|
autorequire:
|
14
9
|
bindir: bin
|
15
10
|
cert_chain: []
|
16
11
|
|
17
|
-
date: 2010-
|
12
|
+
date: 2010-06-18 00:00:00 -05:00
|
18
13
|
default_executable:
|
19
14
|
dependencies:
|
20
15
|
- !ruby/object:Gem::Dependency
|
21
16
|
name: yard
|
22
|
-
|
23
|
-
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
20
|
requirements:
|
25
21
|
- - ">="
|
26
22
|
- !ruby/object:Gem::Version
|
27
|
-
segments:
|
28
|
-
- 0
|
29
23
|
version: "0"
|
30
|
-
|
31
|
-
version_requirements: *id001
|
24
|
+
version:
|
32
25
|
- !ruby/object:Gem::Dependency
|
33
26
|
name: rspec
|
34
|
-
|
35
|
-
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
31
|
- - ">="
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
segments:
|
40
|
-
- 0
|
41
33
|
version: "0"
|
42
|
-
|
43
|
-
version_requirements: *id002
|
34
|
+
version:
|
44
35
|
- !ruby/object:Gem::Dependency
|
45
36
|
name: god
|
46
|
-
|
47
|
-
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
48
40
|
requirements:
|
49
41
|
- - ">="
|
50
42
|
- !ruby/object:Gem::Version
|
51
|
-
segments:
|
52
|
-
- 0
|
53
43
|
version: "0"
|
54
|
-
|
55
|
-
version_requirements: *id003
|
44
|
+
version:
|
56
45
|
- !ruby/object:Gem::Dependency
|
57
46
|
name: activesupport
|
58
|
-
|
59
|
-
|
47
|
+
type: :runtime
|
48
|
+
version_requirement:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
50
|
requirements:
|
61
51
|
- - ">="
|
62
52
|
- !ruby/object:Gem::Version
|
63
|
-
segments:
|
64
|
-
- 0
|
65
53
|
version: "0"
|
66
|
-
|
67
|
-
version_requirements: *id004
|
54
|
+
version:
|
68
55
|
description: Configure God monitored processes according to their concerns the servers (path and so forth), site policy (number, ports, etc), and notification (email groups, mailserver, etc).
|
69
|
-
email:
|
56
|
+
email: coders@infochimps.org
|
70
57
|
executables: []
|
71
58
|
|
72
59
|
extensions: []
|
@@ -85,7 +72,6 @@ files:
|
|
85
72
|
- examples/etc/god/god_config.yaml
|
86
73
|
- examples/etc/god/sample_project.god
|
87
74
|
- examples/etc/init.d/god
|
88
|
-
- godhead.gemspec
|
89
75
|
- lib/godhead.rb
|
90
76
|
- lib/godhead/extensions.rb
|
91
77
|
- lib/godhead/extensions/hash.rb
|
@@ -114,7 +100,7 @@ files:
|
|
114
100
|
- spec/godhead_spec.rb
|
115
101
|
- spec/spec_helper.rb
|
116
102
|
has_rdoc: true
|
117
|
-
homepage: http://github.com/
|
103
|
+
homepage: http://github.com/infochimps/godhead
|
118
104
|
licenses: []
|
119
105
|
|
120
106
|
post_install_message:
|
@@ -126,20 +112,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
112
|
requirements:
|
127
113
|
- - ">="
|
128
114
|
- !ruby/object:Gem::Version
|
129
|
-
segments:
|
130
|
-
- 0
|
131
115
|
version: "0"
|
116
|
+
version:
|
132
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
118
|
requirements:
|
134
119
|
- - ">="
|
135
120
|
- !ruby/object:Gem::Version
|
136
|
-
segments:
|
137
|
-
- 0
|
138
121
|
version: "0"
|
122
|
+
version:
|
139
123
|
requirements: []
|
140
124
|
|
141
125
|
rubyforge_project:
|
142
|
-
rubygems_version: 1.3.
|
126
|
+
rubygems_version: 1.3.5
|
143
127
|
signing_key:
|
144
128
|
specification_version: 3
|
145
129
|
summary: God recipes that separate configuration for processes, site policy and notifications; comes with many examples
|
data/godhead.gemspec
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{godhead}
|
8
|
-
s.version = "0.0.4"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Philip (flip) Kromer"]
|
12
|
-
s.date = %q{2010-04-10}
|
13
|
-
s.description = %q{Configure God monitored processes according to their concerns the servers (path and so forth), site policy (number, ports, etc), and notification (email groups, mailserver, etc).}
|
14
|
-
s.email = %q{flip@infochimps.org}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.textile"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".gitignore",
|
22
|
-
"LICENSE",
|
23
|
-
"README.textile",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION",
|
26
|
-
"examples/etc/god.conf",
|
27
|
-
"examples/etc/god/god_config.yaml",
|
28
|
-
"examples/etc/god/sample_project.god",
|
29
|
-
"examples/etc/init.d/god",
|
30
|
-
"godhead.gemspec",
|
31
|
-
"lib/godhead.rb",
|
32
|
-
"lib/godhead/extensions.rb",
|
33
|
-
"lib/godhead/extensions/hash.rb",
|
34
|
-
"lib/godhead/extensions/string.rb",
|
35
|
-
"lib/godhead/god_email.rb",
|
36
|
-
"lib/godhead/god_recipe.rb",
|
37
|
-
"lib/godhead/mixins.rb",
|
38
|
-
"lib/godhead/mixins/runs_as_service.rb",
|
39
|
-
"lib/godhead/notifications.rb",
|
40
|
-
"lib/godhead/process_groups.rb",
|
41
|
-
"lib/godhead/recipes.rb",
|
42
|
-
"lib/godhead/recipes/beanstalkd_recipe.rb",
|
43
|
-
"lib/godhead/recipes/delayed_job_recipe.rb",
|
44
|
-
"lib/godhead/recipes/generic_worker_recipe.rb",
|
45
|
-
"lib/godhead/recipes/memcached_recipe.rb",
|
46
|
-
"lib/godhead/recipes/mongrel_recipe.rb",
|
47
|
-
"lib/godhead/recipes/mysql_recipe.rb",
|
48
|
-
"lib/godhead/recipes/nginx_recipe.rb",
|
49
|
-
"lib/godhead/recipes/resque_recipe.rb",
|
50
|
-
"lib/godhead/recipes/starling_recipe.rb",
|
51
|
-
"lib/godhead/recipes/thin_recipe.rb",
|
52
|
-
"lib/godhead/recipes/thinking_sphinx.rb",
|
53
|
-
"lib/godhead/recipes/tyrant_recipe.rb",
|
54
|
-
"lib/godhead/recipes/unicorn_recipe.rb",
|
55
|
-
"lib/godhead/recipes/workling_recipe.rb",
|
56
|
-
"spec/godhead_spec.rb",
|
57
|
-
"spec/spec_helper.rb"
|
58
|
-
]
|
59
|
-
s.homepage = %q{http://github.com/mrflip/godhead}
|
60
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
61
|
-
s.require_paths = ["lib"]
|
62
|
-
s.rubygems_version = %q{1.3.6}
|
63
|
-
s.summary = %q{God recipes that separate configuration for processes, site policy and notifications; comes with many examples}
|
64
|
-
s.test_files = [
|
65
|
-
"spec/godhead_spec.rb",
|
66
|
-
"spec/spec_helper.rb"
|
67
|
-
]
|
68
|
-
|
69
|
-
if s.respond_to? :specification_version then
|
70
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
71
|
-
s.specification_version = 3
|
72
|
-
|
73
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
74
|
-
s.add_development_dependency(%q<yard>, [">= 0"])
|
75
|
-
s.add_development_dependency(%q<rspec>, [">= 0"])
|
76
|
-
s.add_runtime_dependency(%q<god>, [">= 0"])
|
77
|
-
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
78
|
-
else
|
79
|
-
s.add_dependency(%q<yard>, [">= 0"])
|
80
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
81
|
-
s.add_dependency(%q<god>, [">= 0"])
|
82
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
83
|
-
end
|
84
|
-
else
|
85
|
-
s.add_dependency(%q<yard>, [">= 0"])
|
86
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
87
|
-
s.add_dependency(%q<god>, [">= 0"])
|
88
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|