auser-poolparty 0.2.16 → 0.2.20

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.
Files changed (139) hide show
  1. data/Manifest.txt +72 -7
  2. data/PostInstall.txt +1 -1
  3. data/Rakefile +11 -0
  4. data/bin/cloud-provision +6 -10
  5. data/bin/server-build-messenger +20 -0
  6. data/bin/server-fire-cmd +0 -2
  7. data/bin/server-list-responding +24 -0
  8. data/bin/server-start-master +4 -9
  9. data/bin/server-start-node +7 -6
  10. data/lib/erlang/messenger/Emakefile +1 -0
  11. data/lib/erlang/messenger/Rakefile +29 -20
  12. data/lib/erlang/messenger/ebin/master_app.beam +0 -0
  13. data/lib/erlang/messenger/ebin/node_app.beam +0 -0
  14. data/lib/erlang/messenger/ebin/packager.app +19 -0
  15. data/lib/erlang/messenger/ebin/pm_client.beam +0 -0
  16. data/lib/erlang/messenger/ebin/pm_cluster.beam +0 -0
  17. data/lib/erlang/messenger/ebin/pm_event_handler.beam +0 -0
  18. data/lib/erlang/messenger/ebin/pm_master.beam +0 -0
  19. data/lib/erlang/messenger/ebin/pm_master_rel-0.1.rel +1 -7
  20. data/lib/erlang/messenger/ebin/pm_master_supervisor.beam +0 -0
  21. data/lib/erlang/messenger/ebin/pm_node.beam +0 -0
  22. data/lib/erlang/messenger/ebin/pm_node_rel-0.1.rel +1 -7
  23. data/lib/erlang/messenger/ebin/pm_node_supervisor.beam +0 -0
  24. data/lib/erlang/messenger/ebin/pm_packager.beam +0 -0
  25. data/lib/erlang/messenger/ebin/utils.beam +0 -0
  26. data/lib/erlang/messenger/lib/eunit/AUTHORS +2 -0
  27. data/lib/erlang/messenger/lib/eunit/CHANGELOG +14 -0
  28. data/lib/erlang/messenger/lib/eunit/COPYING +504 -0
  29. data/lib/erlang/messenger/lib/eunit/Makefile +28 -0
  30. data/lib/erlang/messenger/lib/eunit/NOTES +276 -0
  31. data/lib/erlang/messenger/lib/eunit/README +3 -0
  32. data/lib/erlang/messenger/lib/eunit/doc/edoc-info +3 -0
  33. data/lib/erlang/messenger/lib/eunit/doc/erlang.png +0 -0
  34. data/lib/erlang/messenger/lib/eunit/doc/eunit.html +172 -0
  35. data/lib/erlang/messenger/lib/eunit/doc/index.html +17 -0
  36. data/lib/erlang/messenger/lib/eunit/doc/modules-frame.html +12 -0
  37. data/lib/erlang/messenger/lib/eunit/doc/overview-summary.html +984 -0
  38. data/lib/erlang/messenger/lib/eunit/doc/overview.edoc +980 -0
  39. data/lib/erlang/messenger/lib/eunit/doc/packages-frame.html +11 -0
  40. data/lib/erlang/messenger/lib/eunit/doc/stylesheet.css +55 -0
  41. data/lib/erlang/messenger/lib/eunit/ebin/autoload.beam +0 -0
  42. data/lib/erlang/messenger/lib/eunit/ebin/code_monitor.beam +0 -0
  43. data/lib/erlang/messenger/lib/eunit/ebin/eunit.app +21 -0
  44. data/lib/erlang/messenger/lib/eunit/ebin/eunit.appup +1 -0
  45. data/lib/erlang/messenger/lib/eunit/ebin/eunit.beam +0 -0
  46. data/lib/erlang/messenger/lib/eunit/ebin/eunit_autoexport.beam +0 -0
  47. data/lib/erlang/messenger/lib/eunit/ebin/eunit_data.beam +0 -0
  48. data/lib/erlang/messenger/lib/eunit/ebin/eunit_lib.beam +0 -0
  49. data/lib/erlang/messenger/lib/eunit/ebin/eunit_proc.beam +0 -0
  50. data/lib/erlang/messenger/lib/eunit/ebin/eunit_serial.beam +0 -0
  51. data/lib/erlang/messenger/lib/eunit/ebin/eunit_server.beam +0 -0
  52. data/lib/erlang/messenger/lib/eunit/ebin/eunit_striptests.beam +0 -0
  53. data/lib/erlang/messenger/lib/eunit/ebin/eunit_test.beam +0 -0
  54. data/lib/erlang/messenger/lib/eunit/ebin/eunit_tests.beam +0 -0
  55. data/lib/erlang/messenger/lib/eunit/ebin/eunit_tty.beam +0 -0
  56. data/lib/erlang/messenger/lib/eunit/ebin/file_monitor.beam +0 -0
  57. data/lib/erlang/messenger/lib/eunit/examples/eunit_examples.erl +339 -0
  58. data/lib/erlang/messenger/lib/eunit/examples/fib.erl +19 -0
  59. data/lib/erlang/messenger/lib/eunit/examples/tests.txt +1 -0
  60. data/lib/erlang/messenger/lib/eunit/include/eunit.hrl +313 -0
  61. data/lib/erlang/messenger/lib/eunit/src/Makefile +46 -0
  62. data/lib/erlang/messenger/lib/eunit/src/autoload.erl +388 -0
  63. data/lib/erlang/messenger/lib/eunit/src/code_monitor.erl +243 -0
  64. data/lib/erlang/messenger/lib/eunit/src/eunit.app.src +21 -0
  65. data/lib/erlang/messenger/lib/eunit/src/eunit.appup.src +1 -0
  66. data/lib/erlang/messenger/lib/eunit/src/eunit.erl +196 -0
  67. data/lib/erlang/messenger/lib/eunit/src/eunit_autoexport.erl +102 -0
  68. data/lib/erlang/messenger/lib/eunit/src/eunit_data.erl +798 -0
  69. data/lib/erlang/messenger/lib/eunit/src/eunit_internal.hrl +48 -0
  70. data/lib/erlang/messenger/lib/eunit/src/eunit_lib.erl +682 -0
  71. data/lib/erlang/messenger/lib/eunit/src/eunit_proc.erl +552 -0
  72. data/lib/erlang/messenger/lib/eunit/src/eunit_serial.erl +157 -0
  73. data/lib/erlang/messenger/lib/eunit/src/eunit_server.erl +340 -0
  74. data/lib/erlang/messenger/lib/eunit/src/eunit_striptests.erl +64 -0
  75. data/lib/erlang/messenger/lib/eunit/src/eunit_test.erl +334 -0
  76. data/lib/erlang/messenger/lib/eunit/src/eunit_tests.erl +45 -0
  77. data/lib/erlang/messenger/lib/eunit/src/eunit_tty.erl +272 -0
  78. data/lib/erlang/messenger/lib/eunit/src/file_monitor.erl +409 -0
  79. data/lib/erlang/messenger/lib/eunit/sys.config +9 -0
  80. data/lib/erlang/messenger/lib/eunit/vsn.mk +1 -0
  81. data/lib/erlang/messenger/pm_master_rel-0.1.boot +0 -0
  82. data/lib/erlang/messenger/pm_master_rel-0.1.script +75 -2
  83. data/lib/erlang/messenger/pm_node_rel-0.1.boot +0 -0
  84. data/lib/erlang/messenger/pm_node_rel-0.1.script +75 -2
  85. data/lib/erlang/messenger/src/pm_client.erl +8 -3
  86. data/lib/erlang/messenger/src/pm_cluster.erl +32 -9
  87. data/lib/erlang/messenger/src/pm_master.erl +10 -11
  88. data/lib/erlang/messenger/src/pm_node.erl +2 -3
  89. data/lib/erlang/messenger/src/pm_packager.erl +73 -0
  90. data/lib/erlang/messenger/src/utils.erl +3 -10
  91. data/lib/poolparty/base_packages/heartbeat.rb +9 -9
  92. data/lib/poolparty/base_packages/poolparty.rb +16 -10
  93. data/lib/poolparty/config/allowed_commands.yml +1 -0
  94. data/lib/poolparty/core/object.rb +8 -0
  95. data/lib/poolparty/exceptions/UnacceptableCommand.rb +5 -0
  96. data/lib/poolparty/helpers/messenger.rb +29 -0
  97. data/lib/poolparty/helpers/provisioner_base.rb +7 -7
  98. data/lib/poolparty/helpers/provisioners/master.rb +3 -7
  99. data/lib/poolparty/helpers/provisioners/slave.rb +1 -0
  100. data/lib/poolparty/modules/cloud_resourcer.rb +7 -5
  101. data/lib/poolparty/modules/configurable.rb +1 -1
  102. data/lib/poolparty/modules/method_missing_sugar.rb +6 -1
  103. data/lib/poolparty/modules/pretty_printer.rb +1 -0
  104. data/lib/poolparty/modules/resourcing_dsl.rb +2 -1
  105. data/lib/poolparty/monitors/monitors/cpu_monitor.rb +1 -1
  106. data/lib/poolparty/net/remoter.rb +3 -1
  107. data/lib/poolparty/plugins/git.rb +3 -3
  108. data/lib/poolparty/pool/base.rb +7 -2
  109. data/lib/poolparty/pool/cloud.rb +3 -3
  110. data/lib/poolparty/pool/resource.rb +38 -24
  111. data/lib/poolparty/pool/resources/class_package.rb +2 -2
  112. data/lib/poolparty/pool/resources/conditional.rb +8 -4
  113. data/lib/poolparty/pool/resources/{gem.rb → gem_package.rb} +0 -0
  114. data/lib/poolparty/pool/resources/package.rb +8 -1
  115. data/lib/poolparty/version.rb +1 -1
  116. data/lib/poolparty.rb +1 -1
  117. data/poolparty.gemspec +476 -61
  118. data/spec/poolparty/core/object_spec.rb +20 -0
  119. data/spec/poolparty/helpers/messenger_spec.rb +14 -0
  120. data/spec/poolparty/helpers/provisioners/master_spec.rb +2 -2
  121. data/spec/poolparty/net/remoter_spec.rb +1 -1
  122. data/spec/poolparty/plugins/git_spec.rb +26 -19
  123. data/spec/poolparty/pool/base_spec.rb +20 -2
  124. data/spec/poolparty/pool/cloud_spec.rb +256 -249
  125. data/spec/poolparty/pool/custom_resource_spec.rb +6 -1
  126. data/spec/poolparty/pool/plugin_spec.rb +71 -65
  127. data/spec/poolparty/pool/resource_spec.rb +314 -237
  128. data/spec/poolparty/pool/resources/class_package_spec.rb +71 -66
  129. data/spec/poolparty/pool/resources/conditional_spec.rb +30 -26
  130. data/spec/poolparty/pool/resources/gem_spec.rb +18 -14
  131. data/spec/poolparty/pool/resources/variable_spec.rb +1 -1
  132. data/spec/poolparty/pool/script_spec.rb +46 -37
  133. data/spec/poolparty/spec_helper.rb +4 -0
  134. data/tasks/cloud.rake +0 -54
  135. data/tasks/development.rake +11 -14
  136. data/tasks/ec2.rake +10 -17
  137. data/tasks/instance.rake +0 -61
  138. data/website/index.html +1 -1
  139. metadata +83 -10
