blimpy 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +33 -4
- data/features/cli/start.feature +14 -4
- data/lib/blimpy/box.rb +2 -3
- data/lib/blimpy/boxes/aws.rb +6 -3
- data/lib/blimpy/cli.rb +0 -2
- data/lib/blimpy/fleet.rb +40 -5
- data/lib/blimpy/version.rb +1 -1
- metadata +8 -8
data/README.md
CHANGED
@@ -5,6 +5,35 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
### About
|
8
|
+
|
9
|
+
Blimpy is a tool to help developers spin up and utilize machines "in the
|
10
|
+
cloud."
|
11
|
+
|
12
|
+
Once a developer has a Blimpfile, they can execute a few simple commands to
|
13
|
+
manage the newly created "fleet" in the specified cloud provider:
|
14
|
+
|
15
|
+
```
|
16
|
+
% blimpy start
|
17
|
+
[snip]
|
18
|
+
>> excelsior ..... online at: ec2-50-112-3-57.us-west-2.compute.amazonaws.com..
|
19
|
+
>> goodyear ..... online at: ec2-50-112-27-89.us-west-2.compute.amazonaws.com
|
20
|
+
%
|
21
|
+
```
|
22
|
+
|
23
|
+
Once machines are online, they're easy to access by name with:
|
24
|
+
|
25
|
+
```
|
26
|
+
% blimpy scp goodyear secrets.tar.gz
|
27
|
+
% blimpy ssh goodyear
|
28
|
+
```
|
29
|
+
|
30
|
+
Then once you're finished working with the machines a simple `blimpy destroy`
|
31
|
+
will terminate the machines.
|
32
|
+
|
33
|
+
---
|
34
|
+
|
35
|
+
(Inspired by [Vagrant](http://vagrantup.com))
|
36
|
+
|
8
37
|
Notes and other bits are being stored in [this public Evernote
|
9
38
|
notebook](https://www.evernote.com/pub/agentdero/blimpy).
|
10
39
|
|
@@ -19,11 +48,11 @@ Here's an example Blimpfile:
|
|
19
48
|
```ruby
|
20
49
|
Blimpy.fleet do |fleet|
|
21
50
|
fleet.add(:aws) do |ship|
|
22
|
-
ship.
|
23
|
-
ship.
|
51
|
+
ship.name = 'rails-app'
|
52
|
+
ship.image_id = 'ami-349b495d' # optional, defaults to Ubuntu 10.04 64-bit
|
53
|
+
ship.livery = 'rails' # optional
|
24
54
|
ship.group = 'Simple' # [Required] The name of the desired Security Group
|
25
|
-
ship.region = 'us-west-1'
|
26
|
-
ship.name = 'Rails App Server'
|
55
|
+
ship.region = 'us-west-1' # optional, defaults to us-west-2
|
27
56
|
end
|
28
57
|
end
|
29
58
|
```
|
data/features/cli/start.feature
CHANGED
@@ -23,7 +23,7 @@ Feature: Start a VM or cluster of VMs in the cloud
|
|
23
23
|
Then the exit status should be 0
|
24
24
|
And the output should contain:
|
25
25
|
"""
|
26
|
-
|
26
|
+
skipping actually starting the fleet
|
27
27
|
"""
|
28
28
|
|
29
29
|
Scenario: Start with an invalid Blimpfile
|
@@ -55,12 +55,22 @@ Feature: Start a VM or cluster of VMs in the cloud
|
|
55
55
|
Then the exit status should be 0
|
56
56
|
And the output should contain:
|
57
57
|
"""
|
58
|
-
|
58
|
+
online at:
|
59
59
|
"""
|
60
|
-
|
60
|
+
|
61
|
+
@slow @destroy
|
62
|
+
Scenario: Start a bigger instance
|
63
|
+
Given I have the Blimpfile:
|
61
64
|
"""
|
62
|
-
|
65
|
+
Blimpy.fleet do |f|
|
66
|
+
f.add(:aws) do |host|
|
67
|
+
host.name = 'Cucumber Host'
|
68
|
+
host.flavor = 'm1.large'
|
69
|
+
end
|
70
|
+
end
|
63
71
|
"""
|
72
|
+
When I run `blimpy start`
|
73
|
+
Then the exit status should be 0
|
64
74
|
|
65
75
|
@slow @destroy @openstack @wip
|
66
76
|
Scenario: start with an OpenStack Blimpfile
|
data/lib/blimpy/box.rb
CHANGED
@@ -8,8 +8,8 @@ module Blimpy
|
|
8
8
|
include Blimpy::Helpers::State
|
9
9
|
|
10
10
|
attr_reader :allowed_regions, :region
|
11
|
-
attr_accessor :image_id, :
|
12
|
-
attr_accessor :name, :tags, :fleet_id, :username
|
11
|
+
attr_accessor :image_id, :flavor, :group
|
12
|
+
attr_accessor :name, :tags, :fleet_id, :username, :livery
|
13
13
|
|
14
14
|
|
15
15
|
def self.from_instance_id(an_id, data)
|
@@ -151,7 +151,6 @@ module Blimpy
|
|
151
151
|
end
|
152
152
|
|
153
153
|
def bootstrap_livery
|
154
|
-
tarball = nil
|
155
154
|
if livery == :cwd
|
156
155
|
dir_name = File.basename(Dir.pwd)
|
157
156
|
run_command('rsync', '-av',
|
data/lib/blimpy/boxes/aws.rb
CHANGED
@@ -20,6 +20,8 @@ module Blimpy::Boxes
|
|
20
20
|
@region = DEFAULT_REGION
|
21
21
|
@image_id = DEFAULT_IMAGE_ID
|
22
22
|
@username = 'ubuntu'
|
23
|
+
@flavor = 't1.micro'
|
24
|
+
@group = 'default'
|
23
25
|
end
|
24
26
|
|
25
27
|
def validate!
|
@@ -45,9 +47,10 @@ module Blimpy::Boxes
|
|
45
47
|
|
46
48
|
Blimpy::Keys.import_key(fog)
|
47
49
|
fog.servers.create(:image_id => @image_id,
|
48
|
-
|
49
|
-
|
50
|
-
|
50
|
+
:flavor_id => @flavor,
|
51
|
+
:key_name => Blimpy::Keys.key_name,
|
52
|
+
:groups => [@group],
|
53
|
+
:tags => tags)
|
51
54
|
end
|
52
55
|
end
|
53
56
|
end
|
data/lib/blimpy/cli.rb
CHANGED
data/lib/blimpy/fleet.rb
CHANGED
@@ -10,6 +10,7 @@ module Blimpy
|
|
10
10
|
def initialize
|
11
11
|
@ships = []
|
12
12
|
@id = Time.now.utc.to_i
|
13
|
+
@airborn = false
|
13
14
|
end
|
14
15
|
|
15
16
|
def valid_types
|
@@ -60,6 +61,37 @@ module Blimpy
|
|
60
61
|
puts
|
61
62
|
end
|
62
63
|
|
64
|
+
def animate
|
65
|
+
buffer ="""
|
66
|
+
_..--=--..._
|
67
|
+
.-' '-. .-.
|
68
|
+
/.' '.\\/ /
|
69
|
+
|=- B L I M P Y -=| (
|
70
|
+
\\'. .'/\\ \\
|
71
|
+
'-.,_____ _____.-' '-'
|
72
|
+
[_____]=+ ~ ~"""
|
73
|
+
frames = [
|
74
|
+
'x~ ',
|
75
|
+
'x ~ ',
|
76
|
+
'+~ ~ ',
|
77
|
+
'+ ~ ~',
|
78
|
+
'+ ~ ',
|
79
|
+
'x ~',
|
80
|
+
]
|
81
|
+
|
82
|
+
print buffer
|
83
|
+
$stdout.flush
|
84
|
+
until @airborn do
|
85
|
+
frames.each do |frame|
|
86
|
+
# Reset every frame
|
87
|
+
5.times { print "\b" }
|
88
|
+
print frame
|
89
|
+
$stdout.flush
|
90
|
+
sleep 0.2
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
63
95
|
def start
|
64
96
|
instances = members
|
65
97
|
unless instances.empty?
|
@@ -71,16 +103,19 @@ module Blimpy
|
|
71
103
|
host.validate!
|
72
104
|
end
|
73
105
|
|
74
|
-
|
106
|
+
Thread.new do
|
107
|
+
animate
|
108
|
+
end
|
109
|
+
|
75
110
|
@ships.each do |host|
|
76
|
-
puts "..#{host.name}"
|
77
111
|
host.start
|
78
112
|
end
|
79
113
|
|
80
114
|
@ships.each do |host|
|
81
|
-
|
82
|
-
|
83
|
-
print "
|
115
|
+
host.wait_for_state('running') { }
|
116
|
+
@airborn = true
|
117
|
+
print "\n"
|
118
|
+
puts ">> #{host.name} online at: #{host.dns_name}"
|
84
119
|
host.online!
|
85
120
|
host.bootstrap
|
86
121
|
puts
|
data/lib/blimpy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blimpy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-20 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fog
|
16
|
-
requirement: &
|
16
|
+
requirement: &10172400 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *10172400
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: thor
|
27
|
-
requirement: &
|
27
|
+
requirement: &10171980 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *10171980
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: minitar
|
38
|
-
requirement: &
|
38
|
+
requirement: &10171560 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *10171560
|
47
47
|
description: Blimpy is a tool for managing a fleet of machines in the CLOUD!
|
48
48
|
email:
|
49
49
|
- tyler@monkeypox.org
|