auser-poolparty 0.2.9 → 0.2.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/Manifest.txt +33 -4
  2. data/PostInstall.txt +3 -1
  3. data/bin/cloud-provision +8 -4
  4. data/bin/cloud-start +2 -0
  5. data/bin/server-get-load +29 -0
  6. data/bin/server-list-active +1 -1
  7. data/bin/server-rerun +24 -0
  8. data/config/requirements.rb +1 -1
  9. data/lib/erlang/messenger/Makefile +15 -0
  10. data/lib/erlang/messenger/README +5 -0
  11. data/lib/erlang/messenger/Rakefile +39 -0
  12. data/lib/erlang/messenger/control +11 -0
  13. data/lib/erlang/messenger/ebin/erl_crash.dump +12138 -0
  14. data/lib/erlang/messenger/ebin/load_app.beam +0 -0
  15. data/lib/erlang/messenger/ebin/pm_master.beam +0 -0
  16. data/lib/erlang/messenger/ebin/pm_master_supervisor.beam +0 -0
  17. data/lib/erlang/messenger/ebin/pm_node.beam +0 -0
  18. data/lib/erlang/messenger/ebin/pm_node_supervisor.beam +0 -0
  19. data/lib/erlang/messenger/lib/load_app.app +18 -0
  20. data/lib/erlang/messenger/src/load_app.erl +26 -0
  21. data/lib/erlang/messenger/src/pm_cluster.erl +31 -0
  22. data/lib/erlang/messenger/src/pm_master.erl +27 -0
  23. data/lib/erlang/messenger/src/pm_master_supervisor.erl +8 -0
  24. data/lib/erlang/messenger/src/pm_node.erl +79 -0
  25. data/lib/erlang/messenger/src/pm_node_supervisor.erl +33 -0
  26. data/lib/poolparty.rb +9 -6
  27. data/lib/poolparty/base_packages/haproxy.rb +9 -2
  28. data/lib/poolparty/base_packages/heartbeat.rb +31 -30
  29. data/lib/poolparty/base_packages/poolparty.rb +30 -17
  30. data/lib/poolparty/base_packages/ruby.rb +1 -2
  31. data/lib/poolparty/core/array.rb +2 -2
  32. data/lib/poolparty/core/hash.rb +16 -2
  33. data/lib/poolparty/core/string.rb +1 -1
  34. data/lib/poolparty/core/symbol.rb +2 -2
  35. data/lib/poolparty/dependency_resolutions/base.rb +12 -0
  36. data/lib/poolparty/dependency_resolutions/puppet.rb +49 -0
  37. data/lib/poolparty/helpers/display.rb +3 -3
  38. data/lib/poolparty/helpers/provisioner_base.rb +6 -6
  39. data/lib/poolparty/helpers/provisioners/master.rb +21 -21
  40. data/lib/poolparty/helpers/provisioners/slave.rb +4 -3
  41. data/lib/poolparty/modules/definable_resource.rb +1 -0
  42. data/lib/poolparty/modules/file_writer.rb +11 -18
  43. data/lib/poolparty/modules/method_missing_sugar.rb +1 -1
  44. data/lib/poolparty/modules/pretty_printer.rb +11 -11
  45. data/lib/poolparty/modules/resourcing_dsl.rb +57 -0
  46. data/lib/poolparty/monitors/base_monitor.rb +17 -3
  47. data/lib/poolparty/monitors/monitors/cpu_monitor.rb +15 -0
  48. data/lib/poolparty/monitors/monitors/memory_monitor.rb +23 -0
  49. data/lib/poolparty/net/remote_instance.rb +5 -0
  50. data/lib/poolparty/net/remoter.rb +12 -2
  51. data/lib/poolparty/net/remoter_base.rb +5 -1
  52. data/lib/poolparty/plugins/git.rb +24 -15
  53. data/lib/poolparty/pool/base.rb +1 -2
  54. data/lib/poolparty/pool/cloud.rb +14 -9
  55. data/lib/poolparty/pool/custom_resource.rb +6 -6
  56. data/lib/poolparty/pool/resource.rb +53 -104
  57. data/lib/poolparty/pool/resources/class_package.rb +4 -4
  58. data/lib/poolparty/pool/resources/conditional.rb +5 -1
  59. data/lib/poolparty/pool/resources/gem.rb +22 -8
  60. data/lib/poolparty/pool/resources/symlink.rb +10 -6
  61. data/lib/poolparty/pool/resources/variable.rb +1 -1
  62. data/lib/poolparty/templates/ha.cf +3 -3
  63. data/lib/poolparty/templates/haproxy.conf +3 -3
  64. data/lib/poolparty/templates/puppet.conf +1 -1
  65. data/lib/poolparty/version.rb +1 -1
  66. data/poolparty.gemspec +7 -5
  67. data/setup.rb +3 -3
  68. data/spec/poolparty/core/hash_spec.rb +19 -1
  69. data/spec/poolparty/dependency_resolutions/base_spec.rb +11 -0
  70. data/spec/poolparty/modules/file_writer_spec.rb +9 -0
  71. data/spec/poolparty/monitors/base_monitor_spec.rb +19 -0
  72. data/spec/poolparty/monitors/monitors/cpu_monitor_spec.rb +17 -0
  73. data/spec/poolparty/net/remote_instance_spec.rb +6 -1
  74. data/spec/poolparty/net/remoter_spec.rb +2 -1
  75. data/spec/poolparty/pool/cloud_spec.rb +15 -1
  76. data/spec/poolparty/pool/custom_resource_spec.rb +2 -2
  77. data/spec/poolparty/pool/plugin_spec.rb +4 -4
  78. data/spec/poolparty/pool/resource_spec.rb +39 -1
  79. data/spec/poolparty/pool/resources/gem_spec.rb +30 -3
  80. data/spec/poolparty/pool/resources/symlink_spec.rb +4 -1
  81. data/spec/poolparty/spec_helper.rb +1 -0
  82. data/website/index.html +1 -1
  83. metadata +40 -7
  84. data/lib/erlang/eb_server.erl +0 -27
  85. data/lib/poolparty/plugins/gem_package.rb +0 -30
  86. data/lib/poolparty/puppet_plugins/poolparty/plugins/puppet/parser/functions/activenodeips.rb +0 -11
  87. data/lib/poolparty/puppet_plugins/poolparty/plugins/puppet/parser/functions/activenodenames.rb +0 -11