@@ -4,81 +4,86 @@ include PoolParty::Resources
4
4
 
5
5
  describe "File" do
6
6
  before(:each) do
7
- reset!
8
- @class = PoolParty::Resources::Classpackage.new({:name => "rockstar"})
7
+ reset_resources!
9
8
  end
10
- it "should have a method resources" do
11
- @class.respond_to?(:resources).should == true
12
- end
13
- it "should store the resources in an array" do
14
- @class.resources.class.should == Hash
15
- end
16
- describe "with resources" do
17
- before(:each) do
18
- cloud :application_cloud do
19
- classpackage do
20
- file({:name => "red"})
9
+ describe "wrapped" do
10
+ before(:each) do
11
+ reset!
12
+ @class = PoolParty::Resources::Classpackage.new({:name => "rockstar"})
13
+ end
14
+ it "should have a method resources" do
15
+ @class.respond_to?(:resources).should == true
16
+ end
17
+ it "should store the resources in an array" do
18
+ @class.resources.class.should == Hash
19
+ end
20
+ describe "with resources" do
21
+ before(:each) do
22
+ cloud :application_cloud do
23
+ classpackage do
24
+ file({:name => "red"})
25
+ end
26
+ end
27
+ @class = cloud(:application_cloud).resource(:classpackage).first
28
+ end
29
+ it "should store a resource in the resources array" do
30
+ @class.resources.size.should == 1
31
+ end
32
+ it "should have a file resource in the cloud" do
33
+ @class.resource(:file).should_not == nil
34
+ end
35
+ describe "to_s" do
36
+ before(:each) do
37
+ @class.instance_eval do
38
+ name "rockstar"
39
+ file({:name => "red"}) do; end
40
+ end
41
+ end
42
+ it "should output the class with the name as class [name]" do
43
+ @class.to_string.should =~ /class rockstar/
44
+ end
45
+ after do
46
+ @class.to_string
47
+ end
21
48
  end
