bosh-director 1.2749.0 → 1.2751.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: 15fd55d88942f60ed5736387a4d176f0e9a777a2
4
- data.tar.gz: 6b18a3456ce63c0ac94143d2154a8631f65f1c13
3
+ metadata.gz: 4f9c865a613b5fddaca72fb5917993829a29e38b
4
+ data.tar.gz: 88059825781c7c7ed80c2f292d3706da42af98b3
5
5
  SHA512:
6
- metadata.gz: 9504007ed6970975b620ac474a3f5a1106dbb73f48fdc2548bec1c6b9083431c2c937ac56937f7645738b8c9db1dcf19c20ad0099a7f4fda85c489d3be0e5bd8
7
- data.tar.gz: a5aad4b8bf503e256fef533e5d37b5d7ce8273d4e72cc4ee65a8e03a45bbd145fefedf71e00003e585e1bdf497bc02721063269585ac17a23da94d5c7a0949ad
6
+ metadata.gz: 216d91a468be53faf8a624a365eae70d9e2b07eb1fc0eb3e180497a7f84f7f54e524c2a61b37994deaa735b14dbc7acb65399885d00af3950cbd91864dfb0286
7
+ data.tar.gz: 491cb190b6f1027c9863d64d6ff2e1ee3cfcd34e6b41ddec44203cc1c2220f1e06647b061dfc5a98aadd06d295ac2ac7382f18cf81bd48c990d3179ffd7aae8b
@@ -0,0 +1,57 @@
1
+ require 'securerandom'
2
+
3
+ module Bosh::Director
4
+ module DeploymentPlan
5
+ class Notifier
6
+ module Severity
7
+ ERROR = 3
8
+ WARNING = 4
9
+ end
10
+
11
+ def initialize(planner, nats_rpc, logger)
12
+ @planner = planner
13
+ @logger = logger
14
+ @nats_rpc = nats_rpc
15
+ end
16
+
17
+ def send_start_event
18
+ payload = {
19
+ 'id' => SecureRandom.uuid,
20
+ 'severity' => Severity::WARNING,
21
+ 'title' => 'director - begin update deployment',
22
+ 'summary' => "Begin update deployment for #{@planner.canonical_name} against Director #{Bosh::Director::Config.uuid}",
23
+ 'created_at' => Time.now.to_i
24
+ }
25
+
26
+ @logger.info('sending update deployment start event')
27
+ @nats_rpc.send_message('hm.director.alert', payload)
28
+ end
29
+
30
+ def send_end_event
31
+ payload = {
32
+ 'id' => SecureRandom.uuid,
33
+ 'severity' => Severity::WARNING,
34
+ 'title' => 'director - finish update deployment',
35
+ 'summary' => "Finish update deployment for #{@planner.canonical_name} against Director #{Bosh::Director::Config.uuid}",
36
+ 'created_at' => Time.now.to_i
37
+ }
38
+
39
+ @logger.info('sending update deployment end event')
40
+ @nats_rpc.send_message('hm.director.alert', payload)
41
+ end
42
+
43
+ def send_error_event(exception)
44
+ payload = {
45
+ 'id' => SecureRandom.uuid,
46
+ 'severity' => Severity::ERROR,
47
+ 'title' => 'director - error during update deployment',
48
+ 'summary' => "Error during update deployment for #{@planner.canonical_name} against Director #{Bosh::Director::Config.uuid}: #{exception.inspect}",
49
+ 'created_at' => Time.now.to_i
50
+ }
51
+
52
+ @logger.info('sending update deployment error event')
53
+ @nats_rpc.send_message('hm.director.alert', payload)
54
+ end
55
+ end
56
+ end
57
+ end
@@ -25,4 +25,4 @@ require 'bosh/director/deployment_plan/manual_network'
25
25
  require 'bosh/director/deployment_plan/vip_network'
26
26
  require 'bosh/director/deployment_plan/planner'
27
27
  require 'bosh/director/deployment_plan/dns_binder'
28
-
28
+ require 'bosh/director/deployment_plan/notifier'
@@ -3,6 +3,8 @@ module Bosh::Director
3
3
  class UpdateDeployment < BaseJob
4
4
  include LockHelper
5
5
 
