bosh-director 1.5.0.pre.1381 → 1.5.0.pre.1390
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bosh/director.rb +0 -1
- data/lib/bosh/director/compressed_rendered_job_templates.rb +10 -0
- data/lib/bosh/director/deployment_plan/assembler.rb +16 -12
- data/lib/bosh/director/rendered_templates_uploader.rb +11 -1
- data/lib/bosh/director/rendered_templates_writer.rb +24 -0
- data/lib/bosh/director/tar_gzipper.rb +0 -2
- data/lib/bosh/director/version.rb +1 -1
- metadata +19 -17
data/lib/bosh/director.rb
CHANGED
@@ -378,22 +378,26 @@ module Bosh::Director
|
|
378
378
|
|
379
379
|
# @param [DeploymentPlan::Instance]
|
380
380
|
def bind_instance_vm(instance)
|
381
|
-
job
|
382
|
-
|
381
|
+
@event_log.track("#{instance.job.name}/#{instance.index}") do
|
382
|
+
idle_vm = instance.idle_vm
|
383
383
|
|
384
|
-
instance.model.update(:vm => idle_vm.vm)
|
385
|
-
|
386
|
-
@event_log.track("#{job.name}/#{instance.index}") do
|
387
384
|
# Apply the assignment to the VM
|
388
|
-
state = idle_vm.current_state
|
389
|
-
state["job"] = job.spec
|
390
|
-
state["index"] = instance.index
|
391
|
-
state["release"] = job.release.spec
|
392
|
-
|
393
|
-
idle_vm.vm.update(:apply_spec => state)
|
394
|
-
|
395
385
|
agent = AgentClient.with_defaults(idle_vm.vm.agent_id)
|
386
|
+
state = idle_vm.current_state
|
387
|
+
state['job'] = instance.job.spec
|
388
|
+
state['index'] = instance.index
|
389
|
+
state['release'] = instance.job.release.spec
|
396
390
|
agent.apply(state)
|
391
|
+
|
392
|
+
# Our assumption here is that director database access
|
393
|
+
# is much less likely to fail than VM agent communication
|
394
|
+
# so we only update database after we see a successful agent apply.
|
395
|
+
# If database update fails subsequent deploy will try to
|
396
|
+
# assign a new VM to this instance which is ok.
|
397
|
+
idle_vm.vm.db.transaction do
|
398
|
+
idle_vm.vm.update(:apply_spec => state)
|
399
|
+
instance.model.update(:vm => idle_vm.vm)
|
400
|
+
end
|
397
401
|
instance.current_state = state
|
398
402
|
end
|
399
403
|
end
|
@@ -1,6 +1,16 @@
|
|
1
|
+
require 'bosh/director/rendered_templates_writer'
|
2
|
+
require 'bosh/director/compressed_rendered_job_templates'
|
3
|
+
require 'blobstore_client/null_blobstore_client'
|
4
|
+
|
1
5
|
module Bosh::Director
|
2
6
|
class RenderedTemplatesUploader
|
3
|
-
def
|
7
|
+
def initialize(blobstore = Bosh::Blobstore::NullBlobstoreClient.new)
|
8
|
+
@blobstore = blobstore
|
9
|
+
end
|
10
|
+
|
11
|
+
def upload(rendered_job_templates)
|
12
|
+
compressed_archive = CompressedRenderedJobTemplates.new(rendered_job_templates)
|
13
|
+
@blobstore.create(compressed_archive.contents)
|
4
14
|
end
|
5
15
|
end
|
6
16
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Bosh::Director
|
4
|
+
class RenderedTemplatesWriter
|
5
|
+
def write(rendered_templates, output_dir)
|
6
|
+
rendered_templates.each do |job_template|
|
7
|
+
job_template_dir = File.join(output_dir, job_template.name)
|
8
|
+
Dir.mkdir(job_template_dir)
|
9
|
+
|
10
|
+
File.open(File.join(job_template_dir, 'monit'), 'w') do |f|
|
11
|
+
f.write(job_template.monit)
|
12
|
+
end
|
13
|
+
|
14
|
+
job_template.templates.each do |file_template|
|
15
|
+
file_template_dest = File.join(job_template_dir, file_template.dest_name)
|
16
|
+
FileUtils.mkdir_p(File.dirname(file_template_dest))
|
17
|
+
File.open(file_template_dest, 'w') do |f|
|
18
|
+
f.write(file_template.contents)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -3,8 +3,6 @@ require 'open3'
|
|
3
3
|
|
4
4
|
module Bosh::Director
|
5
5
|
class TarGzipper
|
6
|
-
include Bosh::RunsCommands
|
7
|
-
|
8
6
|
# @param [String] base_dir the directory from which the tar command is run
|
9
7
|
# @param [String, Array] sources the relative paths to include
|
10
8
|
# @param [String] dest the destination filename for the tgz output
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-director
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.0.pre.
|
4
|
+
version: 1.5.0.pre.1390
|
5
5
|
prerelease: 6
|
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-11-
|
12
|
+
date: 2013-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bcrypt-ruby
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.5.0.pre.
|
37
|
+
version: 1.5.0.pre.1390
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.5.0.pre.
|
45
|
+
version: 1.5.0.pre.1390
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: bosh-core
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.5.0.pre.
|
53
|
+
version: 1.5.0.pre.1390
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.5.0.pre.
|
61
|
+
version: 1.5.0.pre.1390
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: bosh_common
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 1.5.0.pre.
|
69
|
+
version: 1.5.0.pre.1390
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 1.5.0.pre.
|
77
|
+
version: 1.5.0.pre.1390
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: bosh_cpi
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
requirements:
|
83
83
|
- - ~>
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 1.5.0.pre.
|
85
|
+
version: 1.5.0.pre.1390
|
86
86
|
type: :runtime
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 1.5.0.pre.
|
93
|
+
version: 1.5.0.pre.1390
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: bosh_openstack_cpi
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - ~>
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 1.5.0.pre.
|
101
|
+
version: 1.5.0.pre.1390
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 1.5.0.pre.
|
109
|
+
version: 1.5.0.pre.1390
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: bosh_aws_cpi
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.5.0.pre.
|
117
|
+
version: 1.5.0.pre.1390
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - ~>
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 1.5.0.pre.
|
125
|
+
version: 1.5.0.pre.1390
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: bosh_vsphere_cpi
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - ~>
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 1.5.0.pre.
|
133
|
+
version: 1.5.0.pre.1390
|
134
134
|
type: :runtime
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
requirements:
|
139
139
|
- - ~>
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version: 1.5.0.pre.
|
141
|
+
version: 1.5.0.pre.1390
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
143
|
name: eventmachine
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -461,7 +461,7 @@ dependencies:
|
|
461
461
|
version: '0'
|
462
462
|
description: ! 'BOSH Director
|
463
463
|
|
464
|
-
|
464
|
+
70ab6e'
|
465
465
|
email: support@cloudfoundry.com
|
466
466
|
executables:
|
467
467
|
- bosh-director
|
@@ -550,6 +550,7 @@ files:
|
|
550
550
|
- lib/bosh/director/compiled_package_group.rb
|
551
551
|
- lib/bosh/director/compiled_package_manifest.rb
|
552
552
|
- lib/bosh/director/compiled_packages_exporter.rb
|
553
|
+
- lib/bosh/director/compressed_rendered_job_templates.rb
|
553
554
|
- lib/bosh/director/config.rb
|
554
555
|
- lib/bosh/director/cycle_helper.rb
|
555
556
|
- lib/bosh/director/db_backup.rb
|
@@ -661,6 +662,7 @@ files:
|
|
661
662
|
- lib/bosh/director/rendered_job_instance_hasher.rb
|
662
663
|
- lib/bosh/director/rendered_job_template.rb
|
663
664
|
- lib/bosh/director/rendered_templates_uploader.rb
|
665
|
+
- lib/bosh/director/rendered_templates_writer.rb
|
664
666
|
- lib/bosh/director/resource_pool_updater.rb
|
665
667
|
- lib/bosh/director/scheduler.rb
|
666
668
|
- lib/bosh/director/sequel.rb
|