22
49
  end
23
- @class = cloud(:application_cloud).resource(:classpackage).first
24
- end
25
- it "should store a resource in the resources array" do
26
- @class.resources.size.should == 1
27
50
  end
28
- it "should have a file resource in the cloud" do
29
- @class.resource(:file).should_not == nil
30
- end
31
- describe "to_s" do
51
+ describe "setting with a block" do
32
52
  before(:each) do
33
- @class.instance_eval do
34
- name "rockstar"
35
- file({:name => "red"}) do; end
53
+ @class1 = classpackage do
54
+ name "my_class"
55
+ file({:name => "frank"})
36
56
  end
37
57
  end
38
- it "should output the class with the name as class [name]" do
39
- @class.to_string.should =~ /class rockstar/
58
+ it "should set the name when set" do
59
+ @class1.name.should == "my_class"
40
60
  end
41
- after do
42
- @class.to_string
61
+ it "should have the file resource in the resources class" do
62
+ @class1.resources.size.should_not be_zero
63
+ end
64
+ it "should have the file resource in the resources array" do
65
+ @class1.resource(:file).class.should == Array
66
+ end
67
+ it "should store the file in the resources array" do
68
+ @class1.resource(:file).get_named("frank").first.name.should == "frank"
43
69
  end
44
70
  end
