auser-poolparty 0.2.35 → 0.2.36
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +5 -9
- data/bin/cloud-start +1 -1
- data/lib/erlang/messenger/ebin/master_app.beam +0 -0
- data/lib/erlang/messenger/ebin/node_app.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_client.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_cluster.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_event_manager.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_master_event_handler.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_master_supervisor.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_node_supervisor.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_packager.beam +0 -0
- data/lib/erlang/messenger/src/pm_client.erl +19 -13
- data/lib/erlang/messenger/src/pm_cluster.erl +7 -6
- data/lib/erlang/messenger/src/pm_master.erl +5 -8
- data/lib/poolparty/aska/aska.rb +111 -0
- data/lib/poolparty/base_packages/poolparty.rb +23 -13
- data/lib/poolparty/core/array.rb +3 -0
- data/lib/poolparty/core/kernel.rb +2 -2
- data/lib/poolparty/core/object.rb +17 -1
- data/lib/poolparty/core/symbol.rb +6 -0
- data/lib/poolparty/helpers/provisioner_base.rb +3 -7
- data/lib/poolparty/helpers/provisioners/master.rb +9 -6
- data/lib/poolparty/helpers/provisioners/slave.rb +3 -4
- data/lib/poolparty/monitors/base_monitor.rb +32 -5
- data/lib/poolparty/{helpers → net}/messenger.rb +1 -1
- data/lib/poolparty/net/remoter.rb +4 -3
- data/lib/poolparty/pool/cloud.rb +1 -1
- data/lib/poolparty/pool/script.rb +1 -1
- data/lib/poolparty/templates/puppetcleaner +3 -1
- data/lib/poolparty/version.rb +1 -1
- data/lib/poolparty.rb +1 -1
- data/poolparty.gemspec +7 -11
- data/spec/poolparty/aska/aska_spec.rb +97 -0
- data/spec/poolparty/monitors/base_monitor_spec.rb +83 -2
- data/spec/poolparty/monitors/monitors/cpu_monitor_spec.rb +0 -1
- data/spec/poolparty/{helpers → net}/messenger_spec.rb +2 -0
- data/spec/poolparty/net/remote_bases/ec2_spec.rb +3 -2
- data/spec/poolparty/net/remote_instance_spec.rb +1 -0
- data/spec/poolparty/net/remote_spec.rb +8 -1
- data/spec/poolparty/net/remoter_base_spec.rb +4 -1
- data/spec/poolparty/net/remoter_spec.rb +5 -0
- data/spec/poolparty/pool/cloud_spec.rb +2 -0
- data/spec/poolparty/pool/plugin_model_spec.rb +1 -0
- data/spec/poolparty/pool/resource_spec.rb +3 -0
- data/spec/poolparty/pool/script_spec.rb +14 -2
- data/spec/poolparty/spec_helper.rb +13 -1
- data/website/index.html +1 -1
- metadata +7 -11
- data/lib/erlang/messenger/utils.beam +0 -0
data/lib/poolparty/pool/cloud.rb
CHANGED
@@ -154,7 +154,7 @@ module PoolParty
|
|
154
154
|
# they need a few options to run, these are the required options
|
155
155
|
# to be saved on the remote "master" machine
|
156
156
|
def minimum_runnable_options
|
157
|
-
[:keypair, :minimum_instances, :maximum_instances]
|
157
|
+
[:keypair, :minimum_instances, :maximum_instances, :ami, :expand_when, :contract_when]
|
158
158
|
end
|
159
159
|
|
160
160
|
# Add all the poolparty requirements here
|
@@ -26,7 +26,7 @@ module PoolParty
|
|
26
26
|
with_cloud(cl) do
|
27
27
|
out << <<-EOE
|
28
28
|
cloud :#{name} do
|
29
|
-
#{cl.minimum_runnable_options.map {|o| "\t#{o}
|
29
|
+
#{cl.minimum_runnable_options.map {|o| "\t#{o} #{cl.send(o).respec_string}"}.join("\n")}
|
30
30
|
end
|
31
31
|
EOE
|
32
32
|
end
|
data/lib/poolparty/version.rb
CHANGED
data/lib/poolparty.rb
CHANGED
@@ -16,7 +16,7 @@ ActiveSupport::Dependencies.load_paths << File.dirname(__FILE__)
|
|
16
16
|
## Load PoolParty
|
17
17
|
require "#{File.dirname(__FILE__)}/poolparty/version"
|
18
18
|
|
19
|
-
%w(core modules exceptions dependency_resolutions monitors net).each do |dir|
|
19
|
+
%w(core modules exceptions aska dependency_resolutions monitors net).each do |dir|
|
20
20
|
Dir[File.dirname(__FILE__) + "/poolparty/#{dir}/**.rb"].each do |file|
|
21
21
|
require file
|
22
22
|
end
|
data/poolparty.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poolparty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ari Lerner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-
|
12
|
+
date: 2008-10-31 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- bin/server-start-node
|
138
138
|
- config/hoe.rb
|
139
139
|
- config/requirements.rb
|
140
|
+
- erl_crash.dump
|
140
141
|
- examples/basic.rb
|
141
142
|
- examples/plugin_without_plugin_directory.rb
|
142
143
|
- examples/poolparty.rb
|
@@ -243,8 +244,8 @@ files:
|
|
243
244
|
- lib/erlang/messenger/src/pm_packager.erl
|
244
245
|
- lib/erlang/messenger/src/utils.erl
|
245
246
|
- lib/erlang/messenger/useful_snippets
|
246
|
-
- lib/erlang/messenger/utils.beam
|
247
247
|
- lib/poolparty.rb
|
248
|
+
- lib/poolparty/aska/aska.rb
|
248
249
|
- lib/poolparty/base_packages/haproxy.rb
|
249
250
|
- lib/poolparty/base_packages/heartbeat.rb
|
250
251
|
- lib/poolparty/base_packages/poolparty.rb
|
@@ -276,7 +277,6 @@ files:
|
|
276
277
|
- lib/poolparty/helpers/binary.rb
|
277
278
|
- lib/poolparty/helpers/console.rb
|
278
279
|
- lib/poolparty/helpers/display.rb
|
279
|
-
- lib/poolparty/helpers/messenger.rb
|
280
280
|
- lib/poolparty/helpers/optioner.rb
|
281
281
|
- lib/poolparty/helpers/provisioner_base.rb
|
282
282
|
- lib/poolparty/helpers/provisioners/master.rb
|
@@ -294,6 +294,7 @@ files:
|
|
294
294
|
- lib/poolparty/monitors/base_monitor.rb
|
295
295
|
- lib/poolparty/monitors/monitors/cpu_monitor.rb
|
296
296
|
- lib/poolparty/monitors/monitors/memory_monitor.rb
|
297
|
+
- lib/poolparty/net/messenger.rb
|
297
298
|
- lib/poolparty/net/remote.rb
|
298
299
|
- lib/poolparty/net/remote_bases/ec2.rb
|
299
300
|
- lib/poolparty/net/remote_instance.rb
|
@@ -325,12 +326,6 @@ files:
|
|
325
326
|
- lib/poolparty/pool/resources/symlink.rb
|
326
327
|
- lib/poolparty/pool/resources/variable.rb
|
327
328
|
- lib/poolparty/pool/script.rb
|
328
|
-
- lib/poolparty/pool/tmp/.ppkeys
|
329
|
-
- lib/poolparty/pool/tmp/happydayz
|
330
|
-
- lib/poolparty/pool/tmp/install_master.sh
|
331
|
-
- lib/poolparty/pool/tmp/pool.spec
|
332
|
-
- lib/poolparty/pool/tmp/poolparty.pp
|
333
|
-
- lib/poolparty/pool/tmp/tc-instances.list
|
334
329
|
- lib/poolparty/templates/authkeys
|
335
330
|
- lib/poolparty/templates/cib.xml
|
336
331
|
- lib/poolparty/templates/gem
|
@@ -348,6 +343,7 @@ files:
|
|
348
343
|
- script/generate
|
349
344
|
- script/txt2html
|
350
345
|
- setup.rb
|
346
|
+
- spec/poolparty/aska/aska_spec.rb
|
351
347
|
- spec/poolparty/base_packages/haproxy_spec.rb
|
352
348
|
- spec/poolparty/base_packages/heartbeat_spec.rb
|
353
349
|
- spec/poolparty/bin/console_spec.rb
|
@@ -362,7 +358,6 @@ files:
|
|
362
358
|
- spec/poolparty/dependency_resolutions/base_spec.rb
|
363
359
|
- spec/poolparty/helpers/binary_spec.rb
|
364
360
|
- spec/poolparty/helpers/display_spec.rb
|
365
|
-
- spec/poolparty/helpers/messenger_spec.rb
|
366
361
|
- spec/poolparty/helpers/optioner_spec.rb
|
367
362
|
- spec/poolparty/helpers/provisioner_base_spec.rb
|
368
363
|
- spec/poolparty/helpers/provisioners/master_spec.rb
|
@@ -374,6 +369,7 @@ files:
|
|
374
369
|
- spec/poolparty/modules/s3_string_spec.rb
|
375
370
|
- spec/poolparty/monitors/base_monitor_spec.rb
|
376
371
|
- spec/poolparty/monitors/monitors/cpu_monitor_spec.rb
|
372
|
+
- spec/poolparty/net/messenger_spec.rb
|
377
373
|
- spec/poolparty/net/remote_bases/ec2_spec.rb
|
378
374
|
- spec/poolparty/net/remote_instance_spec.rb
|
379
375
|
- spec/poolparty/net/remote_spec.rb
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
class Car
|
4
|
+
include Aska
|
5
|
+
rules :names, [
|
6
|
+
"x > 0",
|
7
|
+
"y > 0",
|
8
|
+
"x > y"
|
9
|
+
]
|
10
|
+
end
|
11
|
+
describe "Rules" do
|
12
|
+
before(:each) do
|
13
|
+
@car = Car.new
|
14
|
+
end
|
15
|
+
it "should be able to define rules as an array and they should be set as the rules on the class" do
|
16
|
+
@car.rules.class.should == Hash
|
17
|
+
end
|
18
|
+
it "should be able to look up the rules based on the name into an array" do
|
19
|
+
@car.names.class.should == Aska::Rules
|
20
|
+
end
|
21
|
+
it "should be able to turn them into a string" do
|
22
|
+
@car.names.to_s.should == "'x > 0', 'y > 0', 'x > y'"
|
23
|
+
end
|
24
|
+
it "should be able to say that rules are defined when they are defined" do
|
25
|
+
@car.names.should_not be_nil
|
26
|
+
end
|
27
|
+
it "should be able tos ay that rules are not defined when they are not defined" do
|
28
|
+
@car.look_up_rules(:cars_and_wheels).should be_empty
|
29
|
+
end
|
30
|
+
it "should be able to say if the rules are not rules" do
|
31
|
+
@car.are_rules?(:cars_and_wheels).should be_false
|
32
|
+
end
|
33
|
+
it "should be able to say that rules are rules" do
|
34
|
+
@car.are_rules?(:names).should be_true
|
35
|
+
end
|
36
|
+
describe "parsing" do
|
37
|
+
it "should be able to parse the x > 0 into an array" do
|
38
|
+
@car.names.include?({"x"=>[">","0"]}).should == true
|
39
|
+
end
|
40
|
+
it "should be able to parse y > 0 into an array" do
|
41
|
+
@car.names.include?({"y"=>[">","0"]}).should == true
|
42
|
+
end
|
43
|
+
it "should be able to parse x > y into the hash" do
|
44
|
+
@car.names.include?({"x"=>[">","y"]}).should == true
|
45
|
+
end
|
46
|
+
it "should have 3 rules" do
|
47
|
+
@car.names.size.should == 3
|
48
|
+
end
|
49
|
+
it "should be able to look up the names as a rule" do
|
50
|
+
Car.look_up_rules(:names).should == [{"x"=>[">", "0"]}, {"y"=>[">", "0"]}, {"x"=>[">", "y"]}]
|
51
|
+
end
|
52
|
+
end
|
53
|
+
# it "should use x if available instead of x_aska" do
|
54
|
+
# @car.x = 6
|
55
|
+
# @car.get_var(:x).class.should == @car.x_aska.class
|
56
|
+
# end
|
57
|
+
# it "should be able to get the variable associated with the instance and return it" do
|
58
|
+
# @car.x_aska = 4
|
59
|
+
# @car.get_var(:x).class.should == @car.x_aska.class
|
60
|
+
# end
|
61
|
+
it "should be able to get a number with the instance and return it as a float" do
|
62
|
+
@car.__aska_get_var(4).class.should == Float
|
63
|
+
end
|
64
|
+
it "should be able to get the method it's applying as a method symbol" do
|
65
|
+
@car.__aska_get_var(:<).class.should == Symbol
|
66
|
+
end
|
67
|
+
it "should be able to get the method as a symbol" do
|
68
|
+
@car.__aska_get_var("<").class.should == Symbol
|
69
|
+
end
|
70
|
+
it "should be able to retrieve the value of the rule when checking if it's valid" do
|
71
|
+
@car.x = 10
|
72
|
+
@car.valid_rule?({:x => [:==, 10]}).should == true
|
73
|
+
end
|
74
|
+
it "should be able to apply the rules and say that they are not met when they aren't" do
|
75
|
+
@car.valid_rules?(:names).should == false
|
76
|
+
end
|
77
|
+
it "should be able to apply the rules and say they aren't valid when they aren't all met" do
|
78
|
+
@car.x = 5
|
79
|
+
@car.y = 10
|
80
|
+
@car.valid_rules?(:names).should == true
|
81
|
+
end
|
82
|
+
it "should be able to apply the rules and say they aren't valid when they aren't all met" do
|
83
|
+
@car.x = 5
|
84
|
+
@car.y = 0
|
85
|
+
@car.valid_rules?(:names).should == false
|
86
|
+
end
|
87
|
+
it "should be able to apply the rules and say that they are in fact valid" do
|
88
|
+
@car.x = 10
|
89
|
+
@car.y = 5
|
90
|
+
@car.valid_rules?(:names).should == true
|
91
|
+
end
|
92
|
+
it "should have the rules in an array of hashes" do
|
93
|
+
@car.names.each do |n|
|
94
|
+
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -1,6 +1,12 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../spec_helper'
|
2
2
|
|
3
|
-
|
3
|
+
class TestMonitorClass
|
4
|
+
include PoolParty::Monitors
|
5
|
+
include Configurable
|
6
|
+
def default_options
|
7
|
+
{}
|
8
|
+
end
|
9
|
+
end
|
4
10
|
|
5
11
|
describe "Monitors" do
|
6
12
|
it "should have a list of available monitors" do
|
@@ -11,9 +17,84 @@ describe "Monitors" do
|
|
11
17
|
PoolParty::Monitors.register_monitor :fake
|
12
18
|
size.should == PoolParty::Monitors.available_monitors.size - 1
|
13
19
|
end
|
20
|
+
it "should define the mehtod fake when register_monitor :fake" do
|
21
|
+
PoolParty::Monitors.register_monitor :fake
|
22
|
+
TestMonitorClass.new.respond_to?(:fake).should == true
|
23
|
+
end
|
24
|
+
it "should call the Messenger with messenger_send!('get_load fake')" do
|
25
|
+
PoolParty::Messenger.should_receive(:messenger_send!).with("get_load fake").and_return true
|
26
|
+
TestMonitorClass.new.fake
|
27
|
+
end
|
28
|
+
describe "expansions" do
|
29
|
+
before(:each) do
|
30
|
+
@tmc = TestMonitorClass.new
|
31
|
+
@tmc.instance_eval do
|
32
|
+
expand_when "cpu > 95", "memory > 90"
|
33
|
+
contract_when "cpu < 15", "memory < 10"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
it "should have the method expand_when as a class method" do
|
37
|
+
@tmc.respond_to?(:expand_when).should == true
|
38
|
+
end
|
39
|
+
it "should have expansions as a collection of rules on the object" do
|
40
|
+
@tmc.expand_when.class.should == Aska::Rules
|
41
|
+
end
|
42
|
+
it "should return the expand_when as a set of rules" do
|
43
|
+
@tmc.expand_when.class.should == Aska::Rules
|
44
|
+
end
|
45
|
+
it "should have the expansion in the array on the instance" do
|
46
|
+
@tmc.expand_when.first.should == {"cpu" => [">", "95"]}
|
47
|
+
end
|
48
|
+
it "should have the memory expansion in the array on the instance" do
|
49
|
+
@tmc.expand_when[1].should == {"memory" => [">", "90"]}
|
50
|
+
end
|
51
|
+
it "should have 2 expansions" do
|
52
|
+
@tmc.expand_when.size.should == 2
|
53
|
+
end
|
54
|
+
it "should give us the method cpu for free" do
|
55
|
+
@tmc.respond_to?(:cpu).should == true
|
56
|
+
end
|
57
|
+
describe "when memory is over the limit" do
|
58
|
+
before(:each) do
|
59
|
+
@tmc.stub!(:memory).and_return 99
|
60
|
+
end
|
61
|
+
it "should say it should not expand if the cpu is short of the limit" do
|
62
|
+
@tmc.stub!(:cpu).and_return 43
|
63
|
+
@tmc.valid_rules?(:expand_when).should == false
|
64
|
+
end
|
65
|
+
it "should say that it has the valid expansion rules when the cpu is higher than the limit" do
|
66
|
+
@tmc.stub!(:cpu).and_return 98
|
67
|
+
@tmc.valid_rules?(:expand_when).should == true
|
68
|
+
end
|
69
|
+
end
|
70
|
+
describe "when cpu is over the limit" do
|
71
|
+
before(:each) do
|
72
|
+
@tmc.stub!(:cpu).and_return 98
|
73
|
+
end
|
74
|
+
it "should say it should not expand if the cpu is short of the limit" do
|
75
|
+
@tmc.stub!(:memory).and_return 43
|
76
|
+
@tmc.valid_rules?(:expand_when).should == false
|
77
|
+
end
|
78
|
+
it "should say that it has the valid expansion rules when the cpu is higher than the limit" do
|
79
|
+
@tmc.stub!(:memory).and_return 98
|
80
|
+
@tmc.valid_rules?(:expand_when).should == true
|
81
|
+
end
|
82
|
+
end
|
83
|
+
describe "when neither is over the limits" do
|
84
|
+
it "should not expand" do
|
85
|
+
@tmc.valid_rules?(:expand_when).should == false
|
86
|
+
end
|
87
|
+
end
|
88
|
+
it "should be able to turn them into a string" do
|
89
|
+
@tmc.expand_when.to_s.should == "'cpu > 95', 'memory > 90'"
|
90
|
+
end
|
91
|
+
it "should be able to turn them into a string with expand_when" do
|
92
|
+
@tmc.expand_when.to_s.should == "'cpu > 95', 'memory > 90'"
|
93
|
+
end
|
94
|
+
end
|
14
95
|
end
|
15
96
|
describe "BaseMonitor" do
|
16
97
|
it "should have the singleton method run defined" do
|
17
|
-
BaseMonitor.respond_to?(:run).should == true
|
98
|
+
PoolParty::Monitors::BaseMonitor.respond_to?(:run).should == true
|
18
99
|
end
|
19
100
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
2
|
|
3
|
-
include Remote
|
3
|
+
# include Remote
|
4
4
|
|
5
5
|
class TestClass
|
6
|
-
include RemoterBase
|
6
|
+
include PoolParty::Remote::RemoterBase
|
7
7
|
include Ec2
|
8
8
|
include CloudResourcer
|
9
9
|
|
@@ -20,6 +20,7 @@ class TestClass
|
|
20
20
|
end
|
21
21
|
describe "ec2 remote base" do
|
22
22
|
before(:each) do
|
23
|
+
setup
|
23
24
|
@tr = TestClass.new
|
24
25
|
stub_remoter_for(@tr)
|
25
26
|
@tr.stub!(:get_instances_description).and_return response_list_of_instances
|
@@ -16,12 +16,16 @@ class TestClass
|
|
16
16
|
def keypair
|
17
17
|
"fake_keypair"
|
18
18
|
end
|
19
|
+
def verbose
|
20
|
+
false
|
21
|
+
end
|
19
22
|
end
|
20
23
|
|
21
24
|
describe "Remote" do
|
22
25
|
before(:each) do
|
23
26
|
@tc = TestClass.new
|
24
|
-
|
27
|
+
@tc.stub!(:verbose).and_return false
|
28
|
+
setup
|
25
29
|
end
|
26
30
|
it "should have the method 'using'" do
|
27
31
|
@tc.respond_to?(:using).should == true
|
@@ -192,6 +196,7 @@ describe "Remote" do
|
|
192
196
|
end
|
193
197
|
describe "expansions" do
|
194
198
|
before(:each) do
|
199
|
+
setup
|
195
200
|
@tc.stub!(:copy_ssh_app).and_return true
|
196
201
|
@tc.stub!(:prepare_reconfiguration).and_return "full"
|
197
202
|
PoolParty::Provisioner.stub!(:reconfigure_master).and_return true
|
@@ -206,6 +211,7 @@ describe "Remote" do
|
|
206
211
|
end
|
207
212
|
describe "expand_cloud_if_necessary" do
|
208
213
|
before(:each) do
|
214
|
+
setup
|
209
215
|
stub_list_from_remote_for(@tc)
|
210
216
|
@tc.stub!(:request_launch_new_instances).and_return true
|
211
217
|
@tc.stub!(:can_start_a_new_instance).and_return true
|
@@ -241,6 +247,7 @@ describe "Remote" do
|
|
241
247
|
@tc.stub!(:request_termination_of_non_master_instance).and_return true
|
242
248
|
@tc.stub!(:can_shutdown_an_instance?).and_return true
|
243
249
|
@tc.stub!(:wait).and_return true
|
250
|
+
@tc.stub!(:valid_rules?).and_return false
|
244
251
|
end
|
245
252
|
it "should receive can_shutdown_an_instance?" do
|
246
253
|
@tc.should_receive(:can_shutdown_an_instance?).once
|
@@ -7,9 +7,12 @@ class TestRemoter
|
|
7
7
|
end
|
8
8
|
|
9
9
|
describe "RemoterBase" do
|
10
|
+
before(:each) do
|
11
|
+
setup
|
12
|
+
end
|
10
13
|
describe "methods" do
|
11
14
|
before(:each) do
|
12
|
-
@tr = TestRemoter.new
|
15
|
+
@tr = TestRemoter.new
|
13
16
|
end
|
14
17
|
%w(launch_new_instance! terminate_instance describe_instance instances_list).each do |method|
|
15
18
|
eval <<-EOE
|
@@ -2,6 +2,10 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
2
|
|
3
3
|
include PoolParty::Remote
|
4
4
|
|
5
|
+
def valid_rules?(*args)
|
6
|
+
false
|
7
|
+
end
|
8
|
+
|
5
9
|
class TestClass
|
6
10
|
include CloudResourcer
|
7
11
|
include Remote
|
@@ -14,6 +18,7 @@ class TestClass
|
|
14
18
|
end
|
15
19
|
describe "Remoter" do
|
16
20
|
before(:each) do
|
21
|
+
setup
|
17
22
|
@cloud = cloud :app do;end
|
18
23
|
@tc = TestClass.new
|
19
24
|
@tc.parent = @cloud
|
@@ -13,6 +13,7 @@ end
|
|
13
13
|
|
14
14
|
describe "Cloud" do
|
15
15
|
before(:each) do
|
16
|
+
setup
|
16
17
|
reset_resources!
|
17
18
|
end
|
18
19
|
describe "wrapped" do
|
@@ -47,6 +48,7 @@ describe "Cloud" do
|
|
47
48
|
describe "options" do
|
48
49
|
before(:each) do
|
49
50
|
reset!
|
51
|
+
setup
|
50
52
|
@p = pool :options do
|
51
53
|
minimum_instances 100
|
52
54
|
access_key "access_key"
|
@@ -5,6 +5,7 @@ include PoolParty::Resources
|
|
5
5
|
describe "Script" do
|
6
6
|
before(:each) do
|
7
7
|
reset_resources!
|
8
|
+
setup
|
8
9
|
end
|
9
10
|
describe "wrapped" do
|
10
11
|
it "should have inflate as a class method" do
|
@@ -43,16 +44,27 @@ describe "Script" do
|
|
43
44
|
before(:each) do
|
44
45
|
reset!
|
45
46
|
reset_resources!
|
46
|
-
pool :
|
47
|
+
pool :appdotcomcoo do
|
47
48
|
keypair "snoodle"
|
49
|
+
ami "ami-123456"
|
50
|
+
|
48
51
|
cloud :app do
|
52
|
+
expand_when "cpu > 90", "memory > 80"
|
53
|
+
contract_when "cpu < 10", "memory < 10"
|
54
|
+
|
49
55
|
has_file :name => "/etc/httpd/httpd.conf"
|
50
56
|
end
|
51
57
|
end
|
52
58
|
@saved = Script.save!(false)
|
53
59
|
end
|
54
60
|
it "should save the keypair" do
|
55
|
-
@saved.should =~ /keypair
|
61
|
+
@saved.should =~ /keypair 'snoodle'/
|
62
|
+
end
|
63
|
+
it "should save the ami" do
|
64
|
+
@saved.should =~ /ami 'ami-123456'/
|
65
|
+
end
|
66
|
+
it "should save the expansions" do
|
67
|
+
@saved.should =~ /expand_when 'cpu>90', 'memory>80'/
|
56
68
|
end
|
57
69
|
end
|
58
70
|
end
|
@@ -17,6 +17,10 @@ extend PoolParty
|
|
17
17
|
Base.environment = "test"
|
18
18
|
Base.verbose = false
|
19
19
|
|
20
|
+
def setup
|
21
|
+
PoolParty::Messenger.stub!(:messenger_send!).and_return false
|
22
|
+
end
|
23
|
+
|
20
24
|
def setup_cl
|
21
25
|
require 'poolpartycl'
|
22
26
|
end
|
@@ -62,7 +66,7 @@ def stub_list_from_local_for(o)
|
|
62
66
|
@ris = @list.split(/\n/).map {|line| PoolParty::Remote::RemoteInstance.new(line) }
|
63
67
|
end
|
64
68
|
def stub_remoter_for(o)
|
65
|
-
o.stub!(:ec2).and_return EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "even more not a key")
|
69
|
+
o.stub!(:ec2).and_return EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "even more not a key")
|
66
70
|
end
|
67
71
|
def stub_list_from_remote_for(o, launch_stub=true)
|
68
72
|
stub_remoter_for(o)
|
@@ -99,6 +103,7 @@ def running_remote_instances
|
|
99
103
|
end
|
100
104
|
|
101
105
|
def reset_response!
|
106
|
+
setup
|
102
107
|
@ris = nil
|
103
108
|
end
|
104
109
|
|
@@ -122,4 +127,11 @@ def drop_pending_instances_for(o)
|
|
122
127
|
puts "hi"
|
123
128
|
o.list_of_pending_instances.stub!(:size).and_return 0
|
124
129
|
1
|
130
|
+
end
|
131
|
+
|
132
|
+
# Stub for messenger_send!
|
133
|
+
class Object
|
134
|
+
def messenger_send!(*args)
|
135
|
+
true
|
136
|
+
end
|
125
137
|
end
|
data/website/index.html
CHANGED
@@ -34,7 +34,7 @@
|
|
34
34
|
<h1>PoolParty</h1>
|
35
35
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/poolparty"; return false'>
|
36
36
|
<p>Get Version</p>
|
37
|
-
<a href="http://rubyforge.org/projects/poolparty" class="numbers">0.2.
|
37
|
+
<a href="http://rubyforge.org/projects/poolparty" class="numbers">0.2.36</a>
|
38
38
|
</div>
|
39
39
|
<h1>‘Easy cloud computing’</h1>
|
40
40
|
<h2>What</h2>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auser-poolparty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ari Lerner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-
|
12
|
+
date: 2008-10-31 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- bin/server-start-node
|
138
138
|
- config/hoe.rb
|
139
139
|
- config/requirements.rb
|
140
|
+
- erl_crash.dump
|
140
141
|
- examples/basic.rb
|
141
142
|
- examples/plugin_without_plugin_directory.rb
|
142
143
|
- examples/poolparty.rb
|
@@ -243,8 +244,8 @@ files:
|
|
243
244
|
- lib/erlang/messenger/src/pm_packager.erl
|
244
245
|
- lib/erlang/messenger/src/utils.erl
|
245
246
|
- lib/erlang/messenger/useful_snippets
|
246
|
-
- lib/erlang/messenger/utils.beam
|
247
247
|
- lib/poolparty.rb
|
248
|
+
- lib/poolparty/aska/aska.rb
|
248
249
|
- lib/poolparty/base_packages/haproxy.rb
|
249
250
|
- lib/poolparty/base_packages/heartbeat.rb
|
250
251
|
- lib/poolparty/base_packages/poolparty.rb
|
@@ -276,7 +277,6 @@ files:
|
|
276
277
|
- lib/poolparty/helpers/binary.rb
|
277
278
|
- lib/poolparty/helpers/console.rb
|
278
279
|
- lib/poolparty/helpers/display.rb
|
279
|
-
- lib/poolparty/helpers/messenger.rb
|
280
280
|
- lib/poolparty/helpers/optioner.rb
|
281
281
|
- lib/poolparty/helpers/provisioner_base.rb
|
282
282
|
- lib/poolparty/helpers/provisioners/master.rb
|
@@ -294,6 +294,7 @@ files:
|
|
294
294
|
- lib/poolparty/monitors/base_monitor.rb
|
295
295
|
- lib/poolparty/monitors/monitors/cpu_monitor.rb
|
296
296
|
- lib/poolparty/monitors/monitors/memory_monitor.rb
|
297
|
+
- lib/poolparty/net/messenger.rb
|
297
298
|
- lib/poolparty/net/remote.rb
|
298
299
|
- lib/poolparty/net/remote_bases/ec2.rb
|
299
300
|
- lib/poolparty/net/remote_instance.rb
|
@@ -325,12 +326,6 @@ files:
|
|
325
326
|
- lib/poolparty/pool/resources/symlink.rb
|
326
327
|
- lib/poolparty/pool/resources/variable.rb
|
327
328
|
- lib/poolparty/pool/script.rb
|
328
|
-
- lib/poolparty/pool/tmp/.ppkeys
|
329
|
-
- lib/poolparty/pool/tmp/happydayz
|
330
|
-
- lib/poolparty/pool/tmp/install_master.sh
|
331
|
-
- lib/poolparty/pool/tmp/pool.spec
|
332
|
-
- lib/poolparty/pool/tmp/poolparty.pp
|
333
|
-
- lib/poolparty/pool/tmp/tc-instances.list
|
334
329
|
- lib/poolparty/templates/authkeys
|
335
330
|
- lib/poolparty/templates/cib.xml
|
336
331
|
- lib/poolparty/templates/gem
|
@@ -348,6 +343,7 @@ files:
|
|
348
343
|
- script/generate
|
349
344
|
- script/txt2html
|
350
345
|
- setup.rb
|
346
|
+
- spec/poolparty/aska/aska_spec.rb
|
351
347
|
- spec/poolparty/base_packages/haproxy_spec.rb
|
352
348
|
- spec/poolparty/base_packages/heartbeat_spec.rb
|
353
349
|
- spec/poolparty/bin/console_spec.rb
|
@@ -362,7 +358,6 @@ files:
|
|
362
358
|
- spec/poolparty/dependency_resolutions/base_spec.rb
|
363
359
|
- spec/poolparty/helpers/binary_spec.rb
|
364
360
|
- spec/poolparty/helpers/display_spec.rb
|
365
|
-
- spec/poolparty/helpers/messenger_spec.rb
|
366
361
|
- spec/poolparty/helpers/optioner_spec.rb
|
367
362
|
- spec/poolparty/helpers/provisioner_base_spec.rb
|
368
363
|
- spec/poolparty/helpers/provisioners/master_spec.rb
|
@@ -374,6 +369,7 @@ files:
|
|
374
369
|
- spec/poolparty/modules/s3_string_spec.rb
|
375
370
|
- spec/poolparty/monitors/base_monitor_spec.rb
|
376
371
|
- spec/poolparty/monitors/monitors/cpu_monitor_spec.rb
|
372
|
+
- spec/poolparty/net/messenger_spec.rb
|
377
373
|
- spec/poolparty/net/remote_bases/ec2_spec.rb
|
378
374
|
- spec/poolparty/net/remote_instance_spec.rb
|
379
375
|
- spec/poolparty/net/remote_spec.rb
|
Binary file
|