bosh-director 1.2739.0 → 1.2743.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1eaa338712fc066dfcc8ced60a1e7769c82907c6
4
- data.tar.gz: 01db501cba7012e084cd726b1d634bfe0a9eb950
3
+ metadata.gz: 245617054defdaf1d59d62a2b911b652e0fe0bfd
4
+ data.tar.gz: 4080e6dd55fee17cd7191966fdba543e23020657
5
5
  SHA512:
6
- metadata.gz: cb9ea1ab2aa1a58fef2d6f49ca96022b2ce6f9322bfb71a88354867d9af452a0ab5f38dace2e38b015648e12ea12db923e6a812466ffef2f778c3185e558d1d4
7
- data.tar.gz: 72f59e8812b850d8dc873862b815780f8dcd6422156f02445c34726656d97fa32cf498c2b699bc39aad64f83323896056e6f734e8688d547904ba97b8cbda4d0
6
+ metadata.gz: ee0ea8231bbf7a7c7424f774d6dee192daa0ec4bf0a04af82dfbb180abaed049b5942dbb6dfc7ed0db8c980528e7f7bd7cbef816686456acb46837a2aa198107
7
+ data.tar.gz: 0a1291cad3c5c220f7c06d3ae4f7bc1fdf5125bb8a5d132b570803a2781c6993dc3197d11c3efa9706817ac17c77762357e3fe028f4f2ce5ec30d0e236bcce1e
@@ -24,19 +24,19 @@ module Bosh::Director
24
24
 
25
25
  release_version = template.release.model
26
26
 
27
- task = CompileTask.new(package,
28
- stemcell,
29
- job,
30
- release_version.package_dependency_key(package.name),
31
- release_version.package_cache_key(package.name, stemcell))
27
+ transitive_dependencies = release_version.transitive_dependencies(package)
28
+ package_dependency_key = Models::CompiledPackage.create_dependency_key(transitive_dependencies)
29
+ package_cache_key = Models::CompiledPackage.create_cache_key(package, transitive_dependencies, stemcell)
30
+
31
+ task = CompileTask.new(package, stemcell, job, package_dependency_key, package_cache_key)
32
32
 
33
33
  compiled_package = task.find_compiled_package(@logger, @event_log)
34
34
  if compiled_package
35
35
  task.use_compiled_package(compiled_package)
36
36
  end
37
37
 
38
- @logger.info("Processing package `#{package.desc}' dependencies")
39
- dependencies = release_version.dependencies(package.name)
38
+ @logger.info("Processing package `#{package.desc}' dependencies")
39
+ dependencies = release_version.dependencies(package)
40
40
  dependencies.each do |dependency|
41
41
  @logger.info("Package `#{package.desc}' depends on package `#{dependency.desc}'")
42
42
  dependency_task = generate!(compile_tasks, job, template, dependency, stemcell)
@@ -12,10 +12,13 @@ module Bosh::Director::CompiledPackage
12
12
 
13
13
  stemcell = Bosh::Director::Models::Stemcell[sha1: compiled_package.stemcell_sha1]
14
14
 
15
+ transitive_dependencies = release_version.transitive_dependencies(package)
16
+ package_dependency_key = Bosh::Director::Models::CompiledPackage.create_dependency_key(transitive_dependencies)
17
+
15
18
  compiled_package_model = Bosh::Director::Models::CompiledPackage[
16
19
  package: package,
17
20
  stemcell: stemcell,
18
- dependency_key: release_version.package_dependency_key(package.name),
21
+ dependency_key: package_dependency_key,
19
22
  ]
20
23
 
21
24
  return if compiled_package_model
@@ -30,7 +33,7 @@ module Bosh::Director::CompiledPackage
30
33
  package: package,
31
34
  stemcell: stemcell,
32
35
  sha1: compiled_package.sha1,
33
- dependency_key: release_version.package_dependency_key(package.name),
36
+ dependency_key: package_dependency_key,
34
37
  build: Bosh::Director::Models::CompiledPackage.generate_build_number(package, stemcell),
35
38
  )
36
39
  rescue
@@ -7,10 +7,12 @@ module Bosh::Director
7
7
 
8
8
  def compiled_packages
9
9
  @compiled_packages ||= @release_version.packages.map do |package|