45
- end
46
- end
47
- describe "setting with a block" do
48
- before(:each) do
49
- @class1 = classpackage do
50
- name "my_class"
51
- file({:name => "frank"})
52
- end
53
- end
54
- it "should set the name when set" do
55
- @class1.name.should == "my_class"
56
- end
57
- it "should have the file resource in the resources class" do
58
- @class1.resources.size.should_not be_zero
59
- end
60
- it "should have the file resource in the resources array" do
61
- @class1.resource(:file).class.should == Array
62
- end
63
- it "should store the file in the resources array" do
64
- @class1.resource(:file).get_named("frank").first.name.should == "frank"
65
- end
66
- end
67
- describe "from a collection of resources to another" do
68
- before(:each) do
69
- self.stub!(:options).and_return({:name => "cook"})
70
- file(:name => "franksfile")
71
- exec(:name => "get file", :command => "kill frank for file")
72
- end
73
- it "should have the method classpackage_with_self" do
74
- self.respond_to?(:classpackage_with_self).should == true
75
- end
76
- it "should transfer the resources to the class" do
77
- @class2 = classpackage_with_self(self)
78
- @class2.resources.should_not be_empty
79
- end
80
- it "should leave zero resources on the parent" do
81
- @class2 = classpackage_with_self(self)
82
- resources.should be_empty
71
+ describe "from a collection of resources to another" do
72
+ before(:each) do
73
+ self.stub!(:options).and_return({:name => "cook"})
74
+ file(:name => "franksfile")
75
+ exec(:name => "get file", :command => "kill frank for file")
76
+ end
77
+ it "should have the method classpackage_with_self" do
78
+ self.respond_to?(:classpackage_with_self).should == true
79
+ end
80
+ it "should transfer the resources to the class" do
81
+ @class2 = classpackage_with_self(self)
82
+ @class2.resources.should_not be_empty
83
+ end
84
+ it "should leave zero resources on the parent" do
85
+ @class2 = classpackage_with_self(self)
86
+ resources.should be_empty
87
+ end
83
88
  end