@@ -5,12 +5,39 @@ include PoolParty::Resources
5
5
  describe "Gem" do
6
6
  before(:each) do
7
7
  reset!
8
- @gem = gem(:name => "rails")
8
+ @cloud = cloud :gem_cloud do
9
+ has_gempackage(:name => "activesupport") do
10
+ has_gempackage(:name => "rails")
11
+ end
12
+ end
13
+ @gem = @cloud.resource(:gempackage).first
9
14
  end
10
15
  it "should have a package" do
11
- resource(:package).should_not be_empty
16
+ @cloud.resource(:gempackage).should_not be_empty
17
+ end
18
+ it "should have the name set as activesupport" do
19
+ @gem.name.should == "activesupport"
12
20
  end
13
21
  it "should have the 'rails' gem in the packages" do
14
- @gem.to_string.should =~ /Package\[rubygems\]/
22
+ @cloud.resource(:gempackage).first.to_string.should =~ /rails/
23
+ end
24
+ describe "with parent options" do
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")
30
+ end
31
+ 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
+ puts @gem.to_string
40
+ @gem2.version.should == nil
41
+ end
15
42
  end
16
43
  end
@@ -6,7 +6,7 @@ describe "Symlink" do
6
6
  before(:each) do
7
7
  reset_resources!
8
8
  @cloud = cloud :symlink_test do
9
- has_symlink(:name => "/etc/apache2/puppetmaster.conf", :from => "/etc/http/puppetmaster.conf")
9
+ has_symlink(:name => "/etc/apache2/puppetmaster.conf", :source => "/etc/http/puppetmaster.conf")
10
10
  end
11
11
  @symlink = @cloud.resource(:symlink).first
12
12
  end
@@ -16,4 +16,7 @@ describe "Symlink" do
16
16
  it "should create a file { resource" do
