bosh-cloudfoundry 0.2.1 → 0.3.0
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/ChangeLog.md +11 -0
- data/README.md +14 -5
- data/lib/bosh-cloudfoundry/config/common_config.rb +2 -0
- data/lib/bosh-cloudfoundry/config/dea_config.rb +12 -1
- data/lib/bosh-cloudfoundry/config/microbosh_config.rb +13 -0
- data/lib/bosh-cloudfoundry/config/system_config.rb +2 -1
- data/lib/bosh-cloudfoundry/config_options.rb +16 -3
- data/lib/bosh-cloudfoundry/providers.rb +3 -0
- data/lib/bosh-cloudfoundry/providers/openstack.rb +69 -0
- data/lib/bosh-cloudfoundry/system_deployment_manifest_renderer.rb +8 -2
- data/lib/bosh-cloudfoundry/version.rb +1 -1
- data/lib/bosh/cli/commands/cf.rb +31 -6
- data/spec/assets/deployments/aws-core-1-m1.small-free-redis.yml +3 -3
- data/spec/assets/deployments/aws-core-1-m1.xlarge-free-postgresql-2-m1.small-free-postgresql.yml +3 -3
- data/spec/assets/deployments/aws-core-2-m1.xlarge-dea.yml +2 -2
- data/spec/assets/deployments/aws-core-only.yml +3 -3
- data/spec/assets/deployments/aws-core-with-nfs.yml +1 -1
- data/spec/unit/cf_command_spec.rb +4 -0
- data/spec/unit/config/dea_config_spec.rb +4 -1
- data/spec/unit/system_deployment_manifest_renderer_spec.rb +9 -3
- metadata +6 -4
data/ChangeLog.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## v0.3
|
4
|
+
|
5
|
+
Additions:
|
6
|
+
|
7
|
+
* OpenStack support! [thx @frodenas; tested by @danhighman] many hugs & kisses to you both!
|
8
|
+
|
9
|
+
Fixes:
|
10
|
+
|
11
|
+
* changed `health_manager` to `health_manager_next` job (legacy hm was removed in [cf-release patch](https://github.com/cloudfoundry/cf-release/commit/cba60f2e2dee13b7e09eb178eec72aa084a15b1a))
|
data/README.md
CHANGED
@@ -18,7 +18,16 @@ bosh-bootstrap deploy --latest-stemcell
|
|
18
18
|
bosh-bootstrap ssh
|
19
19
|
|
20
20
|
# now on the inception VM
|
21
|
-
|
21
|
+
|
22
|
+
# TODO - restore gem installation when rubygem security issue resolved
|
23
|
+
# sudo gem install bosh-cloudfoundry
|
24
|
+
|
25
|
+
cd /var/vcap/store/repos
|
26
|
+
git clone git://github.com/StarkAndWayne/bosh-cloudfoundry.git
|
27
|
+
cd bosh-cloudfoundry
|
28
|
+
git checkout -b v0.3
|
29
|
+
git pull origin v0.3
|
30
|
+
rake install
|
22
31
|
|
23
32
|
export TMPDIR=/var/vcap/store/tmp
|
24
33
|
bosh cf upload release --dev
|
@@ -31,14 +40,14 @@ bosh cf prepare system production --release-name appcloud-dev
|
|
31
40
|
bosh cf prepare system production
|
32
41
|
|
33
42
|
bosh cf upload stemcell --latest
|
34
|
-
bosh cf merge gerrit 37/13137/4 84/13084/4 83/13583/1
|
35
|
-
bosh deploy
|
43
|
+
bosh cf merge gerrit 37/13137/4 84/13084/4 83/13583/1 09/13609/2
|
44
|
+
bosh cf deploy
|
36
45
|
|
37
46
|
# now we can grow our single VM deployment
|
38
47
|
|
39
48
|
bosh cf change deas 1
|
40
49
|
bosh cf add service postgresql
|
41
|
-
bosh deploy
|
50
|
+
bosh cf deploy
|
42
51
|
```
|
43
52
|
|
44
53
|
Overtime, as you add more DEAs and other service nodes, your set of VMs might look like:
|
@@ -87,7 +96,7 @@ bosh cf prepare system production
|
|
87
96
|
# prompts for a DNS host for your CloudFoundry, such as mycompany.com
|
88
97
|
bosh cf change deas 1
|
89
98
|
bosh cf add service postgresql 1
|
90
|
-
bosh deploy
|
99
|
+
bosh cf deploy
|
91
100
|
```
|
92
101
|
|
93
102
|
During `bosh cf prepare system production`, it will automatically upload the latest release of CloudFoundry (the latest final [BOSH release](http://github.com/cloudfoundry/cf-release)) and the latest stable stemcell (becomes the base AMI for AWS, for example).
|
@@ -121,11 +121,14 @@ class Bosh::CloudFoundry::Config::DeaConfig
|
|
121
121
|
}
|
122
122
|
end
|
123
123
|
|
124
|
+
# The RAM for a dedicated DEA node
|
125
|
+
# else the RAM of the core/0 VM
|
126
|
+
# minus the +preallocated_ram+.
|
124
127
|
def max_memory
|
125
128
|
if dea_server_count > 0
|
126
129
|
max_memory_for_dedicated_dea
|
127
130
|
else
|
128
|
-
|
131
|
+
dea_ram_for_core_vm_flavor
|
129
132
|
end
|
130
133
|
end
|
131
134
|
|
@@ -139,6 +142,14 @@ class Bosh::CloudFoundry::Config::DeaConfig
|
|
139
142
|
300
|
140
143
|
end
|
141
144
|
|
145
|
+
def dea_ram_for_core_vm_flavor
|
146
|
+
ram_for_core_vm_flavor - preallocated_ram
|
147
|
+
end
|
148
|
+
|
149
|
+
def ram_for_core_vm_flavor
|
150
|
+
provider.ram_for_server_flavor(system_config.core_server_flavor)
|
151
|
+
end
|
152
|
+
|
142
153
|
def ram_for_server_flavor
|
143
154
|
provider.ram_for_server_flavor(dea_server_flavor)
|
144
155
|
end
|
@@ -38,6 +38,15 @@ class Bosh::CloudFoundry::Config::MicroboshConfig
|
|
38
38
|
aws_access_key_id: provider_credentials["access_key_id"],
|
39
39
|
aws_secret_access_key: provider_credentials["secret_access_key"]
|
40
40
|
}
|
41
|
+
elsif openstack?
|
42
|
+
{
|
43
|
+
provider: "openstack",
|
44
|
+
openstack_username: provider_credentials["username"],
|
45
|
+
openstack_api_key: provider_credentials["api_key"],
|
46
|
+
openstack_tenant: provider_credentials["tenant"],
|
47
|
+
openstack_auth_url: provider_credentials["auth_url"],
|
48
|
+
openstack_region: provider_credentials["region"]
|
49
|
+
}
|
41
50
|
else
|
42
51
|
raise "please implement #fog_credentials for #{bosh_provider}"
|
43
52
|
end
|
@@ -55,6 +64,10 @@ class Bosh::CloudFoundry::Config::MicroboshConfig
|
|
55
64
|
bosh_provider == "aws"
|
56
65
|
end
|
57
66
|
|
67
|
+
def openstack?
|
68
|
+
bosh_provider == "openstack"
|
69
|
+
end
|
70
|
+
|
58
71
|
# micro_bosh.yml looks like:
|
59
72
|
#
|
60
73
|
# cloud:
|
@@ -40,7 +40,8 @@ class Bosh::CloudFoundry::Config::SystemConfig < Bosh::Cli::Config
|
|
40
40
|
:dea, # e.g. { "count" => 2, "flavor" => "m1.large" }
|
41
41
|
:postgresql, # e.g. [{ "count" => 2, "flavor" => "m1.large", "plan" => "free" }]
|
42
42
|
:redis, # e.g. [{ "count" => 2, "flavor" => "m1.large", "plan" => "free" }]
|
43
|
-
:security_group
|
43
|
+
:security_group, # e.g. "cloudfoundry-production"
|
44
|
+
:system_initialized, # e.g. true / false
|
44
45
|
].each do |attr|
|
45
46
|
define_method attr do
|
46
47
|
read(attr, false)
|
@@ -46,7 +46,7 @@ module Bosh::CloudFoundry::ConfigOptions
|
|
46
46
|
system_config = Bosh::CloudFoundry::Config::SystemConfig.new(system)
|
47
47
|
system_config.bosh_target = options[:bosh_target] || config.target
|
48
48
|
system_config.bosh_target_uuid = options[:bosh_target_uuid] || config.target_uuid
|
49
|
-
system_config.bosh_provider =
|
49
|
+
system_config.bosh_provider = options[:bosh_provider] || bosh_cpi
|
50
50
|
system_config.release_name ||= DEFAULT_RELEASE_NAME
|
51
51
|
system_config.release_version ||= DEFAULT_RELEASE_VERSION
|
52
52
|
system_config.stemcell_name ||= DEFAULT_STEMCELL_NAME
|
@@ -196,6 +196,10 @@ module Bosh::CloudFoundry::ConfigOptions
|
|
196
196
|
options[:bosh_git_repo] || common_config.bosh_git_repo
|
197
197
|
end
|
198
198
|
|
199
|
+
def bosh_cpi
|
200
|
+
`bosh status | grep CPI | awk '{ print $2 }'`.strip
|
201
|
+
end
|
202
|
+
|
199
203
|
def deployment_manifest(subsystem="core")
|
200
204
|
YAML.load_file(deployment_manifest_path(subsystem))
|
201
205
|
end
|
@@ -223,6 +227,15 @@ module Bosh::CloudFoundry::ConfigOptions
|
|
223
227
|
end
|
224
228
|
end
|
225
229
|
|
230
|
+
def system_initialized?
|
231
|
+
system_config.system_initialized
|
232
|
+
end
|
233
|
+
|
234
|
+
def system_initialized!
|
235
|
+
system_config.system_initialized = true
|
236
|
+
system_config.save
|
237
|
+
end
|
238
|
+
|
226
239
|
def choose_releases_dir
|
227
240
|
if non_interactive?
|
228
241
|
err "Please set releases_dir configuration for non-interactive mode"
|
@@ -280,13 +293,13 @@ module Bosh::CloudFoundry::ConfigOptions
|
|
280
293
|
err "Please set core_ip configuration for non-interactive mode"
|
281
294
|
end
|
282
295
|
|
283
|
-
if aws?
|
296
|
+
if aws? || openstack?
|
284
297
|
system_config.core_ip = ask("Main public IP address (press Enter to provision new IP): ").to_s
|
285
298
|
else
|
286
299
|
system_config.core_ip = ask("Main public IP address: ").to_s
|
287
300
|
end
|
288
301
|
if system_config.core_ip.blank?
|
289
|
-
say "Provisioning #{bosh_provider} public IP address..."
|
302
|
+
say "Provisioning #{system_config.bosh_provider} public IP address..."
|
290
303
|
system_config.core_ip = provider.provision_public_ip_address
|
291
304
|
if system_config.core_ip.blank?
|
292
305
|
say "Hmmm, I wasn't able to get a public IP at the moment. Perhaps try again or provision it manually?".red
|
@@ -10,6 +10,8 @@ module Bosh::CloudFoundry::Providers
|
|
10
10
|
case system_config.bosh_provider.to_sym
|
11
11
|
when :aws
|
12
12
|
Bosh::CloudFoundry::Providers::AWS.new(system_config.microbosh.fog_compute)
|
13
|
+
when :openstack
|
14
|
+
Bosh::CloudFoundry::Providers::OpenStack.new(system_config.microbosh.fog_compute)
|
13
15
|
else
|
14
16
|
raise "please support #{system_config.bosh_provider} provider"
|
15
17
|
end
|
@@ -17,3 +19,4 @@ module Bosh::CloudFoundry::Providers
|
|
17
19
|
end
|
18
20
|
|
19
21
|
require "bosh-cloudfoundry/providers/aws"
|
22
|
+
require "bosh-cloudfoundry/providers/openstack"
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# Copyright (c) 2012-2013 Stark & Wayne, LLC
|
2
|
+
|
3
|
+
module Bosh; module CloudFoundry; module Providers; end; end; end
|
4
|
+
|
5
|
+
class Bosh::CloudFoundry::Providers::OpenStack
|
6
|
+
attr_reader :fog_compute
|
7
|
+
def initialize(fog_compute=nil)
|
8
|
+
@fog_compute = fog_compute
|
9
|
+
end
|
10
|
+
|
11
|
+
# @return [String] provisions a new public IP address in target region
|
12
|
+
# TODO nil if none available
|
13
|
+
def provision_public_ip_address
|
14
|
+
address = fog_compute.addresses.create
|
15
|
+
address.ip
|
16
|
+
# TODO catch error and return nil
|
17
|
+
end
|
18
|
+
|
19
|
+
# @return [Integer] megabytes of RAM for requested flavor of server
|
20
|
+
def ram_for_server_flavor(server_flavor)
|
21
|
+
if flavor = fog_compute_flavor(server_flavor)
|
22
|
+
flavor.ram
|
23
|
+
else
|
24
|
+
raise "Unknown OpenStack flavor '#{server_flavor}'"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def fog_compute_flavor(server_flavor)
|
29
|
+
compute_flavors.find { |f| f.name == server_flavor }
|
30
|
+
end
|
31
|
+
|
32
|
+
def compute_flavors
|
33
|
+
fog_compute.flavors
|
34
|
+
end
|
35
|
+
|
36
|
+
# Creates or reuses an OpenStack security group and opens ports.
|
37
|
+
#
|
38
|
+
# +security_group_name+ is the name to be created or reused
|
39
|
+
# +ports+ is a hash of name/port for ports to open, for example:
|
40
|
+
# {
|
41
|
+
# ssh: 22,
|
42
|
+
# http: 80,
|
43
|
+
# https: 443
|
44
|
+
# }
|
45
|
+
def create_security_group(security_group_name, ports)
|
46
|
+
security_groups = fog_compute.security_groups
|
47
|
+
unless sg = security_groups.find { |s| s.name == security_group_name }
|
48
|
+
sg = fog_compute.security_groups.create(name: security_group_name, description: security_group_name)
|
49
|
+
puts "Created security group #{security_group_name}"
|
50
|
+
else
|
51
|
+
puts "Reusing security group #{security_group_name}"
|
52
|
+
end
|
53
|
+
ip_permissions = sg.rules
|
54
|
+
ports_opened = 0
|
55
|
+
ports.each do |name, port|
|
56
|
+
unless port_open?(ip_permissions, port)
|
57
|
+
sg.create_security_group_rule(port, port)
|
58
|
+
puts " -> opened #{name} port #{port}"
|
59
|
+
ports_opened += 1
|
60
|
+
end
|
61
|
+
end
|
62
|
+
puts " -> no additional ports opened" if ports_opened == 0
|
63
|
+
true
|
64
|
+
end
|
65
|
+
|
66
|
+
def port_open?(ip_permissions, port)
|
67
|
+
ip_permissions && ip_permissions.find {|ip| ip["from_port"] <= port && ip["to_port"] >= port }
|
68
|
+
end
|
69
|
+
end
|
@@ -111,6 +111,8 @@ class Bosh::CloudFoundry::SystemDeploymentManifestRenderer
|
|
111
111
|
def cloud_properties_for_server_flavor(server_flavor)
|
112
112
|
if aws?
|
113
113
|
{ "instance_type" => server_flavor }
|
114
|
+
elsif openstack?
|
115
|
+
{ "instance_type" => server_flavor }
|
114
116
|
else
|
115
117
|
raise 'Please implement #{self.class}#cloud_properties_for_server_flavor'
|
116
118
|
end
|
@@ -120,6 +122,10 @@ class Bosh::CloudFoundry::SystemDeploymentManifestRenderer
|
|
120
122
|
system_config.bosh_provider == "aws"
|
121
123
|
end
|
122
124
|
|
125
|
+
def openstack?
|
126
|
+
system_config.bosh_provider == "openstack"
|
127
|
+
end
|
128
|
+
|
123
129
|
#
|
124
130
|
def base_manifest(
|
125
131
|
deployment_name,
|
@@ -179,7 +185,7 @@ class Bosh::CloudFoundry::SystemDeploymentManifestRenderer
|
|
179
185
|
["postgres",
|
180
186
|
"nats",
|
181
187
|
"router",
|
182
|
-
"
|
188
|
+
"health_manager_next",
|
183
189
|
"cloud_controller",
|
184
190
|
# "debian_nfs_server",
|
185
191
|
# "serialization_data_server",
|
@@ -280,7 +286,7 @@ class Bosh::CloudFoundry::SystemDeploymentManifestRenderer
|
|
280
286
|
"password"=>common_password,
|
281
287
|
"maxmemory"=>500000000},
|
282
288
|
"service_plans"=>{},
|
283
|
-
"dea"=>{"max_memory"=>
|
289
|
+
"dea"=>{"max_memory"=>4096}}}
|
284
290
|
end
|
285
291
|
|
286
292
|
end
|
data/lib/bosh/cli/commands/cf.rb
CHANGED
@@ -164,6 +164,16 @@ module Bosh::Cli::Command
|
|
164
164
|
set_deployment(deployment)
|
165
165
|
bosh_cmd "deploy"
|
166
166
|
end
|
167
|
+
email = system_config.admin_emails.first
|
168
|
+
password = system_config.common_password
|
169
|
+
sh "sudo gem install vmc --no-ri --no-rdoc" unless system_initialized?
|
170
|
+
sh "vmc target http://api.#{root_dns}"
|
171
|
+
if system_initialized?
|
172
|
+
sh "vmc login #{email} --password #{password}"
|
173
|
+
else
|
174
|
+
sh "vmc register #{email} --password #{password} --verify #{password}"
|
175
|
+
end
|
176
|
+
system_initialized!
|
167
177
|
end
|
168
178
|
|
169
179
|
usage "cf watch nats"
|
@@ -248,6 +258,8 @@ module Bosh::Cli::Command
|
|
248
258
|
def bosh_provider
|
249
259
|
if aws?
|
250
260
|
"aws"
|
261
|
+
elsif openstack?
|
262
|
+
"openstack"
|
251
263
|
else
|
252
264
|
err("Please implement cf.rb's bosh_provider for this IaaS")
|
253
265
|
end
|
@@ -255,9 +267,14 @@ module Bosh::Cli::Command
|
|
255
267
|
|
256
268
|
# Deploying CloudFoundry to AWS?
|
257
269
|
# Is the target BOSH's IaaS using the AWS CPI?
|
258
|
-
# FIXME Currently only AWS is supported so its always AWS
|
259
270
|
def aws?
|
260
|
-
|
271
|
+
system_config.bosh_provider == "aws"
|
272
|
+
end
|
273
|
+
|
274
|
+
# Deploying CloudFoundry to OpenStack?
|
275
|
+
# Is the target BOSH's IaaS using the OpenStack CPI?
|
276
|
+
def openstack?
|
277
|
+
system_config.bosh_provider == "openstack"
|
261
278
|
end
|
262
279
|
|
263
280
|
# User is prompted for common values at the
|
@@ -437,7 +454,7 @@ module Bosh::Cli::Command
|
|
437
454
|
# | bosh-stemcell-aws-0.6.7.tgz | aws |
|
438
455
|
def bosh_stemcell_name(stemcell_type)
|
439
456
|
tags = [bosh_provider]
|
440
|
-
tags << "stable" if stemcell_type == "stable"
|
457
|
+
tags << "stable" if stemcell_type == "stable" unless openstack?
|
441
458
|
bosh_stemcells_cmd = "bosh public stemcells --tags #{tags.join(',')}"
|
442
459
|
say "Locating bosh stemcell, running '#{bosh_stemcells_cmd}'..."
|
443
460
|
`#{bosh_stemcells_cmd} | grep ' bosh-stemcell-' | awk '{ print $2 }' | sort -r | head -n 1`.strip
|
@@ -528,6 +545,10 @@ module Bosh::Cli::Command
|
|
528
545
|
unless aws_compute_flavors.select { |flavor| flavor[:id] == flavor }
|
529
546
|
err("Server flavor '#{flavor}' is not a valid AWS compute flavor")
|
530
547
|
end
|
548
|
+
elsif openstack?
|
549
|
+
unless provider.fog_compute_flavor(flavor)
|
550
|
+
err("Server flavor '#{flavor}' is not a valid OpenStack compute flavor")
|
551
|
+
end
|
531
552
|
else
|
532
553
|
err("Please implemenet cf.rb's validate_compute_flavor for this IaaS")
|
533
554
|
end
|
@@ -537,9 +558,7 @@ module Bosh::Cli::Command
|
|
537
558
|
# then ensure that a generated value is stored
|
538
559
|
def generate_generatable_options
|
539
560
|
common_password
|
540
|
-
|
541
|
-
security_group
|
542
|
-
end
|
561
|
+
security_group
|
543
562
|
end
|
544
563
|
|
545
564
|
# Renders the +SystemConfig+ model (+system_config+) into the system's
|
@@ -626,6 +645,8 @@ module Bosh::Cli::Command
|
|
626
645
|
def default_core_server_flavor
|
627
646
|
if aws?
|
628
647
|
"m1.large"
|
648
|
+
elsif openstack?
|
649
|
+
"m1.large"
|
629
650
|
else
|
630
651
|
err("Please implement cf.rb's default_core_server_flavor for this IaaS")
|
631
652
|
end
|
@@ -634,6 +655,8 @@ module Bosh::Cli::Command
|
|
634
655
|
def default_dea_server_flavor
|
635
656
|
if aws?
|
636
657
|
"m1.large"
|
658
|
+
elsif openstack?
|
659
|
+
"m1.large"
|
637
660
|
else
|
638
661
|
err("Please implement cf.rb's default_server_flavor for this IaaS")
|
639
662
|
end
|
@@ -642,6 +665,8 @@ module Bosh::Cli::Command
|
|
642
665
|
def default_service_server_flavor(service_name)
|
643
666
|
if aws?
|
644
667
|
"m1.xlarge"
|
668
|
+
elsif openstack?
|
669
|
+
"m1.xlarge"
|
645
670
|
else
|
646
671
|
err("Please implement cf.rb's default_service_server_flavor for this IaaS")
|
647
672
|
end
|
@@ -3,7 +3,7 @@ name: production-core
|
|
3
3
|
director_uuid: DIRECTOR_UUID
|
4
4
|
release:
|
5
5
|
name: appcloud
|
6
|
-
version:
|
6
|
+
version: latest
|
7
7
|
compilation:
|
8
8
|
workers: 10
|
9
9
|
network: default
|
@@ -52,7 +52,7 @@ jobs:
|
|
52
52
|
- postgres
|
53
53
|
- nats
|
54
54
|
- router
|
55
|
-
-
|
55
|
+
- health_manager_next
|
56
56
|
- cloud_controller
|
57
57
|
- stager
|
58
58
|
- uaa
|
@@ -207,7 +207,7 @@ properties:
|
|
207
207
|
backup:
|
208
208
|
enable: true
|
209
209
|
dea:
|
210
|
-
max_memory:
|
210
|
+
max_memory: 1440.8
|
211
211
|
redis_gateway:
|
212
212
|
token: TOKEN
|
213
213
|
supported_versions:
|
data/spec/assets/deployments/aws-core-1-m1.xlarge-free-postgresql-2-m1.small-free-postgresql.yml
CHANGED
@@ -3,7 +3,7 @@ name: production-core
|
|
3
3
|
director_uuid: DIRECTOR_UUID
|
4
4
|
release:
|
5
5
|
name: appcloud
|
6
|
-
version:
|
6
|
+
version: latest
|
7
7
|
compilation:
|
8
8
|
workers: 10
|
9
9
|
network: default
|
@@ -61,7 +61,7 @@ jobs:
|
|
61
61
|
- postgres
|
62
62
|
- nats
|
63
63
|
- router
|
64
|
-
-
|
64
|
+
- health_manager_next
|
65
65
|
- cloud_controller
|
66
66
|
- stager
|
67
67
|
- uaa
|
@@ -228,7 +228,7 @@ properties:
|
|
228
228
|
backup:
|
229
229
|
enable: true
|
230
230
|
dea:
|
231
|
-
max_memory:
|
231
|
+
max_memory: 1440.8
|
232
232
|
postgresql_gateway:
|
233
233
|
admin_user: psql_admin
|
234
234
|
admin_passwd_hash:
|
@@ -3,7 +3,7 @@ name: production-core
|
|
3
3
|
director_uuid: DIRECTOR_UUID
|
4
4
|
release:
|
5
5
|
name: appcloud
|
6
|
-
version:
|
6
|
+
version: latest
|
7
7
|
compilation:
|
8
8
|
workers: 10
|
9
9
|
network: default
|
@@ -51,7 +51,7 @@ jobs:
|
|
51
51
|
- postgres
|
52
52
|
- nats
|
53
53
|
- router
|
54
|
-
-
|
54
|
+
- health_manager_next
|
55
55
|
- cloud_controller
|
56
56
|
- stager
|
57
57
|
- uaa
|
@@ -3,7 +3,7 @@ name: production-core
|
|
3
3
|
director_uuid: DIRECTOR_UUID
|
4
4
|
release:
|
5
5
|
name: appcloud
|
6
|
-
version:
|
6
|
+
version: latest
|
7
7
|
compilation:
|
8
8
|
workers: 10
|
9
9
|
network: default
|
@@ -43,7 +43,7 @@ jobs:
|
|
43
43
|
- postgres
|
44
44
|
- nats
|
45
45
|
- router
|
46
|
-
-
|
46
|
+
- health_manager_next
|
47
47
|
- cloud_controller
|
48
48
|
- stager
|
49
49
|
- uaa
|
@@ -175,4 +175,4 @@ properties:
|
|
175
175
|
service_plans: {}
|
176
176
|
|
177
177
|
dea:
|
178
|
-
max_memory:
|
178
|
+
max_memory: 1440.8
|
@@ -247,6 +247,10 @@ describe Bosh::Cli::Command::Base do
|
|
247
247
|
end
|
248
248
|
@cmd.should_receive(:set_deployment).exactly(2).times
|
249
249
|
@cmd.should_receive(:sh).with("bosh -n --color deploy").exactly(2).times
|
250
|
+
@cmd.should_receive(:sh).with("sudo gem install vmc --no-ri --no-rdoc")
|
251
|
+
@cmd.should_receive(:sh).with("vmc target http://api.mycompany.com")
|
252
|
+
@cmd.should_receive(:sh).with(
|
253
|
+
"vmc register drnic@starkandwayne.com --password c1oudc0wc1oudc0w --verify c1oudc0wc1oudc0w")
|
250
254
|
@cmd.deploy
|
251
255
|
end
|
252
256
|
|
@@ -12,7 +12,10 @@ describe Bosh::CloudFoundry::Config::DeaConfig do
|
|
12
12
|
@system_dir = File.join(@systems_dir, "production")
|
13
13
|
mkdir_p(@system_dir)
|
14
14
|
@system_config = Bosh::CloudFoundry::Config::SystemConfig.new(@system_dir)
|
15
|
+
@system_config.bosh_target = "http://6.7.8.9:25555"
|
16
|
+
@system_config.bosh_target_uuid = "DIRECTOR_UUID"
|
15
17
|
@system_config.bosh_provider = "aws"
|
18
|
+
@system_config.core_server_flavor = "m1.large"
|
16
19
|
@manifest = YAML.load_file(spec_asset("deployments/aws-core-only.yml"))
|
17
20
|
end
|
18
21
|
|
@@ -48,7 +51,7 @@ describe Bosh::CloudFoundry::Config::DeaConfig do
|
|
48
51
|
subject.merge_manifest_properties(@manifest)
|
49
52
|
@manifest["properties"]["dea"].should_not be_nil
|
50
53
|
@manifest["properties"]["dea"]["max_memory"].should_not be_nil
|
51
|
-
@manifest["properties"]["dea"]["max_memory"].should ==
|
54
|
+
@manifest["properties"]["dea"]["max_memory"].should == 7380
|
52
55
|
end
|
53
56
|
end
|
54
57
|
describe "5 x m1.xlarge deas on AWS" do
|
@@ -19,9 +19,11 @@ describe Bosh::CloudFoundry::SystemDeploymentManifestRenderer do
|
|
19
19
|
@system_dir = File.join(@systems_dir, "production")
|
20
20
|
mkdir_p(@system_dir)
|
21
21
|
@system_config = Bosh::CloudFoundry::Config::SystemConfig.new(@system_dir)
|
22
|
+
@system_config.bosh_target = "http://6.7.8.9:25555"
|
23
|
+
@system_config.bosh_target_uuid = "DIRECTOR_UUID"
|
22
24
|
@system_config.bosh_provider = 'aws'
|
23
25
|
@system_config.release_name = 'appcloud'
|
24
|
-
@system_config.release_version =
|
26
|
+
@system_config.release_version = 'latest'
|
25
27
|
@system_config.stemcell_name = 'bosh-stemcell'
|
26
28
|
@system_config.stemcell_version = '0.6.4'
|
27
29
|
@system_config.core_server_flavor = 'm1.small'
|
@@ -34,6 +36,12 @@ describe Bosh::CloudFoundry::SystemDeploymentManifestRenderer do
|
|
34
36
|
|
35
37
|
@renderer = Bosh::CloudFoundry::SystemDeploymentManifestRenderer.new(
|
36
38
|
@system_config, @common_config, @bosh_config)
|
39
|
+
|
40
|
+
Bosh::CloudFoundry::Providers.should_receive(:for_bosh_provider_name).
|
41
|
+
and_return(Bosh::CloudFoundry::Providers::AWS.new)
|
42
|
+
#
|
43
|
+
# @dea_config = @renderer.dea_config
|
44
|
+
# @dea_config.should_receive(:ram_for_server_flavor).and_return(1700)
|
37
45
|
end
|
38
46
|
|
39
47
|
after(:each) do
|
@@ -51,8 +59,6 @@ describe Bosh::CloudFoundry::SystemDeploymentManifestRenderer do
|
|
51
59
|
end
|
52
60
|
end
|
53
61
|
it "renders a simple system + DEAs into a deployment manifest" do
|
54
|
-
Bosh::CloudFoundry::Providers.should_receive(:for_bosh_provider_name).
|
55
|
-
and_return(Bosh::CloudFoundry::Providers::AWS.new)
|
56
62
|
@system_config.dea = { "count" => 2, "flavor" => "m1.xlarge" }
|
57
63
|
@renderer.perform
|
58
64
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-cloudfoundry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bosh_cli
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- .gitignore
|
150
150
|
- .rspec
|
151
151
|
- .travis.yml
|
152
|
+
- ChangeLog.md
|
152
153
|
- Gemfile
|
153
154
|
- Guardfile
|
154
155
|
- LICENSE.txt
|
@@ -169,6 +170,7 @@ files:
|
|
169
170
|
- lib/bosh-cloudfoundry/gerrit_patches_helper.rb
|
170
171
|
- lib/bosh-cloudfoundry/providers.rb
|
171
172
|
- lib/bosh-cloudfoundry/providers/aws.rb
|
173
|
+
- lib/bosh-cloudfoundry/providers/openstack.rb
|
172
174
|
- lib/bosh-cloudfoundry/system_deployment_manifest_renderer.rb
|
173
175
|
- lib/bosh-cloudfoundry/version.rb
|
174
176
|
- lib/bosh/cli/commands/cf.rb
|
@@ -207,7 +209,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
207
209
|
version: '0'
|
208
210
|
segments:
|
209
211
|
- 0
|
210
|
-
hash:
|
212
|
+
hash: -743491069374654137
|
211
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
212
214
|
none: false
|
213
215
|
requirements:
|
@@ -216,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
218
|
version: '0'
|
217
219
|
segments:
|
218
220
|
- 0
|
219
|
-
hash:
|
221
|
+
hash: -743491069374654137
|
220
222
|
requirements: []
|
221
223
|
rubyforge_project:
|
222
224
|
rubygems_version: 1.8.24
|