84
89
  end
@@ -4,35 +4,39 @@ include PoolParty::Resources
4
4
 
5
5
  describe "Conditional" do
6
6
  before(:each) do
7
- @cloud = cloud :app do; end
8
- @cloud.instance_eval do
9
- execute_if("$hostname", "'master'", self) do
10
- file({:name => "/etc/apache2/puppetmaster.conf"})
11
- end
12
- end
13
- @cond = @cloud.resource(:conditional).first
14
- end
15
- it "should add the block of resources on the parent" do
16
- @cloud.resources.size.should == 1
17
- end
18
- it "should have a conditional in the resources" do
19
- @cloud.resource(:conditional).first.name.should == "$hostname == 'master'"
7
+ reset_resources!
20
8
  end
21
- it "should push the resources onto the conditional resource" do
22
- @cond.resources.size.should == 1
23
- end
24
- it "should have a file resource on the conditional" do
25
- @cond.resource(:file).first.name.should == "/etc/apache2/puppetmaster.conf"
26
- end
27
- it "should have the parent as the cloud" do
28
- @cond.parent.should == @cloud
29
- end
30
- describe "to_string" do
9
+ describe "wrapped" do
31
10
  before(:each) do
32
- @string = @cond.to_string
11
+ @cloud = cloud :conditional_cloud_spec do
12
+ execute_if("$hostname", "'master'", self) do
13
+ has_file({:name => "/etc/apache2/puppetmaster2.conf"})
14
+ end
15
+ end
16
+ @cond = @cloud.get_resource(:conditional, "$hostname == 'master'")
33
17
  end
34
- it "should have a case statement for the hostname" do
35
- @string.should =~ /case \$hostname/
18
+ it "should add the block of resources on the parent" do
19
+ @cloud.resources.size.should == 1
20
+ end
21
+ it "should have a conditional in the resources" do
22
+ @cond.name.should == "$hostname == 'master'"
23
+ end
24
+ it "should push the resources onto the conditional resource" do
25
+ @cond.resources.size.should == 1
26
+ end
27
+ it "should have a file resource on the conditional" do
28
+ @cond.get_resource(:file, "/etc/apache2/puppetmaster2.conf").name.should == "/etc/apache2/puppetmaster2.conf"
29
+ end
30
+ it "should have the parent as the cloud" do
31
+ @cond.parent.should == @cloud
32
+ end
33
+ describe "to_string" do
34
+ before(:each) do
35
+ @string = @cond.to_string
36
+ end
37
+ it "should have a case statement for the hostname" do
38
+ @string.should =~ /case \$hostname/
39
+ end
36
40
  end
37
41
  end
38
42
  end
@@ -10,7 +10,7 @@ describe "Gem" do
10
10
  has_gempackage(:name => "rails")
11
11
  end
12
12
  end
13
- @gem = @cloud.resource(:gempackage).first
13
+ @gem = @cloud.get_resource(:gempackage, "activesupport")
14
14
  end
15
15
  it "should have a package" do
16
16
  @cloud.resource(:gempackage).should_not be_empty
@@ -19,24 +19,28 @@ describe "Gem" do
19
19
  @gem.name.should == "activesupport"
20
20
  end
21
21
  it "should have the 'rails' gem in the packages" do
22
- @cloud.resource(:gempackage).first.to_string.should =~ /rails/
22
+ @cloud.get_resource(:gempackage, "activesupport").to_string.should =~ /activesupport/
23
23
  end
24
24
  describe "with parent options" do
25
25
  before(:each) do
26
- reset_all!
27
- @cloud1 = cloud :gem_version_cloud do
28
- has_gempackage(:name => "ParseTree", :version => "2.2.0") do
29
- has_gempackage(:name => "edge-rails")
26
+ reset_resources!
27
+ end
28
+ describe "reset" do
29
+ before(:each) do
30
+ @cloud1 = cloud :gem_version_cloud do
31
+ has_gempackage(:name => "ParseTree", :version => "2.2.0") do
32
+ has_gempackage(:name => "edge-rails")
33
+ end
30
34
  end