17
17
  @symlink.to_string.should =~ /file \{/
18
18
  end
19
+ it "should use the from for the ensures" do
20
+ @symlink.ensure.should == @symlink.source
21
+ end
19
22
  end
@@ -38,6 +38,7 @@ def wait_launch(time=5)
38
38
  Process.wait(pid, 0)
39
39
  end
40
40
  def reset_all!
41
+ $cloud = nil
41
42
  end
42
43
  def read_file(path)
43
44
  require "open-uri"
@@ -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.9</a>
37
+ <a href="http://rubyforge.org/projects/poolparty" class="numbers">0.2.15</a>
38
38
  </div>
39
39
  <h1>&#8216;Easy cloud computing&#8217;</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.9
4
+ version: 0.2.15
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-16 00:00:00 -07:00
12
+ date: 2008-10-20 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -82,7 +82,9 @@ executables:
82
82
  - pool-spec
83
83
  - pool-start
84
84
  - pool-start-monitor
85
+ - server-get-load
85
86
  - server-list-active
87
+ - server-rerun
86
88
  extensions: []
87
89
 
88
90
  extra_rdoc_files:
@@ -120,7 +122,9 @@ files:
120
122
  - bin/pool-spec
121
123
  - bin/pool-start
122
124
  - bin/pool-start-monitor
125
+ - bin/server-get-load
123
126
  - bin/server-list-active
127
+ - bin/server-rerun
124
128
  - config/hoe.rb
125
129
  - config/requirements.rb
126
130
  - examples/basic.rb
@@ -130,7 +134,29 @@ files:
130
134
  - generators/poolspec/USAGE
131
135
  - generators/poolspec/poolspec_generator.rb
132
136
  - generators/poolspec/templates/pool_spec_template.erb
133
- - lib/erlang/eb_server.erl
137
+ - lib/erlang/messenger/Makefile
138
+ - lib/erlang/messenger/README
139
+ - lib/erlang/messenger/Rakefile
140
+ - lib/erlang/messenger/control
141
+ - lib/erlang/messenger/ebin/erl_crash.dump
142
+ - lib/erlang/messenger/ebin/load_app.beam
143
+ - lib/erlang/messenger/ebin/pm_cluster.beam
144
+ - lib/erlang/messenger/ebin/pm_master.beam
145
+ - lib/erlang/messenger/ebin/pm_master_supervisor.beam
146
+ - lib/erlang/messenger/ebin/pm_node.beam
147
+ - lib/erlang/messenger/ebin/pm_node_supervisor.beam
148
+ - lib/erlang/messenger/ebin/tmp/templates/apache2.conf
149
+ - lib/erlang/messenger/ebin/tmp/templates/base.conf.erb
150
+ - lib/erlang/messenger/ebin/tmp/templates/browser_fixes.conf.erb
151
+ - lib/erlang/messenger/ebin/tmp/templates/mime-minimal.conf.erb
152
+ - lib/erlang/messenger/ebin/tmp/templates/virtual_host.conf.erb
153
+ - lib/erlang/messenger/lib/load_app.app
154
+ - lib/erlang/messenger/src/load_app.erl
155
+ - lib/erlang/messenger/src/pm_cluster.erl
156
+ - lib/erlang/messenger/src/pm_master.erl
157
+ - lib/erlang/messenger/src/pm_master_supervisor.erl
158
+ - lib/erlang/messenger/src/pm_node.erl
159
+ - lib/erlang/messenger/src/pm_node_supervisor.erl
134
160
  - lib/poolparty.rb
135
161
  - lib/poolparty/base_packages/haproxy.rb
136
162
  - lib/poolparty/base_packages/heartbeat.rb
@@ -148,6 +174,8 @@ files:
148
174
  - lib/poolparty/core/string.rb
149
175
  - lib/poolparty/core/symbol.rb
150
176
  - lib/poolparty/core/time.rb
177
+ - lib/poolparty/dependency_resolutions/base.rb
178
+ - lib/poolparty/dependency_resolutions/puppet.rb
151
179
  - lib/poolparty/exceptions/RemoteException.rb
152
180
  - lib/poolparty/exceptions/ResourceException.rb
153
181
  - lib/poolparty/exceptions/RuntimeException.rb
@@ -167,15 +195,17 @@ files:
167
195
  - lib/poolparty/modules/method_missing_sugar.rb
168
196
  - lib/poolparty/modules/output.rb
169
197
  - lib/poolparty/modules/pretty_printer.rb
198
+ - lib/poolparty/modules/resourcing_dsl.rb
170
199
  - lib/poolparty/modules/s3_string.rb
171
200
  - lib/poolparty/modules/safe_instance.rb
172
201
  - lib/poolparty/monitors/base_monitor.rb
202
+ - lib/poolparty/monitors/monitors/cpu_monitor.rb
203
+ - lib/poolparty/monitors/monitors/memory_monitor.rb
173
204
  - lib/poolparty/net/remote.rb
174
205
  - lib/poolparty/net/remote_bases/ec2.rb
175
206
  - lib/poolparty/net/remote_instance.rb
176
207
  - lib/poolparty/net/remoter.rb
177
208
  - lib/poolparty/net/remoter_base.rb
178
- - lib/poolparty/plugins/gem_package.rb
179
209
  - lib/poolparty/plugins/git.rb
180
210
  - lib/poolparty/plugins/line.rb
181
211
  - lib/poolparty/plugins/svn.rb
@@ -202,8 +232,6 @@ files:
202
232
  - lib/poolparty/pool/resources/symlink.rb
203
233
  - lib/poolparty/pool/resources/variable.rb
204
234
  - lib/poolparty/pool/script.rb
205
- - lib/poolparty/puppet_plugins/poolparty/plugins/puppet/parser/functions/activenodeips.rb
206
- - lib/poolparty/puppet_plugins/poolparty/plugins/puppet/parser/functions/activenodenames.rb
207
235
  - lib/poolparty/templates/authkeys
208
236
  - lib/poolparty/templates/cib.xml
209
237
  - lib/poolparty/templates/fileserver.conf
@@ -232,6 +260,7 @@ files:
232
260
  - spec/poolparty/core/object_spec.rb
233
261
  - spec/poolparty/core/string_spec.rb
234
262
  - spec/poolparty/core/time_spec.rb
263
+ - spec/poolparty/dependency_resolutions/base_spec.rb
235
264
  - spec/poolparty/helpers/binary_spec.rb
236
265
  - spec/poolparty/helpers/display_spec.rb
237
266
  - spec/poolparty/helpers/optioner_spec.rb
@@ -243,6 +272,8 @@ files:
243
272
  - spec/poolparty/modules/definable_resource.rb
244
273
  - spec/poolparty/modules/file_writer_spec.rb
245
274
  - spec/poolparty/modules/s3_string_spec.rb
275
+ - spec/poolparty/monitors/base_monitor_spec.rb
276
+ - spec/poolparty/monitors/monitors/cpu_monitor_spec.rb
246
277
  - spec/poolparty/net/remote_bases/ec2_spec.rb
247
278
  - spec/poolparty/net/remote_instance_spec.rb
248
279
  - spec/poolparty/net/remote_spec.rb
@@ -314,7 +345,9 @@ post_install_message: |-
314
345
  Please check out the documentation for any questions or check out the google groups at
315
346
  http://groups.google.com/group/poolpartyrb
316
347
 
317
- Don't forget to check out the plugin tutorial @ http://poolpartyrb.com for extending PoolParty!
348
+ Tutorials are at http://poolpartyrb.com
349
+
350
+ Don't forget to check out the plugin tutorial @ http://poolpartyrb.com to extend PoolParty for your needs!
318
351
 
319
352
  For more information, check http://PoolPartyrb.com
320
353
  On IRC:
@@ -1,27 +0,0 @@
1
- %%%***************************************
2
- %%%
3
- %%% PoolParty node-server
4
- %%% Author: Ari Lerner <ari.the.lerner@gmail.com>
5
- %%%
6
- %%% Description: This server runs on the poolparty nodes
7
- %%%
8
- %%%***************************************
9
-
10
- % The name of our module
11
- -module (eb_server).
12
- % We are using the gen_server behaviour
13
- -behaviour (gen_server).
14
-
15
- % API methods
16
- -export ([start_link/0]).
17
-
18
- % gen_server callbacks
19
- -export ([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
20
-
21
- % Define the structure of the tuple state
22
- -record (state, {}).
23
- -define (SERVER, ?MODULE).
24
-
25
- % API Methods
26
- start_link() ->
27
- gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
@@ -1,30 +0,0 @@
1
- module PoolParty
2
- class Gem
3
-
4
- virtual_resource(:gempackage) do
5
-
6
- # When we call gempackage, we want the exec to run on the directory we suggest
7
- # we also only want it to run if there is NOT a local gem already installed with
8
- # the package details (version and name)
9
- def loaded(opts={})
10
- has_exec(opts.merge({:name => "gem-package-#{name}", :cwd => "/tmp", :path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/var/lib/gems/1.8/bin"})) do
11
- command "gem install -y --no-ri --no-rdoc #{"--version #{version}" if @parent.version} #{"--source #{@parent.source}" if @parent.source} #{@parent.name}"
12
- ifnot "gem list --local #{@parent.name} | grep #{@parent.name} #{"| grep #{@parent.version}" if @parent.version}"
13
- end
14
- end
15
-
16
- # Because we are only running this one command, we want to make sure that when we
17
- # require it in another resource, that it is appropriately labeled
18
- def class_type_name
19
- "Exec"
20
- end
21
- # Additionally, because we change the name in the exec when required, we have to reflect
22
- # it here in the key. This is just so poolparty is aware of the resource when looking for
23
- # it in a requires statement
24
- def key
25
- "gem-package-#{name}"
26
- end
27
- end
28
-
29
- end
30
- end
@@ -1,11 +0,0 @@
1
- module Puppet::Parser::Functions
2
- newfunction(:active_node_ips, :type => :rvalue) do |args|
3
- output = []
4
- ret = %x[. /etc/profile && cloud-list]
5
- active_node_list = ret.split(/\n/).map {|a| a.chomp}.reject {|a| a.nil? || a.empty? || a =~ /\*\*/}
6
- active_node_list.each do |line|
7
- output << line.split(/\t/)[1]
8
- end
9
- output
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- module Puppet::Parser::Functions
2
- newfunction(:active_node_names, :type => :rvalue) do |args|
3
- output = []
4
- ret = %x[. /etc/profile && cloud-list]
5
- active_node_list = ret.split(/\n/).map {|a| a.chomp}.reject {|a| a.nil? || a.empty? || a =~ /\*\*/}
6
- active_node_list.each do |line|
7
- output << line.split(/\t/)[0]
8
- end
9
- output
10
- end
11
- end