6
+ attr_reader :notifier
7
+
6
8
  @queue = :normal
7
9
 
8
10
  def self.job_type
@@ -32,6 +34,9 @@ module Bosh::Director
32
34
  @deployment_plan = DeploymentPlan::Planner.parse(manifest_as_hash, plan_options, event_log, logger)
33
35
  logger.info('Created deployment plan')
34
36
 
37
+ nats_rpc = Config.nats_rpc
38
+ @notifier = DeploymentPlan::Notifier.new(@deployment_plan, nats_rpc, logger)
39
+
35
40
  resource_pools = @deployment_plan.resource_pools
36
41
  @resource_pool_updaters = resource_pools.map do |resource_pool|
37
42
  ResourcePoolUpdater.new(resource_pool)
@@ -73,6 +78,7 @@ module Bosh::Director
73
78
  def perform
74
79
  with_deployment_lock(@deployment_plan) do
75
80
  logger.info('Preparing deployment')
81
+ notifier.send_start_event
76
82
  prepare
77
83
  begin
78
84
  deployment = @deployment_plan.model
@@ -94,12 +100,16 @@ module Bosh::Director
94
100
 
95
101
  deployment.manifest = @manifest
96
102
  deployment.save
103
+ notifier.send_end_event
97
104
  logger.info('Finished updating deployment')
98
105
  "/deployments/#{deployment.name}"
99
106
  ensure
100
107
  update_stemcell_references
101
108
  end
102
109
  end
110
+ rescue Exception => e
111
+ notifier.send_error_event e
112
+ raise e
103
113
  ensure
104
114
  FileUtils.rm_rf(@manifest_file)
105
115
  end
@@ -17,10 +17,10 @@ module Bosh::Director
17
17
 
18
18
  # Publishes a payload (encoded as JSON) without expecting a response
19
19
  def send_message(client, payload)
20
- message = Yajl::Encoder.encode(request)
20
+ message = Yajl::Encoder.encode(payload)
21
21
  @logger.debug("SENT: #{client} #{message}")
22
22
  EM.schedule do
23
- nats.publish(client, payload)
23
+ nats.publish(client, message)
24
24
  end
25
25
  end
26
26
 
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Director
3
- VERSION = '1.2749.0'
3
+ VERSION = '1.2751.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.2749.0
4
+ version: 1.2751.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-17 00:00:00.000000000 Z
11
+ date: 2014-10-24 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.2749.0
33
+ version: 1.2751.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.2749.0
40
+ version: 1.2751.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.2749.0
47
+ version: 1.2751.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.2749.0
54
+ version: 1.2751.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.2749.0
61
+ version: 1.2751.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.2749.0
68
+ version: 1.2751.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.2749.0
75
+ version: 1.2751.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.2749.0
82
+ version: 1.2751.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.2749.0
89
+ version: 1.2751.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.2749.0
96
+ version: 1.2751.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.2749.0
103
+ version: 1.2751.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.2749.0
110
+ version: 1.2751.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.2749.0
117
+ version: 1.2751.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.2749.0
124
+ version: 1.2751.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.2749.0
131
+ version: 1.2751.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.2749.0
138
+ version: 1.2751.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.2749.0
145
+ version: 1.2751.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.2749.0
152
+ version: 1.2751.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.2749.0
159
+ version: 1.2751.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.2749.0
166
+ version: 1.2751.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: bosh_vcloud_cpi
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -460,7 +460,7 @@ dependencies:
460
460
  version: '0'
461
461
  description: |-
462
462
  BOSH Director
463
- fe122d
463
+ 93858a
464
464
  email: support@cloudfoundry.com
465
465
  executables:
466
466
  - bosh-director
@@ -588,6 +588,7 @@ files:
588
588
  - lib/bosh/director/deployment_plan/multi_job_updater.rb
589
589
  - lib/bosh/director/deployment_plan/network.rb
590
590
  - lib/bosh/director/deployment_plan/network_subnet.rb
591
+ - lib/bosh/director/deployment_plan/notifier.rb
591
592
  - lib/bosh/director/deployment_plan/planner.rb
592
593
  - lib/bosh/director/deployment_plan/preparer.rb
593
594
  - lib/bosh/director/deployment_plan/release_version.rb