35
+ @gem = @cloud1.resource(:gempackage).first
36
+ @gem2 = @gem.resource(:gempackage).first
37
+ end
38
+ it "should have the version set on the parent" do
39
+ @gem.version.should == "2.2.0"
40
+ end
41
+ it "should not take the version of the parent on the child" do
42
+ @gem.resource(:gempackage).first.version.should == nil
31
43
  end
32
- @gem = @cloud1.resource(:gempackage).first
33
- @gem2 = @gem.resource(:gempackage).first
34
- end
35
- it "should have the version set on the parent" do
36
- @gem.version.should == "2.2.0"
37
- end
38
- it "should not take the version of the parent on the child" do
39
- @gem2.version.should == nil
40
44
  end
41
45
  end
42
46
  end
@@ -4,7 +4,7 @@ include PoolParty::Resources
4
4
 
5
5
  describe "Variable" do
6
6
  before(:each) do
7
- reset!
7
+ reset_resources!
8
8
  @variable = variable(:name => "name", :value => "ari Lerner")
9
9
  end
10
10
  it "should have a package" do
@@ -1,50 +1,59 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
+ include PoolParty::Resources
4
+
3
5
  describe "Script" do
4
- it "should have inflate as a class method" do
5
- Script.respond_to?(:inflate).should == true
6
- end
7
- it "should have inflate_file as an instance method" do
8
- Script.respond_to?(:inflate_file).should == true
6
+ before(:each) do
7
+ reset_resources!
9
8
  end
10
- it "should have inflate as an instance method" do
11
- Script.new.respond_to?(:inflate).should == true
12
- end
13
-
14
- describe "with a script" do
15
- before(:each) do
16
- @script = 'script'
17
- @filename = 'filename'
18
-
19
- @pool = Script.new
20
- Script.stub!(:new).and_return(@pool)
21
- @pool.stub!(:inflate).and_return true
9
+ describe "wrapped" do
10
+ it "should have inflate as a class method" do
11
+ Script.respond_to?(:inflate).should == true
22
12
  end
23
-
24
- it "should create a new Script when calling on the class method" do
25
- Script.should_receive(:new).and_return @pool
26
- end
27
- it "should instance eval the script" do
28
- @pool.should_receive(:instance_eval).with(@script, @filename).and_return true
13
+ it "should have inflate_file as an instance method" do
14
+ Script.respond_to?(:inflate_file).should == true
29
15
  end
30
- it "should call inflate on itself" do
31
- @pool.should_receive(:inflate).and_return true
16
+ it "should have inflate as an instance method" do
17
+ Script.new.respond_to?(:inflate).should == true
32
18
  end
33
- after do
34
- Script.inflate(@script, @filename)
35
- end
36
- describe "save!" do
19
+
20
+ describe "with a script" do
37
21
  before(:each) do
38
- pool :appdotcom do
39
- keypair "snoodle"
40
- cloud :app do
41
- has_file :name => "/etc/httpd/httpd.conf"
22
+ @script = 'script'
23
+ @filename = 'filename'
24
+
25
+ @pool = Script.new
26
+ Script.stub!(:new).and_return(@pool)
27
+ @pool.stub!(:inflate).and_return true
28
+ end
29
+
30
+ it "should create a new Script when calling on the class method" do
31
+ Script.should_receive(:new).and_return @pool
32
+ end
33
+ it "should instance eval the script" do
34
+ @pool.should_receive(:instance_eval).with(@script, @filename).and_return true
35
+ end
36
+ it "should call inflate on itself" do
37
+ @pool.should_receive(:inflate).and_return true
38
+ end
39
+ after do
40
+ Script.inflate(@script, @filename)
41
+ end
42
+ describe "save!" do
43
+ before(:each) do
44
+ reset!
45
+ reset_resources!
46
+ pool :appdotcom do
47
+ keypair "snoodle"
48
+ cloud :app do
49
+ has_file :name => "/etc/httpd/httpd.conf"
50
+ end
42
51
  end
52
+ @saved = Script.save!(false)
53
+ end
54
+ it "should save the keypair" do
55
+ @saved.should =~ /keypair "snoodle"/
43
56
  end
44
- @saved = Script.save!(false)
45
- end
46
- it "should save the keypair" do
47
- @saved.should =~ /keypair "snoodle"/
48
57
  end
