auser-poolparty 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +8 -0
- data/README.txt +10 -10
- data/Rakefile +30 -21
- data/{web/static/site/images → assets}/clouds.png +0 -0
- data/bin/instance +39 -34
- data/bin/pool +44 -29
- data/bin/poolnotify +34 -0
- data/config/haproxy.conf +1 -1
- data/config/heartbeat_authkeys.conf +1 -1
- data/config/monit/haproxy.monit.conf +2 -1
- data/config/nginx.conf +1 -1
- data/config/reconfigure_instances_script.sh +28 -9
- data/config/sample-config.yml +1 -1
- data/lib/core/string.rb +3 -0
- data/lib/modules/ec2_wrapper.rb +47 -22
- data/lib/modules/file_writer.rb +38 -0
- data/lib/modules/sprinkle_overrides.rb +32 -0
- data/lib/modules/vlad_override.rb +5 -4
- data/lib/poolparty.rb +14 -10
- data/lib/poolparty/application.rb +33 -19
- data/lib/poolparty/master.rb +227 -105
- data/lib/poolparty/optioner.rb +8 -4
- data/lib/poolparty/plugin.rb +34 -4
- data/lib/poolparty/provider/packages/haproxy.rb +0 -15
- data/lib/poolparty/provider/packages/heartbeat.rb +1 -1
- data/lib/poolparty/provider/packages/ruby.rb +6 -6
- data/lib/poolparty/provider/packages/s3fuse.rb +9 -2
- data/lib/poolparty/provider/provider.rb +65 -25
- data/lib/poolparty/remote_instance.rb +95 -74
- data/lib/poolparty/remoter.rb +48 -37
- data/lib/poolparty/remoting.rb +41 -17
- data/lib/poolparty/scheduler.rb +4 -4
- data/lib/poolparty/tasks.rb +1 -1
- data/lib/poolparty/tasks/package.rake +53 -0
- data/lib/poolparty/tasks/plugins.rake +1 -1
- data/poolparty.gemspec +50 -58
- data/spec/application_spec.rb +28 -0
- data/spec/core_spec.rb +9 -0
- data/spec/ec2_wrapper_spec.rb +87 -0
- data/spec/file_writer_spec.rb +73 -0
- data/spec/files/describe_response +37 -0
- data/spec/files/multi_describe_response +69 -0
- data/spec/files/remote_desc_response +37 -0
- data/spec/helpers/ec2_mock.rb +3 -0
- data/spec/master_spec.rb +302 -78
- data/spec/monitors/cpu_monitor_spec.rb +2 -1
- data/spec/monitors/memory_spec.rb +1 -0
- data/spec/monitors/misc_monitor_spec.rb +1 -0
- data/spec/monitors/web_spec.rb +1 -0
- data/spec/optioner_spec.rb +12 -0
- data/spec/plugin_manager_spec.rb +10 -10
- data/spec/plugin_spec.rb +6 -3
- data/spec/pool_binary_spec.rb +3 -0
- data/spec/poolparty_spec.rb +12 -7
- data/spec/provider_spec.rb +1 -0
- data/spec/remote_instance_spec.rb +18 -18
- data/spec/remoter_spec.rb +4 -2
- data/spec/remoting_spec.rb +10 -2
- data/spec/scheduler_spec.rb +0 -6
- data/spec/spec_helper.rb +13 -0
- metadata +83 -52
- data/Manifest +0 -115
- data/lib/poolparty/tmp.rb +0 -46
- data/misc/basics_tutorial.txt +0 -142
- data/web/static/conf/nginx.conf +0 -22
- data/web/static/site/images/balloon.png +0 -0
- data/web/static/site/images/cb.png +0 -0
- data/web/static/site/images/railsconf_preso_img.png +0 -0
- data/web/static/site/index.html +0 -71
- data/web/static/site/javascripts/application.js +0 -3
- data/web/static/site/javascripts/corner.js +0 -178
- data/web/static/site/javascripts/jquery-1.2.6.pack.js +0 -11
- data/web/static/site/misc.html +0 -42
- data/web/static/site/storage/pool_party_presentation.pdf +0 -0
- data/web/static/site/stylesheets/application.css +0 -100
- data/web/static/site/stylesheets/reset.css +0 -17
- data/web/static/src/layouts/application.haml +0 -25
- data/web/static/src/pages/index.haml +0 -25
- data/web/static/src/pages/misc.haml +0 -5
- data/web/static/src/stylesheets/application.sass +0 -100
data/lib/poolparty/remoter.rb
CHANGED
@@ -7,32 +7,44 @@ module PoolParty
|
|
7
7
|
def ssh_string
|
8
8
|
"ssh -i #{Application.keypair_path} -o StrictHostKeyChecking=no -l #{Application.username}"
|
9
9
|
end
|
10
|
+
def rsync_string
|
11
|
+
"rsync --delete -azP -e '#{ssh_string}' "
|
12
|
+
end
|
10
13
|
end
|
11
14
|
|
12
15
|
module InstanceMethods
|
13
16
|
include Callbacks
|
14
17
|
include Scheduler
|
15
18
|
|
16
|
-
def
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
if opts[:dir]
|
23
|
-
ssh("mkdir -p #{opts[:dir]}")
|
19
|
+
def rsync_tasks local, remote
|
20
|
+
reset!
|
21
|
+
returning scp_tasks do |tasks|
|
22
|
+
target_hosts.each do |ip|
|
23
|
+
tasks << "#{self.class.rsync_string} #{local} #{ip}:#{remote}"
|
24
24
|
end
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def remote_command_tasks commands
|
29
|
+
reset!
|
30
|
+
commands = commands.join ' && ' if commands.is_a? Array
|
31
|
+
|
32
|
+
returning ssh_tasks do |tasks|
|
33
|
+
target_hosts.each do |ip|
|
34
|
+
ssh_tasks << "#{self.class.ssh_string} #{ip} '#{commands}'"
|
32
35
|
end
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def scp local, remote, opts={}
|
40
|
+
cmd = self.class.rsync_string
|
41
|
+
arr = []
|
42
|
+
|
43
|
+
target_hosts.each do |ip|
|
44
|
+
arr << "#{cmd} #{local} #{ip}:#{remote}"
|
45
|
+
end
|
46
|
+
|
47
|
+
run_array_of_tasks(arr)
|
36
48
|
end
|
37
49
|
|
38
50
|
def single_scp local, remote, opts={}
|
@@ -41,30 +53,27 @@ module PoolParty
|
|
41
53
|
|
42
54
|
def ssh command="", opts={}, &block
|
43
55
|
cmd = self.class.ssh_string
|
56
|
+
arr = []
|
57
|
+
|
44
58
|
if command.empty?
|
45
|
-
system("#{cmd} #{
|
59
|
+
system("#{cmd} #{self.ip}") if self.class == RemoteInstance
|
46
60
|
else
|
47
|
-
|
48
|
-
|
49
|
-
else
|
50
|
-
target_hosts.each do |ip|
|
51
|
-
ssh_tasks << "#{cmd} #{Application.username}@#{ip} '#{command.runnable}'"
|
52
|
-
end
|
61
|
+
target_hosts.each do |ip|
|
62
|
+
arr << "#{cmd} #{ip} '#{command.runnable}'"
|
53
63
|
end
|
54
64
|
end
|
65
|
+
|
66
|
+
run_array_of_tasks arr
|
55
67
|
end
|
56
68
|
|
57
|
-
def run_now command
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
def install *names
|
62
|
-
names.each {|name| install_tasks << name }
|
69
|
+
def run_now command
|
70
|
+
unless command.empty?
|
71
|
+
Kernel.system "#{self.class.ssh_string} #{self.ip} #{command.runnable}"
|
72
|
+
end
|
63
73
|
end
|
64
|
-
|
74
|
+
|
65
75
|
def ssh_tasks;@ssh_tasks ||= [];end
|
66
76
|
def scp_tasks;@scp_tasks ||= [];end
|
67
|
-
def install_tasks;@install_tasks ||= [];end
|
68
77
|
|
69
78
|
def reset!
|
70
79
|
@ssh_tasks = @scp_tasks = nil
|
@@ -80,8 +89,6 @@ module PoolParty
|
|
80
89
|
|
81
90
|
run_array_of_tasks(scp_tasks)
|
82
91
|
run_array_of_tasks(ssh_tasks)
|
83
|
-
|
84
|
-
PoolParty.message "running #{ssh_tasks.size} tasks"
|
85
92
|
end
|
86
93
|
|
87
94
|
def target_hosts
|
@@ -89,8 +96,12 @@ module PoolParty
|
|
89
96
|
end
|
90
97
|
|
91
98
|
def run_array_of_tasks(task_list)
|
92
|
-
|
93
|
-
|
99
|
+
unless task_list.size == 0
|
100
|
+
task_list.each do |task|
|
101
|
+
add_task {Kernel.system("#{task}")}
|
102
|
+
end
|
103
|
+
run_thread_list
|
104
|
+
end
|
94
105
|
end
|
95
106
|
|
96
107
|
def set_hosts(c=nil)
|
data/lib/poolparty/remoting.rb
CHANGED
@@ -9,36 +9,60 @@ module PoolParty
|
|
9
9
|
# == GENERAL METHODS
|
10
10
|
# == LISTING
|
11
11
|
# List all the running instances associated with this account
|
12
|
-
def list_of_running_instances
|
13
|
-
|
12
|
+
def list_of_running_instances(list = list_of_nonterminated_instances)
|
13
|
+
list.select {|a| a[:status] =~ /running/}
|
14
14
|
end
|
15
15
|
# Get a list of the pending instances
|
16
|
-
def list_of_pending_instances
|
17
|
-
|
16
|
+
def list_of_pending_instances(list = list_of_nonterminated_instances)
|
17
|
+
list.select {|a| a[:status] =~ /pending/}
|
18
18
|
end
|
19
19
|
# list of shutting down instances
|
20
|
-
def list_of_terminating_instances
|
21
|
-
|
20
|
+
def list_of_terminating_instances(list = list_of_nonterminated_instances)
|
21
|
+
list.select {|a| a[:status] =~ /shutting/}
|
22
22
|
end
|
23
23
|
# list all the nonterminated instances
|
24
|
-
def list_of_nonterminated_instances
|
25
|
-
|
24
|
+
def list_of_nonterminated_instances(list = list_of_instances)
|
25
|
+
list.reject {|a| a[:status] =~ /terminated/}
|
26
26
|
end
|
27
|
-
# List the instances, regardless of their states
|
28
|
-
def list_of_instances
|
29
|
-
get_instances_description
|
27
|
+
# List the instances for the current key pair, regardless of their states
|
28
|
+
def list_of_instances(keypair = Application.keypair)
|
29
|
+
get_instances_description.select {|a| a[:keypair] == keypair}
|
30
|
+
end
|
31
|
+
# List all instances, regardless of their key pairs or states
|
32
|
+
def list_of_all_instances
|
33
|
+
a_list = []
|
34
|
+
cloud_keypairs.each {|keypair| list_of_instances(keypair).each { |inst| a_list << inst } }
|
35
|
+
a_list
|
36
|
+
end
|
37
|
+
# list of keypairs for the current AWS access key and secret key
|
38
|
+
def cloud_keypairs
|
39
|
+
instances = get_instances_description.sort{|x,y| x[:keypair] <=> y[:keypair]}
|
40
|
+
keypair = nil
|
41
|
+
instances.map {|a| keypair != a[:keypair] ? (keypair = a[:keypair]; keypair) : nil }.compact
|
30
42
|
end
|
31
43
|
# Get number of pending instances
|
32
|
-
def number_of_pending_instances
|
33
|
-
|
44
|
+
def number_of_pending_instances(list = list_of_pending_instances)
|
45
|
+
list.size
|
34
46
|
end
|
35
47
|
# get the number of running instances
|
36
|
-
def number_of_running_instances
|
37
|
-
|
48
|
+
def number_of_running_instances(list = list_of_running_instances)
|
49
|
+
list.size
|
50
|
+
end
|
51
|
+
# get the number of pending and running instances for a list
|
52
|
+
def number_of_pending_and_running_instances_for_list(a_list = list_of_instances)
|
53
|
+
running_list = list_of_running_instances( a_list )
|
54
|
+
pending_list = list_of_pending_instances( a_list )
|
55
|
+
number_of_running_instances(running_list) + number_of_pending_instances(pending_list)
|
56
|
+
end
|
57
|
+
# get the number of pending and running instances for a keypair
|
58
|
+
def number_of_pending_and_running_instances(keypair = Application.keypair)
|
59
|
+
a_list = list_of_nonterminated_instances( list_of_instances(keypair) )
|
60
|
+
number_of_pending_and_running_instances_for_list( a_list )
|
38
61
|
end
|
39
62
|
# get the number of pending and running instances
|
40
|
-
def
|
41
|
-
|
63
|
+
def number_of_all_pending_and_running_instances
|
64
|
+
a_list = list_of_nonterminated_instances( list_of_all_instances )
|
65
|
+
number_of_pending_and_running_instances_for_list( a_list )
|
42
66
|
end
|
43
67
|
# == LAUNCHING
|
44
68
|
# Request to launch a new instance
|
data/lib/poolparty/scheduler.rb
CHANGED
@@ -26,7 +26,7 @@ module PoolParty
|
|
26
26
|
# Add a task in a new thread
|
27
27
|
def <<(a, *args)
|
28
28
|
thread = Thread.new(a) do |task|
|
29
|
-
Thread.stop
|
29
|
+
Thread.stop rescue ""
|
30
30
|
Thread.current[:callee] = task
|
31
31
|
a.call args
|
32
32
|
end
|
@@ -78,7 +78,8 @@ module PoolParty
|
|
78
78
|
block = lambda {
|
79
79
|
loop do
|
80
80
|
begin
|
81
|
-
|
81
|
+
yield if block_given?
|
82
|
+
run_thread_list
|
82
83
|
wait interval
|
83
84
|
reset!
|
84
85
|
rescue Exception => e
|
@@ -90,8 +91,7 @@ module PoolParty
|
|
90
91
|
opts[:daemonize] ? daemonize(&block) : block.call
|
91
92
|
end
|
92
93
|
|
93
|
-
def run_thread_list
|
94
|
-
yield if block_given?
|
94
|
+
def run_thread_list
|
95
95
|
run_threads
|
96
96
|
end
|
97
97
|
# Reset
|
data/lib/poolparty/tasks.rb
CHANGED
@@ -19,7 +19,7 @@ module PoolParty
|
|
19
19
|
end
|
20
20
|
|
21
21
|
# Require the poolparty specific tasks
|
22
|
-
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].each { |t|
|
22
|
+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].each { |t| load t }
|
23
23
|
|
24
24
|
Dir["#{PoolParty.plugin_dir}/*/Rakefile"].each {|t| load "#{t}" }
|
25
25
|
|
@@ -0,0 +1,53 @@
|
|
1
|
+
namespace(:pkg) do
|
2
|
+
## Rake task to create/update a .manifest file in your project, as well as update *.gemspec
|
3
|
+
desc %{Update ".manifest" with the latest list of project filenames. Respect\
|
4
|
+
.gitignore by excluding everything that git ignores. Update `files` and\
|
5
|
+
`test_files` arrays in "*.gemspec" file if it's present.}
|
6
|
+
task :manifest do
|
7
|
+
list = Dir['**/*'].sort
|
8
|
+
spec_file = Dir['*.gemspec'].first
|
9
|
+
list -= [spec_file] if spec_file
|
10
|
+
|
11
|
+
File.read('.gitignore').each_line do |glob|
|
12
|
+
glob = glob.chomp.sub(/^\//, '')
|
13
|
+
list -= Dir[glob]
|
14
|
+
list -= Dir["#{glob}/**/*"] if File.directory?(glob) and !File.symlink?(glob)
|
15
|
+
puts "excluding #{glob}"
|
16
|
+
end
|
17
|
+
|
18
|
+
if spec_file
|
19
|
+
spec = File.read spec_file
|
20
|
+
spec.gsub! /^(\s* s.(test_)?files \s* = \s* )( \[ [^\]]* \] | %w\( [^)]* \) )/mx do
|
21
|
+
assignment = $1
|
22
|
+
bunch = $2 ? list.grep(/^test\//) : list
|
23
|
+
'%s%%w(%s)' % [assignment, bunch.join(' ')]
|
24
|
+
end
|
25
|
+
|
26
|
+
File.open(spec_file, 'w') {|f| f << spec }
|
27
|
+
end
|
28
|
+
File.open('Manifest', 'w') {|f| f << list.join("\n") }
|
29
|
+
end
|
30
|
+
desc "Build gemspec for github"
|
31
|
+
task :gemspec => :manifest do
|
32
|
+
require "yaml"
|
33
|
+
`rake gem`
|
34
|
+
data = YAML.load(open("poolparty.gemspec").read).to_ruby
|
35
|
+
File.open("poolparty.gemspec", "w+") {|f| f << data }
|
36
|
+
end
|
37
|
+
desc "Update gemspec with the time"
|
38
|
+
task :gemspec_update => :gemspec do
|
39
|
+
data = open("poolparty.gemspec").read
|
40
|
+
str = "Updated at #{Time.now.strftime("%I:%M%p, %D")}"
|
41
|
+
|
42
|
+
if data.scan(/Updated at/).empty?
|
43
|
+
data = data.gsub(/you just installed PoolParty\!/, '\0'+" (#{str})")
|
44
|
+
end
|
45
|
+
|
46
|
+
File.open("poolparty.gemspec", "w+") {|f| f << data }
|
47
|
+
end
|
48
|
+
desc "Release them gem to the gem server"
|
49
|
+
task :release => :gemspec_update do
|
50
|
+
`git ci -a -m "Updated gemspec for github"`
|
51
|
+
`git push gem`
|
52
|
+
end
|
53
|
+
end
|
@@ -8,7 +8,7 @@ Usage:
|
|
8
8
|
rake #{@command} location
|
9
9
|
|
10
10
|
Example:
|
11
|
-
rake #{@command} git://github.com/auser/
|
11
|
+
rake #{@command} git://github.com/auser/poolparty-plugins.git
|
12
12
|
|
13
13
|
Check the help does for more information how to install a plugin
|
14
14
|
http://poolpartyrb.com
|
data/poolparty.gemspec
CHANGED
@@ -1,72 +1,64 @@
|
|
1
|
-
|
2
|
-
# Gem::Specification for Poolparty-0.0.8
|
3
|
-
# Originally generated by Echoe
|
4
|
-
|
5
1
|
Gem::Specification.new do |s|
|
6
2
|
s.name = %q{poolparty}
|
7
|
-
s.version = "0.0.
|
8
|
-
|
9
|
-
s.specification_version = 2 if s.respond_to? :specification_version=
|
3
|
+
s.version = "0.0.9"
|
10
4
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
5
|
+
s.required_rubygems_version = Gem::Requirement.new("= 1.2") if s.respond_to? :required_rubygems_version=
|
12
6
|
s.authors = ["Ari Lerner"]
|
13
|
-
s.
|
7
|
+
s.cert_chain = nil
|
8
|
+
s.date = %q{2008-06-28}
|
14
9
|
s.description = %q{Run your entire application off EC2, managed and auto-scaling}
|
15
10
|
s.email = %q{ari.lerner@citrusbyte.com}
|
16
|
-
s.executables = ["instance", "pool"]
|
17
|
-
s.extra_rdoc_files = ["bin/instance", "bin/pool", "
|
18
|
-
s.files = ["
|
11
|
+
s.executables = ["instance", "pool", "poolnotify"]
|
12
|
+
s.extra_rdoc_files = ["CHANGELOG", "README.txt", "bin", "bin/instance", "bin/pool", "bin/poolnotify", "lib", "lib/core", "lib/core/array.rb", "lib/core/exception.rb", "lib/core/float.rb", "lib/core/hash.rb", "lib/core/kernel.rb", "lib/core/module.rb", "lib/core/object.rb", "lib/core/proc.rb", "lib/core/string.rb", "lib/core/time.rb", "lib/modules", "lib/modules/callback.rb", "lib/modules/ec2_wrapper.rb", "lib/modules/file_writer.rb", "lib/modules/safe_instance.rb", "lib/modules/sprinkle_overrides.rb", "lib/modules/vlad_override.rb", "lib/poolparty", "lib/poolparty.rb", "lib/poolparty/application.rb", "lib/poolparty/init.rb", "lib/poolparty/master.rb", "lib/poolparty/monitors", "lib/poolparty/monitors.rb", "lib/poolparty/monitors/cpu.rb", "lib/poolparty/monitors/memory.rb", "lib/poolparty/monitors/web.rb", "lib/poolparty/optioner.rb", "lib/poolparty/plugin.rb", "lib/poolparty/plugin_manager.rb", "lib/poolparty/provider", "lib/poolparty/provider.rb", "lib/poolparty/provider/packages", "lib/poolparty/provider/packages/essential.rb", "lib/poolparty/provider/packages/git.rb", "lib/poolparty/provider/packages/haproxy.rb", "lib/poolparty/provider/packages/heartbeat.rb", "lib/poolparty/provider/packages/monit.rb", "lib/poolparty/provider/packages/rsync.rb", "lib/poolparty/provider/packages/ruby.rb", "lib/poolparty/provider/packages/s3fuse.rb", "lib/poolparty/provider/provider.rb", "lib/poolparty/remote_instance.rb", "lib/poolparty/remoter.rb", "lib/poolparty/remoting.rb", "lib/poolparty/scheduler.rb", "lib/poolparty/tasks", "lib/poolparty/tasks.rb", "lib/poolparty/tasks/cloud.rake", "lib/poolparty/tasks/development.rake", "lib/poolparty/tasks/ec2.rake", "lib/poolparty/tasks/instance.rake", "lib/poolparty/tasks/package.rake", "lib/poolparty/tasks/plugins.rake", "lib/poolparty/tasks/server.rake", "lib/s3", "lib/s3/s3_object_store_folders.rb"]
|
13
|
+
s.files = ["CHANGELOG", "README.txt", "Rakefile", "assets", "assets/clouds.png", "bin", "bin/instance", "bin/pool", "bin/poolnotify", "config", "config/cloud_master_takeover", "config/create_proxy_ami.sh", "config/haproxy.conf", "config/heartbeat.conf", "config/heartbeat_authkeys.conf", "config/installers", "config/installers/ubuntu_install.sh", "config/monit", "config/monit.conf", "config/monit/haproxy.monit.conf", "config/monit/nginx.monit.conf", "config/nginx.conf", "config/reconfigure_instances_script.sh", "config/sample-config.yml", "config/scp_instances_script.sh", "lib", "lib/core", "lib/core/array.rb", "lib/core/exception.rb", "lib/core/float.rb", "lib/core/hash.rb", "lib/core/kernel.rb", "lib/core/module.rb", "lib/core/object.rb", "lib/core/proc.rb", "lib/core/string.rb", "lib/core/time.rb", "lib/modules", "lib/modules/callback.rb", "lib/modules/ec2_wrapper.rb", "lib/modules/file_writer.rb", "lib/modules/safe_instance.rb", "lib/modules/sprinkle_overrides.rb", "lib/modules/vlad_override.rb", "lib/poolparty", "lib/poolparty.rb", "lib/poolparty/application.rb", "lib/poolparty/init.rb", "lib/poolparty/master.rb", "lib/poolparty/monitors", "lib/poolparty/monitors.rb", "lib/poolparty/monitors/cpu.rb", "lib/poolparty/monitors/memory.rb", "lib/poolparty/monitors/web.rb", "lib/poolparty/optioner.rb", "lib/poolparty/plugin.rb", "lib/poolparty/plugin_manager.rb", "lib/poolparty/provider", "lib/poolparty/provider.rb", "lib/poolparty/provider/packages", "lib/poolparty/provider/packages/essential.rb", "lib/poolparty/provider/packages/git.rb", "lib/poolparty/provider/packages/haproxy.rb", "lib/poolparty/provider/packages/heartbeat.rb", "lib/poolparty/provider/packages/monit.rb", "lib/poolparty/provider/packages/rsync.rb", "lib/poolparty/provider/packages/ruby.rb", "lib/poolparty/provider/packages/s3fuse.rb", "lib/poolparty/provider/provider.rb", "lib/poolparty/remote_instance.rb", "lib/poolparty/remoter.rb", "lib/poolparty/remoting.rb", "lib/poolparty/scheduler.rb", "lib/poolparty/tasks", "lib/poolparty/tasks.rb", "lib/poolparty/tasks/cloud.rake", "lib/poolparty/tasks/development.rake", "lib/poolparty/tasks/ec2.rake", "lib/poolparty/tasks/instance.rake", "lib/poolparty/tasks/package.rake", "lib/poolparty/tasks/plugins.rake", "lib/poolparty/tasks/server.rake", "lib/s3", "lib/s3/s3_object_store_folders.rb", "spec", "spec/application_spec.rb", "spec/callback_spec.rb", "spec/core_spec.rb", "spec/ec2_wrapper_spec.rb", "spec/file_writer_spec.rb", "spec/files", "spec/files/describe_response", "spec/files/multi_describe_response", "spec/files/remote_desc_response", "spec/helpers", "spec/helpers/ec2_mock.rb", "spec/kernel_spec.rb", "spec/master_spec.rb", "spec/monitors", "spec/monitors/cpu_monitor_spec.rb", "spec/monitors/memory_spec.rb", "spec/monitors/misc_monitor_spec.rb", "spec/monitors/web_spec.rb", "spec/optioner_spec.rb", "spec/plugin_manager_spec.rb", "spec/plugin_spec.rb", "spec/pool_binary_spec.rb", "spec/poolparty_spec.rb", "spec/provider_spec.rb", "spec/remote_instance_spec.rb", "spec/remoter_spec.rb", "spec/remoting_spec.rb", "spec/scheduler_spec.rb", "spec/spec_helper.rb", "spec/string_spec.rb", "poolparty.gemspec"]
|
19
14
|
s.has_rdoc = true
|
20
15
|
s.homepage = %q{http://blog.citrusbyte.com}
|
21
|
-
s.post_install_message = %q{
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
16
|
+
s.post_install_message = %q{
|
17
|
+
|
18
|
+
Get ready to jump in the pool, you just installed PoolParty! (Updated at 05:15PM, 06/28/08)
|
19
|
+
|
20
|
+
Please check out the documentation for any questions or check out the google groups at
|
21
|
+
http://groups.google.com/group/poolpartyrb
|
22
|
+
|
23
|
+
Don't forget to check out the plugin tutorial @ http://poolpartyrb.com for extending PoolParty!
|
24
|
+
|
25
|
+
For more information, check http://poolpartyrb.com
|
26
|
+
On IRC:
|
27
|
+
irc.freenode.net
|
28
|
+
#poolpartyrb
|
29
|
+
*** Ari Lerner @ <ari.lerner@citrusbyte.com> ***
|
30
|
+
}
|
31
31
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Poolparty", "--main", "README.txt"]
|
32
32
|
s.require_paths = ["lib"]
|
33
33
|
s.rubyforge_project = %q{poolparty}
|
34
|
-
s.rubygems_version = %q{1.
|
34
|
+
s.rubygems_version = %q{1.2.0}
|
35
35
|
s.summary = %q{Run your entire application off EC2, managed and auto-scaling}
|
36
36
|
|
37
|
-
s.
|
38
|
-
|
39
|
-
|
40
|
-
s.add_dependency(%q<git>, [">= 0"])
|
41
|
-
end
|
42
|
-
|
37
|
+
if s.respond_to? :specification_version then
|
38
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
39
|
+
s.specification_version = 2
|
43
40
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
# EOM
|
69
|
-
# p.include_rakefile = true
|
70
|
-
# end
|
71
|
-
#
|
72
|
-
# PoolParty.include_tasks
|
41
|
+
if current_version >= 3 then
|
42
|
+
s.add_runtime_dependency(%q<aws-s3>, [">= 0"])
|
43
|
+
s.add_runtime_dependency(%q<amazon-ec2>, [">= 0"])
|
44
|
+
s.add_runtime_dependency(%q<auser-aska>, [">= 0"])
|
45
|
+
s.add_runtime_dependency(%q<git>, [">= 0"])
|
46
|
+
s.add_runtime_dependency(%q<crafterm-sprinkle>, [">= 0"])
|
47
|
+
s.add_runtime_dependency(%q<SystemTimer>, [">= 0"])
|
48
|
+
else
|
49
|
+
s.add_dependency(%q<aws-s3>, [">= 0"])
|
50
|
+
s.add_dependency(%q<amazon-ec2>, [">= 0"])
|
51
|
+
s.add_dependency(%q<auser-aska>, [">= 0"])
|
52
|
+
s.add_dependency(%q<git>, [">= 0"])
|
53
|
+
s.add_dependency(%q<crafterm-sprinkle>, [">= 0"])
|
54
|
+
s.add_dependency(%q<SystemTimer>, [">= 0"])
|
55
|
+
end
|
56
|
+
else
|
57
|
+
s.add_dependency(%q<aws-s3>, [">= 0"])
|
58
|
+
s.add_dependency(%q<amazon-ec2>, [">= 0"])
|
59
|
+
s.add_dependency(%q<auser-aska>, [">= 0"])
|
60
|
+
s.add_dependency(%q<git>, [">= 0"])
|
61
|
+
s.add_dependency(%q<crafterm-sprinkle>, [">= 0"])
|
62
|
+
s.add_dependency(%q<SystemTimer>, [">= 0"])
|
63
|
+
end
|
64
|
+
end
|
data/spec/application_spec.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/spec_helper'
|
2
2
|
|
3
3
|
describe "Application" do
|
4
|
+
before(:each) do
|
5
|
+
stub_option_load
|
6
|
+
end
|
4
7
|
it "should be able to send options in the Application.options" do
|
5
8
|
options({:optparse => {:banner => "hi"}})
|
6
9
|
end
|
@@ -36,4 +39,29 @@ describe "Application" do
|
|
36
39
|
it "should show the version as a string" do
|
37
40
|
Application.version.class.should == String
|
38
41
|
end
|
42
|
+
it "should be able to start instances with the the key access information on the user-data" do
|
43
|
+
Application.launching_user_data.should =~ /:access_key/
|
44
|
+
Application.launching_user_data.should =~ /:secret_access_key/
|
45
|
+
end
|
46
|
+
it "should be able to pull out the access_key from the user data" do
|
47
|
+
Application.local_user_data[:access_key].should == 3.14159
|
48
|
+
end
|
49
|
+
it "should overwrite the default_options when passing in to the instance data" do
|
50
|
+
Application.stub!(:default_options).and_return({:access_key => 42})
|
51
|
+
Application.options.access_key.should == 3.14159
|
52
|
+
end
|
53
|
+
it "should parse and use a config file if it is given for the options" do
|
54
|
+
YAML.should_receive(:load).and_return({:config_file => "config/sample-config.yml"})
|
55
|
+
Application.make_options(:config_file => "config/sample-config.yml")
|
56
|
+
end
|
57
|
+
it "should not read the config file if it is not passed and doesn't exist" do
|
58
|
+
File.stub!(:file?).and_return false
|
59
|
+
YAML.should_not_receive(:load)
|
60
|
+
Application.make_options
|
61
|
+
end
|
62
|
+
it "should not read the config file if it is passed and doesn't exist" do
|
63
|
+
File.stub!(:file?).and_return false
|
64
|
+
YAML.should_not_receive(:load)
|
65
|
+
Application.make_options(:config_file => "ted")
|
66
|
+
end
|
39
67
|
end
|