10
+ transitive_dependencies = @release_version.transitive_dependencies(package)
11
+ package_dependency_key = Bosh::Director::Models::CompiledPackage.create_dependency_key(transitive_dependencies)
10
12
  Models::CompiledPackage[
11
13
  :package_id => package.id,
12
14
  :stemcell_id => @stemcell.id,
13
- :dependency_key => @release_version.package_dependency_key(package.name)
15
+ :dependency_key => package_dependency_key
14
16
  ]
15
17
  end.compact
16
18
  end
@@ -176,22 +176,18 @@ module Bosh::Director
176
176
  packages_by_name[package["name"]] = package
177
177
  package["dependencies"] ||= []
178
178
  end
179
+ logger.info("Resolving package dependencies for #{packages_by_name.keys.inspect}")
180
+
179
181
  dependency_lookup = lambda do |package_name|
180
182
  packages_by_name[package_name]["dependencies"]
181
183
  end
182
- result = CycleHelper.check_for_cycle(packages_by_name.keys,
183
- :connected_vertices => true,
184
- &dependency_lookup)
184
+ result = Bosh::Director::CycleHelper.check_for_cycle(packages_by_name.keys, :connected_vertices => true, &dependency_lookup)
185
185
 
186
186
  packages.each do |package|
187
187
  name = package["name"]
188
188
  dependencies = package["dependencies"]
189
-
190
- logger.info("Resolving package dependencies for `#{name}', " +
191
- "found: #{dependencies.pretty_inspect}")
192
- package["dependencies"] = result[:connected_vertices][name]
193
- logger.info("Resolved package dependencies for `#{name}', " +
194
- "to: #{dependencies.pretty_inspect}")
189
+ all_dependencies = result[:connected_vertices][name]
190
+ logger.info("Resolved package dependencies for `#{name}': #{dependencies.pretty_inspect} => #{all_dependencies.pretty_inspect}")
195
191
  end
196
192
  end
197
193
 
@@ -222,9 +218,17 @@ module Bosh::Director
222
218
  end
223
219
 
224
220
  if existing_package
221
+ # clean up 'broken' dependency_set (a bug was including transitives)
222
+ # dependency ordering impacts fingerprint
223
+ # TODO: The following code can be removed after some reasonable time period (added 2014.10.06)
224
+ if existing_package.dependency_set != package_meta['dependencies']
225
+ existing_package.dependency_set = package_meta['dependencies']
226
+ existing_package.save
227
+ end
228
+
225
229
  existing_packages << [existing_package, package_meta]
226
230
  else
227
- # We found a package with the same checksum but different
231
+ # We found a package with the same fingerprint but different
228
232
  # (release, name, version) tuple, so we need to make a copy
229
233
  # of the package blob and create a new db entry for it
230
234
  package = packages.first
@@ -1,13 +1,24 @@
1
- # Copyright (c) 2009-2012 VMware, Inc.
2
-
3
1
  module Bosh::Director::Models
4
2
  class CompiledPackage < Sequel::Model(Bosh::Director::Config.db)
5
3
  many_to_one :package
6
4
  many_to_one :stemcell
7
5
 
6
+ # Creates a dependency_key from a list of dependencies
7
+ # Input MUST include immediate & transitive dependencies
8
+ def self.create_dependency_key(transitive_dependencies)
9
+ key = transitive_dependencies.to_a.sort_by(&:name).map { |p| [p.name, p.version]}
10
+ Yajl::Encoder.encode(key)
11
+ end
12
+
13
+ # Creates a 'unique' key to use in the global package cache
14
+ def self.create_cache_key(package, transitive_dependencies, stemcell)
15
+ dependency_fingerprints = transitive_dependencies.to_a.sort_by(&:name).map {|p| p.fingerprint }
16
+ hash_input = ([package.fingerprint, stemcell.sha1]+dependency_fingerprints).join('')
17
+ Digest::SHA1.hexdigest(hash_input)
18
+ end
19
+
8
20
  def validate
9
- validates_presence [:package_id, :stemcell_id, :sha1,
10
- :blobstore_id, :dependency_key]
21
+ validates_presence [:package_id, :stemcell_id, :sha1, :blobstore_id, :dependency_key]
11
22
  validates_unique [:package_id, :stemcell_id, :dependency_key]
12
23
  validates_unique [:package_id, :stemcell_id, :build]
13
24
  end
@@ -11,34 +11,30 @@ module Bosh::Director::Models
11
11
  validates_unique [:release_id, :version]