49
58
  end
50
59
  end
@@ -17,6 +17,10 @@ extend PoolParty
17
17
  Base.environment = "test"
18
18
  Base.verbose = false
19
19
 
20
+ def setup_cl
21
+ require 'poolpartycl'
22
+ end
23
+
20
24
  def stub_option_load
21
25
  @str=<<-EOS
22
26
  :access_key:
data/tasks/cloud.rake CHANGED
@@ -1,57 +1,3 @@
1
1
  # Cloud tasks
2
2
  namespace(:cloud) do
3
- # Setup
4
- task :init do
5
- setup_application
6
- raise Exception.new("You must specify your access_key and secret_access_key") unless Base.access_key && Base.secret_access_key
7
- end
8
- # Install the stack on all of the nodes
9
- desc "Prepare all servers"
10
- task :prepare => :init do
11
- PoolParty::Master.new.nodes.each do |node|
12
- node.install
13
- end
14
- end
15
- # Start the cloud
16
- desc "Start the cloud"
17
- task :start => :init do
18
- PoolParty::Master.new.start_cloud!
19
- end
20
- # Reload the cloud with the new updated data
21
- desc "Reload all instances with updated data"
22
- task :reload => :init do
23
- PoolParty::Master.new.nodes.each do |node|
24
- node.configure
25
- node.restart_with_monit
26
- end
27
- end
28
- # List the cloud
29
- desc "List cloud"
30
- task :list => :init do
31
- puts PoolParty::Master.new.list
32
- end
33
- # Shutdown the cloud
34
- desc "Shutdown the entire cloud"
35
- task :shutdown => :init do
36
- PoolParty::Master.new.request_termination_of_all_instances
37
- end
38
- # Watch the cloud and scale it if necessary
39
- desc "Watch the cloud and maintain it"
40
- task :scale => :init do
41
- begin
42
- PoolParty::Master.new.scale_cloud!
43
- rescue Exception => e
44
- puts "There was an error scaling the cloud: #{e}"
45
- end
46
-
47
- end
48
- # Maintain the cloud in a background process
49
- desc "Maintain the cloud (run on the master)"
50
- task :maintain => :init do
51
- begin
52
- PoolParty::Master.new.start_monitor!
53
- rescue Exception => e
54
- puts "There was an error starting the monitor: #{e}"
55
- end
56
- end
57
3
  end
@@ -1,7 +1,6 @@
1
1
  namespace(:dev) do
2
2
  task :initialize do
3
- setup_application
4
- run "mkdir ~/.ec2 >/dev/null 2>/dev/null" unless File.directory?("~/.ec2")
3
+ Kernel.system"mkdir ~/.ec2 >/dev/null 2>/dev/null" unless File.directory?("~/.ec2")
5
4
  end
6
5
  # Setup a basic development environment for the user
7
6
  desc "Setup development environment specify the config_file"
@@ -56,18 +55,6 @@ To work on this cloud, source the file like:
56
55
  end
57
56
  desc "initialize setup"
58
57
  task :init => [:setup_pemkeys]
59
-
60
- desc "Just an argv test"
61
- task :test => :initialize do
62
- puts "---- Testing ----"
63
- puts PoolParty.options(ARGV.dup)
64
- puts "Using keypair at: #{Base.keypair_path}"
65
- end
66
- desc "Installation listing"
67
- task :list_install => :initialize do
68
- puts "-- packages to install --"
69
- Provider.install_PoolParty(true)
70
- end
71
58
  desc "Authorize base ports for application"
72
59
  task :authorize_ports => :initialize do
73
60
  run <<-EOR
@@ -75,4 +62,14 @@ To work on this cloud, source the file like:
75
62
  ec2-authorize -p 80 default
76
63
  EOR
77
64
  end
65
+ desc "Turn the gemspec into a yaml file"
66
+ task :gemspec_to_yaml => [:initialize, :gemspec] do
67
+ filepath = ::File.join(::File.dirname(__FILE__), "..", "poolparty.gemspec")
68
+ data = open(filepath).read
69
+ spec = eval("$SAFE = 3\n#{data}")
70
+ yml = YAML.dump spec
71
+ File.open(filepath, "w+") do |f|
72
+ f << yml
73
+ end
74
+ end
78
75
  end
