poolparty 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +4 -0
- data/Manifest +55 -0
- data/README.txt +113 -0
- data/Rakefile +18 -0
- data/bin/instance +54 -0
- data/bin/pool +33 -0
- data/config/config.yml +23 -0
- data/config/create_proxy_ami.sh +582 -0
- data/config/haproxy.conf +29 -0
- data/config/heartbeat.conf +9 -0
- data/config/heartbeat_authkeys.conf +2 -0
- data/config/monit/haproxy.monit.conf +7 -0
- data/config/monit/nginx.monit.conf +0 -0
- data/config/monit.conf +8 -0
- data/config/nginx.conf +24 -0
- data/lib/core/array.rb +10 -0
- data/lib/core/exception.rb +9 -0
- data/lib/core/kernel.rb +9 -0
- data/lib/core/module.rb +22 -0
- data/lib/core/object.rb +14 -0
- data/lib/core/string.rb +49 -0
- data/lib/core/time.rb +41 -0
- data/lib/modules/callback.rb +55 -0
- data/lib/modules/ec2_wrapper.rb +74 -0
- data/lib/modules/safe_instance.rb +31 -0
- data/lib/pool_party/application.rb +133 -0
- data/lib/pool_party/init.rb +4 -0
- data/lib/pool_party/master.rb +189 -0
- data/lib/pool_party/monitors/cpu.rb +18 -0
- data/lib/pool_party/monitors/memory.rb +21 -0
- data/lib/pool_party/monitors/web.rb +18 -0
- data/lib/pool_party/monitors.rb +13 -0
- data/lib/pool_party/optioner.rb +16 -0
- data/lib/pool_party/os/ubuntu.rb +78 -0
- data/lib/pool_party/os.rb +11 -0
- data/lib/pool_party/remote_instance.rb +180 -0
- data/lib/pool_party/remoting.rb +112 -0
- data/lib/pool_party/scheduler.rb +93 -0
- data/lib/pool_party/tasks.rb +220 -0
- data/lib/pool_party.rb +69 -0
- data/lib/s3/s3_object_store_folders.rb +44 -0
- data/poolparty.gemspec +55 -0
- data/spec/application_spec.rb +32 -0
- data/spec/callback_spec.rb +65 -0
- data/spec/helpers/ec2_mock.rb +56 -0
- data/spec/helpers/remote_instance_mock.rb +11 -0
- data/spec/kernel_spec.rb +11 -0
- data/spec/master_spec.rb +147 -0
- data/spec/monitor_spec.rb +16 -0
- data/spec/optioner_spec.rb +22 -0
- data/spec/poolparty_spec.rb +8 -0
- data/spec/remote_instance_spec.rb +29 -0
- data/spec/remoting_spec.rb +75 -0
- data/spec/spec_helper.rb +38 -0
- data/spec/string_spec.rb +28 -0
- data/test/test_pool_party.rb +0 -0
- metadata +171 -0
data/spec/master_spec.rb
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "Master" do
|
|
4
|
+
before(:each) do
|
|
5
|
+
Application.options.stub!(:contract_when).and_return("web_requests > 30.0\n cpu_usage < 0.10")
|
|
6
|
+
Application.options.stub!(:expand_when).and_return("web_requests < 3.0\n cpu_usage > 0.80")
|
|
7
|
+
@master = Master.new
|
|
8
|
+
end
|
|
9
|
+
it "should launch the first instances and set the first as the master and the rest as slaves" do
|
|
10
|
+
Application.stub!(:minimum_instances).and_return(1)
|
|
11
|
+
Application.stub!(:verbose).and_return(false) # Hide messages
|
|
12
|
+
Master.stub!(:new).and_return(@master)
|
|
13
|
+
|
|
14
|
+
@master.stub!(:number_of_running_instances).and_return(0);
|
|
15
|
+
@master.stub!(:number_of_pending_instances).and_return(0);
|
|
16
|
+
|
|
17
|
+
@master.should_receive(:launch_new_instance!).and_return(
|
|
18
|
+
{:instance_id => "i-5849ba", :ip => "ip-127-0-0-1.aws.amazon.com", :status => "running"})
|
|
19
|
+
@master.stub!(:list_of_nonterminated_instances).and_return(
|
|
20
|
+
[{:instance_id => "i-5849ba", :ip => "ip-127-0-0-1.aws.amazon.com", :status => "running"}])
|
|
21
|
+
@master.start_cloud!
|
|
22
|
+
@master.nodes.first.instance_id.should == "i-5849ba"
|
|
23
|
+
end
|
|
24
|
+
describe "with stubbed instances" do
|
|
25
|
+
before(:each) do
|
|
26
|
+
@master.stub!(:list_of_nonterminated_instances).and_return([
|
|
27
|
+
{:instance_id => "i-5849ba", :ip => "ip-127-0-0-1.aws.amazon.com", :status => "running"},
|
|
28
|
+
{:instance_id => "i-5849bb", :ip => "ip-127-0-0-2.aws.amazon.com", :status => "running"},
|
|
29
|
+
{:instance_id => "i-5849bc", :ip => "ip-127-0-0-3.aws.amazon.com", :status => "pending"}
|
|
30
|
+
])
|
|
31
|
+
Kernel.stub!(:exec).and_return true
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it "should be able to go through the instances and assign them numbers" do
|
|
35
|
+
i = 0
|
|
36
|
+
@master.nodes.each do |node|
|
|
37
|
+
node.number.should == i
|
|
38
|
+
i += 1
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
it "should be able to say that the master is the master" do
|
|
42
|
+
@master.nodes.first.master?.should == true
|
|
43
|
+
end
|
|
44
|
+
it "should be able to say that the slave is not a master" do
|
|
45
|
+
@master.nodes[1].master?.should == false
|
|
46
|
+
end
|
|
47
|
+
it "should be able to get a specific node in the nodes from the master" do
|
|
48
|
+
@master.get_node(2).instance_id.should == "i-5849bc"
|
|
49
|
+
end
|
|
50
|
+
it "should be able to build a hosts file" do
|
|
51
|
+
open(@master.build_hosts_file.path).read.should == "node0\tip-127-0-0-1.aws.amazon.com\nnode1\tip-127-0-0-2.aws.amazon.com\nnode2\tip-127-0-0-3.aws.amazon.com"
|
|
52
|
+
end
|
|
53
|
+
it "should be able to build a hosts file for a specific instance" do
|
|
54
|
+
open(@master.build_hosts_file_for(@master.nodes.first).path).read.should =~ "node0\t127.0.0.1"
|
|
55
|
+
end
|
|
56
|
+
it "should be able to build a haproxy file" do
|
|
57
|
+
open(@master.build_haproxy_file.path).read.should =~ "server node0 ip-127-0-0-1.aws.amazon.com:#{Application.client_port}"
|
|
58
|
+
end
|
|
59
|
+
it "should be able to reconfigure the instances (working on two files a piece)" do
|
|
60
|
+
@master.nodes.each {|a| a.should_receive(:configure).and_return true if a.status =~ /running/}
|
|
61
|
+
@master.reconfigure_running_instances
|
|
62
|
+
end
|
|
63
|
+
it "should be able to restart the running instances' services" do
|
|
64
|
+
@master.nodes.each {|a| a.should_receive(:restart_with_monit).and_return true }
|
|
65
|
+
@master.restart_running_instances_services
|
|
66
|
+
end
|
|
67
|
+
it "should be able to build a heartbeat auth file" do
|
|
68
|
+
open(@master.build_heartbeat_authkeys_file).read.should =~ /1 md5/
|
|
69
|
+
end
|
|
70
|
+
describe "configuring" do
|
|
71
|
+
before(:each) do
|
|
72
|
+
Master.stub!(:new).and_return(@master)
|
|
73
|
+
end
|
|
74
|
+
it "should be able to build a heartbeat resources file for the specific node" do
|
|
75
|
+
open(Master.build_heartbeat_resources_file_for(@master.nodes.first)).read.should =~ /node0\tip-127/
|
|
76
|
+
end
|
|
77
|
+
it "should be able to build a heartbeat config file" do
|
|
78
|
+
open(Master.build_heartbeat_config_file_for(@master.nodes.first)).read.should =~ /\nnode node0\nnode node1/
|
|
79
|
+
end
|
|
80
|
+
it "should be able to say if heartbeat is necessary with more than 1 server or not" do
|
|
81
|
+
Master.requires_heartbeat?.should == true
|
|
82
|
+
end
|
|
83
|
+
it "should be able to say that heartbeat is not necessary if there is 1 server" do
|
|
84
|
+
@master.stub!(:list_of_nonterminated_instances).and_return([
|
|
85
|
+
{:instance_id => "i-5849ba", :ip => "ip-127-0-0-1.aws.amazon.com", :status => "running"}
|
|
86
|
+
])
|
|
87
|
+
Master.requires_heartbeat?.should == false
|
|
88
|
+
end
|
|
89
|
+
it "should only install the stack on nodes that don't have it marked locally as installed" do
|
|
90
|
+
@master.nodes.each {|i| i.should_receive(:stack_installed?).and_return(true)}
|
|
91
|
+
@master.should_not_receive(:reconfigure_running_instances)
|
|
92
|
+
@master.reconfigure_cloud_when_necessary
|
|
93
|
+
end
|
|
94
|
+
it "should install the stack on all the nodes (because it needs reconfiguring) if there is any node that needs the stack" do
|
|
95
|
+
@master.nodes.first.should_receive(:stack_installed?).and_return(false)
|
|
96
|
+
@master.should_receive(:reconfigure_running_instances).once.and_return(true)
|
|
97
|
+
@master.reconfigure_cloud_when_necessary
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
describe "displaying" do
|
|
101
|
+
it "should be able to list the cloud instances" do
|
|
102
|
+
@master.list.should =~ /CLOUD \(/
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
describe "monitoring" do
|
|
106
|
+
it "should start the monitor when calling start_monitor!" do
|
|
107
|
+
@master.should_receive(:run_thread_loop).and_return(Proc.new {})
|
|
108
|
+
@master.start_monitor!
|
|
109
|
+
end
|
|
110
|
+
it "should request to launch a new instance" do
|
|
111
|
+
@master.should_receive(:add_instance_if_load_is_high).and_return(true)
|
|
112
|
+
@master.add_instance_if_load_is_high
|
|
113
|
+
end
|
|
114
|
+
it "should request to terminate a non-master instance if the load" do
|
|
115
|
+
@master.should_receive(:contract?).and_return(true)
|
|
116
|
+
@master.should_receive(:request_termination_of_instance).and_return(true)
|
|
117
|
+
@master.terminate_instance_if_load_is_low
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
describe "expanding and contracting" do
|
|
121
|
+
it "should be able to say that it should not contract" do
|
|
122
|
+
@master.stub!(:web_requests).and_return(10.2)
|
|
123
|
+
@master.stub!(:cpu_usage).and_return(0.32)
|
|
124
|
+
|
|
125
|
+
@master.contract?.should == false
|
|
126
|
+
end
|
|
127
|
+
it "should be able to say that it should contract" do
|
|
128
|
+
@master.stub!(:web_requests).and_return(30.2)
|
|
129
|
+
@master.stub!(:cpu_usage).and_return(0.05)
|
|
130
|
+
|
|
131
|
+
@master.contract?.should == true
|
|
132
|
+
end
|
|
133
|
+
it "should be able to say that it should not expand if it shouldn't expand" do
|
|
134
|
+
@master.stub!(:web_requests).and_return(30.2)
|
|
135
|
+
@master.stub!(:cpu_usage).and_return(0.92)
|
|
136
|
+
|
|
137
|
+
@master.expand?.should == false
|
|
138
|
+
end
|
|
139
|
+
it "should be able to say that it should expand if it should expand" do
|
|
140
|
+
@master.stub!(:web_requests).and_return(1.2)
|
|
141
|
+
@master.stub!(:cpu_usage).and_return(0.92)
|
|
142
|
+
|
|
143
|
+
@master.expand?.should == true
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "monitors" do
|
|
4
|
+
it "should web monitor should be able to extract the amount of the requests it can handle" do
|
|
5
|
+
str = "Request rate: 1.5 req/s (649.9 ms/req)"
|
|
6
|
+
Monitors::Web.monitor_from_string(str).should == 1.5
|
|
7
|
+
end
|
|
8
|
+
it "should be able to monitor the percentage of memory available on the server" do
|
|
9
|
+
str = "Mem: 1700 56 1644 0 2 18"
|
|
10
|
+
Monitors::Memory.monitor_from_string(str).to_s.should =~ /0.032/
|
|
11
|
+
end
|
|
12
|
+
it "should be able to show the load on the cpu available on the server" do
|
|
13
|
+
str = "18:55:31 up 5 min, 1 user, load average: 0.32, 0.03, 0.00"
|
|
14
|
+
Monitors::Cpu.monitor_from_string(str).should == 0.32
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "Optioner with options" do
|
|
4
|
+
it "should be able to pull out the lonely arguments without any switches" do
|
|
5
|
+
Optioner.parse("hello".split(" ")).should == ["hello"]
|
|
6
|
+
end
|
|
7
|
+
it "should be able to pull out the lonely arguments with switches" do
|
|
8
|
+
Optioner.parse("-s 30.seconds -m hello world".split(" ")).should == ["world"]
|
|
9
|
+
end
|
|
10
|
+
it "should be able to pull out start from the the string" do
|
|
11
|
+
Optioner.parse("-c 'config/config.yml' -A 'Who' -S 'DarkwingDuck' list".split(" ")).should == ["list"]
|
|
12
|
+
end
|
|
13
|
+
it "should be able to pull out the lonely arguments with optional argument switches" do
|
|
14
|
+
Optioner.parse("-s 30 -q -n start".split(" "), %w(-q -n)).should == ["start"]
|
|
15
|
+
end
|
|
16
|
+
it "should pull out the lonely arguments if none are there" do
|
|
17
|
+
Optioner.parse("-s 30 -q".split(" ")).should == []
|
|
18
|
+
end
|
|
19
|
+
it "should pull out empty array if there are no lonely arguments" do
|
|
20
|
+
Optioner.parse("-s 30".split(" ")).should == []
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "Application options" do
|
|
4
|
+
it "should parse and use a config file if it is given for the options" do
|
|
5
|
+
YAML.should_receive(:load).and_return({:config_file => "config/config.yml"})
|
|
6
|
+
Application.make_options(:config_file => "config/config.yml")
|
|
7
|
+
end
|
|
8
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "remote instance" do
|
|
4
|
+
before(:each) do
|
|
5
|
+
@instance = RemoteInstance.new({:ip => "127.0.0.1"})
|
|
6
|
+
@instance.stub!(:ssh).and_return "true"
|
|
7
|
+
@instance.stub!(:scp).and_return "true"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
describe "in general" do
|
|
11
|
+
it "should set the ip upon creation" do
|
|
12
|
+
@instance.ip.should == "127.0.0.1"
|
|
13
|
+
end
|
|
14
|
+
it "should be able to tell if it is the master or not" do
|
|
15
|
+
@instance.master?.should == true
|
|
16
|
+
end
|
|
17
|
+
it "should be able to build a list of the heartbeat nodes" do
|
|
18
|
+
@instance.node_entry.should =~ /node/
|
|
19
|
+
end
|
|
20
|
+
it "should call configure after it calls install_stack" do
|
|
21
|
+
@instance.should_receive(:configure).once.and_return(true)
|
|
22
|
+
@instance.install_stack
|
|
23
|
+
end
|
|
24
|
+
it "should call restart_with_monit after it calls configure" do
|
|
25
|
+
@instance.should_receive(:restart_with_monit).once.and_return(true)
|
|
26
|
+
@instance.configure
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
|
2
|
+
|
|
3
|
+
# RUN THESE ONE AT A TIME
|
|
4
|
+
module PoolParty
|
|
5
|
+
class Master;include EC2Mock;end
|
|
6
|
+
class RemoteInstance; include RemoteInstanceMock;end
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
describe "Master remoting: " do
|
|
10
|
+
before(:each) do
|
|
11
|
+
Application.stub!(:environment).and_return("test") # So it daemonizes
|
|
12
|
+
Application.stub!(:minimum_instances).and_return(2)
|
|
13
|
+
Application.stub!(:maximum_instances).and_return(10)
|
|
14
|
+
Application.stub!(:polling_time).and_return(0.3)
|
|
15
|
+
Application.stub!(:verbose).and_return(false) # Turn off messaging
|
|
16
|
+
|
|
17
|
+
@master = Master.new
|
|
18
|
+
end
|
|
19
|
+
describe "starting" do
|
|
20
|
+
before(:each) do
|
|
21
|
+
@master.start_cloud!
|
|
22
|
+
end
|
|
23
|
+
it "should start the cloud with instances" do
|
|
24
|
+
@master.list_of_instances.should_not be_empty
|
|
25
|
+
end
|
|
26
|
+
it "should start the cloud with running instances" do
|
|
27
|
+
@master.list_of_running_instances.should_not be_empty
|
|
28
|
+
end
|
|
29
|
+
it "should start with the minimum_instances running" do
|
|
30
|
+
wait 0.5 # Give the last one time to get to running
|
|
31
|
+
@master.list_of_running_instances.size.should == Application.minimum_instances
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
describe "maintaining" do
|
|
35
|
+
it "should maintain the minimum_instances if one goes down" do
|
|
36
|
+
@master.start_cloud!
|
|
37
|
+
wait 0.2 # Give the two instances time to boot up
|
|
38
|
+
(Application.minimum_instances - @master.number_of_pending_and_running_instances).should == 0
|
|
39
|
+
|
|
40
|
+
# Kill one off to test how it handles the response
|
|
41
|
+
@master.terminate_instance!(@master.list_of_running_instances[0][:instance_id])
|
|
42
|
+
(Application.minimum_instances - @master.number_of_pending_and_running_instances).should == 1
|
|
43
|
+
@master.launch_minimum_instances # Assume this runs in the bg process
|
|
44
|
+
|
|
45
|
+
(Application.minimum_instances - @master.number_of_pending_and_running_instances).should == 0
|
|
46
|
+
@master.number_of_pending_and_running_instances.should == Application.minimum_instances
|
|
47
|
+
end
|
|
48
|
+
it "should launch a new instance when the load gets too heavy set in the configs" do
|
|
49
|
+
@master.stub!(:expand?).and_return true
|
|
50
|
+
@master.start_cloud!
|
|
51
|
+
wait 0.2 # Give the two instances time to boot up
|
|
52
|
+
(Application.minimum_instances - @master.number_of_pending_and_running_instances).should == 0
|
|
53
|
+
@master.add_instance_if_load_is_high
|
|
54
|
+
@master.nodes.size.should == Application.minimum_instances + 1
|
|
55
|
+
end
|
|
56
|
+
it "should terminate an instance when the load shows that it's too light" do
|
|
57
|
+
@master.stub!(:contract?).and_return true
|
|
58
|
+
@master.start_cloud!
|
|
59
|
+
@master.request_launch_new_instance
|
|
60
|
+
wait 0.5 # Give the two instances time to boot up
|
|
61
|
+
@master.terminate_instance_if_load_is_low
|
|
62
|
+
@master.number_of_pending_and_running_instances.should == Application.minimum_instances
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
describe "configuring" do
|
|
66
|
+
it "should call configure on all of the nodes when calling reconfigure_running_instances" do
|
|
67
|
+
@master.nodes.each {|a| a.should_receive(:configure).and_return true }
|
|
68
|
+
@master.reconfigure_running_instances
|
|
69
|
+
end
|
|
70
|
+
it "should call restart_with_monit on all of the nodes when calling restart_running_instances_services" do
|
|
71
|
+
@master.nodes.each {|a| a.should_receive(:restart_with_monit).and_return true }
|
|
72
|
+
@master.restart_running_instances_services
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require File.join(File.dirname(__FILE__), *%w[.. lib pool_party])
|
|
2
|
+
|
|
3
|
+
%w(test/spec).each do |library|
|
|
4
|
+
begin
|
|
5
|
+
require library
|
|
6
|
+
rescue
|
|
7
|
+
STDERR.puts "== Cannot run test without #{library}"
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
Dir["#{File.dirname(__FILE__)}/helpers/**"].each {|a| require a}
|
|
12
|
+
|
|
13
|
+
include PoolParty
|
|
14
|
+
extend PoolParty
|
|
15
|
+
|
|
16
|
+
Application.verbose = false
|
|
17
|
+
|
|
18
|
+
def wait_launch(time=5)
|
|
19
|
+
pid = fork {yield}
|
|
20
|
+
wait time
|
|
21
|
+
Process.kill("INT", pid)
|
|
22
|
+
Process.wait(pid, 0)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
module Test::Unit::AssertDifference
|
|
26
|
+
def assert_difference(object, method = nil, difference = 1)
|
|
27
|
+
initial_value = object.send(method)
|
|
28
|
+
yield
|
|
29
|
+
assert_equal initial_value + difference, object.send(method), "#{object}##{method}"
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def assert_no_difference(object, method, &block)
|
|
33
|
+
assert_difference object, method, 0, &block
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
Test::Spec::Should.send(:include, Test::Unit::AssertDifference)
|
|
38
|
+
Test::Spec::ShouldNot.send(:include, Test::Unit::AssertDifference)
|
data/spec/string_spec.rb
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "String" do
|
|
4
|
+
before(:each) do
|
|
5
|
+
@string = "string"
|
|
6
|
+
@string.stub!(:bucket_objects).and_return([])
|
|
7
|
+
end
|
|
8
|
+
# Dumb test
|
|
9
|
+
it "should be able to call bucket_objects on itself" do
|
|
10
|
+
@string.should_receive(:bucket_objects)
|
|
11
|
+
@string.bucket_objects
|
|
12
|
+
end
|
|
13
|
+
describe "with config replacements" do
|
|
14
|
+
it "should replace those syms in the string" do
|
|
15
|
+
("new :port" ^ {:port => 100}).should == "new 100"
|
|
16
|
+
end
|
|
17
|
+
it "should be able to detect vars" do
|
|
18
|
+
@string=<<-EOC
|
|
19
|
+
listen web_proxy 127.0.0.1::client_port
|
|
20
|
+
\tserver web1 127.0.0.1::port weight 1 minconn 3 maxconn 6 check inter 30000
|
|
21
|
+
EOC
|
|
22
|
+
(@string ^ {:client_port => 3000, :port => 3001}).should ==<<-EOO
|
|
23
|
+
listen web_proxy 127.0.0.1:3000
|
|
24
|
+
\tserver web1 127.0.0.1:3001 weight 1 minconn 3 maxconn 6 check inter 30000
|
|
25
|
+
EOO
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
File without changes
|
metadata
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: poolparty
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.4
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Ari Lerner
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
|
|
12
|
+
date: 2008-05-28 00:00:00 -07:00
|
|
13
|
+
default_executable:
|
|
14
|
+
dependencies:
|
|
15
|
+
- !ruby/object:Gem::Dependency
|
|
16
|
+
name: aws-s3
|
|
17
|
+
version_requirement:
|
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
19
|
+
requirements:
|
|
20
|
+
- - ">="
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: "0"
|
|
23
|
+
version:
|
|
24
|
+
- !ruby/object:Gem::Dependency
|
|
25
|
+
name: amazon-ec2
|
|
26
|
+
version_requirement:
|
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
28
|
+
requirements:
|
|
29
|
+
- - ">="
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: "0"
|
|
32
|
+
version:
|
|
33
|
+
- !ruby/object:Gem::Dependency
|
|
34
|
+
name: aska
|
|
35
|
+
version_requirement:
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: "0"
|
|
41
|
+
version:
|
|
42
|
+
description: Run your entire application off EC2, managed and auto-scaling
|
|
43
|
+
email: ari.lerner@citrusbyte.com
|
|
44
|
+
executables:
|
|
45
|
+
- instance
|
|
46
|
+
- pool
|
|
47
|
+
extensions: []
|
|
48
|
+
|
|
49
|
+
extra_rdoc_files:
|
|
50
|
+
- bin/instance
|
|
51
|
+
- bin/pool
|
|
52
|
+
- CHANGELOG
|
|
53
|
+
- lib/core/array.rb
|
|
54
|
+
- lib/core/exception.rb
|
|
55
|
+
- lib/core/kernel.rb
|
|
56
|
+
- lib/core/module.rb
|
|
57
|
+
- lib/core/object.rb
|
|
58
|
+
- lib/core/string.rb
|
|
59
|
+
- lib/core/time.rb
|
|
60
|
+
- lib/modules/callback.rb
|
|
61
|
+
- lib/modules/ec2_wrapper.rb
|
|
62
|
+
- lib/modules/safe_instance.rb
|
|
63
|
+
- lib/pool_party/application.rb
|
|
64
|
+
- lib/pool_party/init.rb
|
|
65
|
+
- lib/pool_party/master.rb
|
|
66
|
+
- lib/pool_party/monitors/cpu.rb
|
|
67
|
+
- lib/pool_party/monitors/memory.rb
|
|
68
|
+
- lib/pool_party/monitors/web.rb
|
|
69
|
+
- lib/pool_party/monitors.rb
|
|
70
|
+
- lib/pool_party/optioner.rb
|
|
71
|
+
- lib/pool_party/os/ubuntu.rb
|
|
72
|
+
- lib/pool_party/os.rb
|
|
73
|
+
- lib/pool_party/remote_instance.rb
|
|
74
|
+
- lib/pool_party/remoting.rb
|
|
75
|
+
- lib/pool_party/scheduler.rb
|
|
76
|
+
- lib/pool_party/tasks.rb
|
|
77
|
+
- lib/pool_party.rb
|
|
78
|
+
- lib/s3/s3_object_store_folders.rb
|
|
79
|
+
- README.txt
|
|
80
|
+
files:
|
|
81
|
+
- bin/instance
|
|
82
|
+
- bin/pool
|
|
83
|
+
- CHANGELOG
|
|
84
|
+
- config/config.yml
|
|
85
|
+
- config/create_proxy_ami.sh
|
|
86
|
+
- config/haproxy.conf
|
|
87
|
+
- config/heartbeat.conf
|
|
88
|
+
- config/heartbeat_authkeys.conf
|
|
89
|
+
- config/monit/haproxy.monit.conf
|
|
90
|
+
- config/monit/nginx.monit.conf
|
|
91
|
+
- config/monit.conf
|
|
92
|
+
- config/nginx.conf
|
|
93
|
+
- lib/core/array.rb
|
|
94
|
+
- lib/core/exception.rb
|
|
95
|
+
- lib/core/kernel.rb
|
|
96
|
+
- lib/core/module.rb
|
|
97
|
+
- lib/core/object.rb
|
|
98
|
+
- lib/core/string.rb
|
|
99
|
+
- lib/core/time.rb
|
|
100
|
+
- lib/modules/callback.rb
|
|
101
|
+
- lib/modules/ec2_wrapper.rb
|
|
102
|
+
- lib/modules/safe_instance.rb
|
|
103
|
+
- lib/pool_party/application.rb
|
|
104
|
+
- lib/pool_party/init.rb
|
|
105
|
+
- lib/pool_party/master.rb
|
|
106
|
+
- lib/pool_party/monitors/cpu.rb
|
|
107
|
+
- lib/pool_party/monitors/memory.rb
|
|
108
|
+
- lib/pool_party/monitors/web.rb
|
|
109
|
+
- lib/pool_party/monitors.rb
|
|
110
|
+
- lib/pool_party/optioner.rb
|
|
111
|
+
- lib/pool_party/os/ubuntu.rb
|
|
112
|
+
- lib/pool_party/os.rb
|
|
113
|
+
- lib/pool_party/remote_instance.rb
|
|
114
|
+
- lib/pool_party/remoting.rb
|
|
115
|
+
- lib/pool_party/scheduler.rb
|
|
116
|
+
- lib/pool_party/tasks.rb
|
|
117
|
+
- lib/pool_party.rb
|
|
118
|
+
- lib/s3/s3_object_store_folders.rb
|
|
119
|
+
- Manifest
|
|
120
|
+
- Rakefile
|
|
121
|
+
- README.txt
|
|
122
|
+
- spec/application_spec.rb
|
|
123
|
+
- spec/callback_spec.rb
|
|
124
|
+
- spec/helpers/ec2_mock.rb
|
|
125
|
+
- spec/helpers/remote_instance_mock.rb
|
|
126
|
+
- spec/kernel_spec.rb
|
|
127
|
+
- spec/master_spec.rb
|
|
128
|
+
- spec/monitor_spec.rb
|
|
129
|
+
- spec/optioner_spec.rb
|
|
130
|
+
- spec/poolparty_spec.rb
|
|
131
|
+
- spec/remote_instance_spec.rb
|
|
132
|
+
- spec/remoting_spec.rb
|
|
133
|
+
- spec/spec_helper.rb
|
|
134
|
+
- spec/string_spec.rb
|
|
135
|
+
- test/test_pool_party.rb
|
|
136
|
+
- poolparty.gemspec
|
|
137
|
+
has_rdoc: true
|
|
138
|
+
homepage: http://blog.citrusbyte.com
|
|
139
|
+
post_install_message: |-
|
|
140
|
+
For more information, check http://poolpartyrb.com
|
|
141
|
+
*** Ari Lerner @ <ari.lerner@citrusbyte.com> ***
|
|
142
|
+
rdoc_options:
|
|
143
|
+
- --line-numbers
|
|
144
|
+
- --inline-source
|
|
145
|
+
- --title
|
|
146
|
+
- Poolparty
|
|
147
|
+
- --main
|
|
148
|
+
- README.txt
|
|
149
|
+
require_paths:
|
|
150
|
+
- lib
|
|
151
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
152
|
+
requirements:
|
|
153
|
+
- - ">="
|
|
154
|
+
- !ruby/object:Gem::Version
|
|
155
|
+
version: "0"
|
|
156
|
+
version:
|
|
157
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
|
+
requirements:
|
|
159
|
+
- - ">="
|
|
160
|
+
- !ruby/object:Gem::Version
|
|
161
|
+
version: "0"
|
|
162
|
+
version:
|
|
163
|
+
requirements: []
|
|
164
|
+
|
|
165
|
+
rubyforge_project: poolparty
|
|
166
|
+
rubygems_version: 1.0.1
|
|
167
|
+
signing_key:
|
|
168
|
+
specification_version: 2
|
|
169
|
+
summary: Run your entire application off EC2, managed and auto-scaling
|
|
170
|
+
test_files:
|
|
171
|
+
- test/test_pool_party.rb
|