12
12
  end
13
13
 
14
- def dependencies(package_name)
15
- package_by_name(package_name).dependency_set.map do |package_name|
16
- package_by_name(package_name)
14
+ # immediate dependency models
15
+ def dependencies(package)
16
+ package.dependency_set.map { |package_name| package_by_name(package_name) }.to_set
17
+ end
18
+
19
+ # all dependency models, including transitives
20
+ # assumes there are no cycles (checked during upload)
21
+ def transitive_dependencies(package)
22
+ dependency_set = Set.new
23
+ dependencies(package).each do |dependency|
24
+ dependency_set << dependency
25
+ dependency_set.merge(transitive_dependencies(dependency))
17
26
  end
27
+ dependency_set
18
28
  end
19
29
 
20
30
  def package_by_name(package_name)
21
31
  packages_by_name.fetch(package_name)
22
32
  end
23
33
 
24
- def package_dependency_key(package_name)
25
- key = dependencies(package_name).sort { |a, b|
26
- a.name <=> b.name
27
- }.map { |p| [p.name, p.version]}
28
-
29
- Yajl::Encoder.encode(key)
30
- end
31
-
32
- def package_cache_key(package_name, stemcell)
33
- dependency_fingerprints = dependencies(package_name).sort_by(&:name).map {|p| p.fingerprint }
34
- hash_input = ([package_by_name(package_name).fingerprint, stemcell.sha1]+dependency_fingerprints).join("")
35
- Digest::SHA1.hexdigest(hash_input)
36
- end
37
-
38
34
  private
39
35
 
40
36
  def packages_by_name
41
- @packages_by_name ||= packages.inject({}) do |cache, package|
37
+ @packages_by_name_cache ||= packages.inject({}) do |cache, package|
42
38
  cache.merge(package.name => package)
43
39
  end
44
40
  end
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Director
3
- VERSION = '1.2739.0'
3
+ VERSION = '1.2743.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh-director
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2739.0
4
+ version: 1.2743.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VMware
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-09 00:00:00.000000000 Z
11
+ date: 2014-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt-ruby
@@ -30,140 +30,140 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.2739.0
33
+ version: 1.2743.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.2739.0
40
+ version: 1.2743.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bosh-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.2739.0
47
+ version: 1.2743.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.2739.0
54
+ version: 1.2743.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bosh-director-core
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.2739.0
61
+ version: 1.2743.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.2739.0
68
+ version: 1.2743.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bosh_common
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.2739.0
75
+ version: 1.2743.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.2739.0
82
+ version: 1.2743.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bosh-template
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.2739.0
89
+ version: 1.2743.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 1.2739.0
96
+ version: 1.2743.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: bosh_cpi
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.2739.0
103
+ version: 1.2743.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.2739.0
110
+ version: 1.2743.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: bosh_openstack_cpi
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.2739.0
117
+ version: 1.2743.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.2739.0
124
+ version: 1.2743.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: bosh_aws_cpi
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 1.2739.0
131
+ version: 1.2743.0
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 1.2739.0
138
+ version: 1.2743.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: bosh_vsphere_cpi
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.2739.0
145
+ version: 1.2743.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 1.2739.0
152
+ version: 1.2743.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: bosh_warden_cpi
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.2739.0
159
+ version: 1.2743.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.2739.0
166
+ version: 1.2743.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: bosh_vcloud_cpi
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -422,14 +422,14 @@ dependencies:
422
422
  requirements:
423
423
  - - "~>"
424
424
  - !ruby/object:Gem::Version
425
- version: 0.0.2
425
+ version: 1.1.0
426
426
  type: :runtime
427
427
  prerelease: false
428
428
  version_requirements: !ruby/object:Gem::Requirement
429
429
  requirements:
430
430
  - - "~>"
431
431
  - !ruby/object:Gem::Version
432
- version: 0.0.2
432
+ version: 1.1.0
433
433
  - !ruby/object:Gem::Dependency
434
434
  name: semi_semantic
435
435
  requirement: !ruby/object:Gem::Requirement
@@ -460,7 +460,7 @@ dependencies:
460
460
  version: '0'
461
461
  description: |-
462
462
  BOSH Director
463
- 0d77bd
463
+ 01851c
464
464
  email: support@cloudfoundry.com
465
465
  executables:
466
466
  - bosh-director