data/tasks/ec2.rake CHANGED
@@ -1,20 +1,13 @@
1
- namespace(:ec2) do
1
+ namespace(:ec2) do
2
+ desc "Prepare your cloud for poolparty"
2
3
  task :init do
3
- %x[ec2-authorize default -P icmp -t -1:-1 -s 0.0.0.0/0]
4
- end
5
- # Start a new instance in the cloud
6
- desc "Add and start an instance to the pool"
7
- task :start_new_instance => [:init] do
8
- puts PoolParty::Remoting.new.launch_new_instance!
9
- end
10
- # Stop all the instances via command-line
11
- desc "Stop all running instances"
12
- task :stop_running_instances => [:init] do
13
- Thread.new {`ec2-describe-instances | grep INSTANCE | grep running | awk '{print $2}' | xargs ec2-terminate-instances`}
14
- end
15
- # Reboot the instances via commandline
16
- desc "Restart all running instances"
17
- task :restart_running_instances => [:init] do
18
- Thread.new {`ec2-describe-instances | grep INSTANCE | grep running | awk '{print $2}' | xargs ec2-reboot-instances`}
4
+ cmd =<<-EOE
5
+ ec2-authorize default -P icmp -t -1:-1 -s 0.0.0.0/0
6
+ ec2-authorize -p 7000-7050 default
7
+ ec2-authorize -p 8140 default
8
+ ec2-authorize -p 4369 default
9
+ EOE
10
+
11
+ Kernel.system cmd.split(/\n/).join(" && ")
19
12
  end
20
13
  end
data/tasks/instance.rake CHANGED
@@ -1,63 +1,2 @@
1
1
  namespace(:instance) do
2
- # Find the instance we want to deal with
3
- # interface can be: num=0, i=0, inst=0, 0
4
- # defaults to the master instance (0)
5
- task :init do
6
- num = (ENV['num'] || ENV["i"] || ENV["inst"] || ARGV.shift || 0).to_i
7
- raise Exception.new("Please set the number of the instance (i.e. num=1, i=1, or as an argument)") unless num
8
- @node = PoolParty::Master.new.get_node(num)
9
- end
10
- # Ssh into the node
11
- desc "Remotely login to the remote instance"
12
- task :ssh => [:init] do
13
- @node.ssh
14
- end
15
- desc "Send a file to the remote instance"
16
- task :exec => :init do
17
- @node.ssh ENV['cmd']
18
- end
19
- # Send a file to the remote instance
20
- # as designated by src='' and dest=''
21
- desc "Send a file to the remote instance"
22
- task :scp => :init do
23
- @node.scp ENV['src'], ENV['dest']
24
- end
25
- # Execute a command on the remote instance as designated
26
- # by cmd=''
27
- desc "Execute cmd on a remote instance"
28
- task :exec => [:init] do
29
- cmd = ENV['cmd'] || "ls -l"
30
- puts @node.ssh(cmd.runnable)
31
- end
32
- # Restart all the services monitored by monit
33
- desc "Restart all the services"
34
- task :reload => [:init] do
35
- @node.restart_with_monit
36
- end
37
- # Start all the services monitored by monit
38
- desc "Start all services"
39
- task :load => [:init] do
40
- @node.start_with_monit
41
- end
42
- # Stop the services monitored by monit
43
- desc "Stop all services"
44
- task :stop => [:init] do
45
- @node.stop_with_monit
46
- end
47
- # Install the required services on this node
48
- desc "Install stack on this node"
49
- task :install => :init do
50
- @node.install
51
- end
52
- # Turnoff this instance
53
- desc "Teardown instance"
54
- task :shutdown => :init do
55
- `ec2-terminate-instances #{@node.instance_id}`
56
- end
57
- # Configure this node and start the services
58
- desc "Configure the stack on this node"
59
- task :configure => :init do
60
- @node.configure
61
- @node.restart_with_monit
62
- end
63
2
  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.16</a>
37
+ <a href="http://rubyforge.org/projects/poolparty" class="numbers">0.2.20</a>
38
38
  </div>
39
39
  <h1>&#8216;Easy cloud computing&#8217;</h1>
40
40
  <h2>What</h2>