hybrid_platforms_conductor 33.2.3 → 33.2.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/hybrid_platforms_conductor/config.rb +0 -35
- data/lib/hybrid_platforms_conductor/core_extensions/bundler/without_bundled_env.rb +18 -1
- data/lib/hybrid_platforms_conductor/deployer.rb +33 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef.rb +1 -1
- data/lib/hybrid_platforms_conductor/version.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/cmd_runner_spec.rb +7 -1
- data/spec/hybrid_platforms_conductor_test/api/config_spec.rb +0 -34
- data/spec/hybrid_platforms_conductor_test/api/deployer/config_dsl_spec.rb +34 -0
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/services_deployment_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bd578efdc520f51dc9752ace39626e73dbdda736fd4376ee5e9ce55ed34a0a4d
|
|
4
|
+
data.tar.gz: c44c935905b7a62a4a0f3ea037b0f1e4ed8fa07bdad4802e38143fe1a448bfd1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f0070cf6736acaa5b9a1e36279bab3b9f6530c26ea341feec4fb4775d022e1c67e2694df832a3ab340b765e10bf510969febe82e4b34fa564e9aab82eea71314
|
|
7
|
+
data.tar.gz: d5cc0229b32b7f75d1c7604e304e6986b0b7ab121676dfd62121d954c48e3ba93f827dabfbb8320c9f945339c334263ff9404c8c60e1be5a0b03e4b390cc044f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# [v33.2.4](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.2.3...v33.2.4) (2021-06-23 15:14:20)
|
|
2
|
+
|
|
3
|
+
## Global changes
|
|
4
|
+
### Patches
|
|
5
|
+
|
|
6
|
+
* [[Hotfix(platform_handler_serverless_chef)] Forward environment in sudo commands](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/fd3b58875665c29dd071b5af2055eab0c45c0974)
|
|
7
|
+
* [[Hotfix] Fixed unbundled environment not cleaned + Moved deployer config DSL in deployer.rb](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/2bce6dbc31d98b27f196ed646eb9aa669b0f9a86)
|
|
8
|
+
|
|
9
|
+
## Changes for platform_handler_serverless_chef
|
|
10
|
+
### Patches
|
|
11
|
+
|
|
12
|
+
* [[Hotfix(platform_handler_serverless_chef)] Forward environment in sudo commands](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/fd3b58875665c29dd071b5af2055eab0c45c0974)
|
|
13
|
+
|
|
1
14
|
# [v33.2.3](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.2.2...v33.2.3) (2021-06-23 13:45:56)
|
|
2
15
|
|
|
3
16
|
## Global changes
|
|
@@ -47,12 +47,6 @@ module HybridPlatformsConductor
|
|
|
47
47
|
# Array<Hash,Symbol,Object>
|
|
48
48
|
attr_reader :expected_failures
|
|
49
49
|
|
|
50
|
-
# List of retriable errors. Each info has the following properties:
|
|
51
|
-
# * *nodes_selectors_stack* (Array<Object>): Stack of nodes selectors impacted by those errors
|
|
52
|
-
# * *errors_on_stdout* (Array<String or Regexp>): List of errors match (as exact string match or using a regexp) to check against stdout
|
|
53
|
-
# * *errors_on_stderr* (Array<String or Regexp>): List of errors match (as exact string match or using a regexp) to check against stderr
|
|
54
|
-
attr_reader :retriable_errors
|
|
55
|
-
|
|
56
50
|
# List of deployment schedules. Each info has the following properties:
|
|
57
51
|
# * *nodes_selectors_stack* (Array<Object>): Stack of nodes selectors impacted by this rule
|
|
58
52
|
# * *schedule* (IceCube::Schedule): The deployment schedule
|
|
@@ -81,11 +75,6 @@ module HybridPlatformsConductor
|
|
|
81
75
|
# * *reason* (String): Reason for this expected failure
|
|
82
76
|
# Array<Hash,Symbol,Object>
|
|
83
77
|
@expected_failures = []
|
|
84
|
-
# List of retriable errors. Each info has the following properties:
|
|
85
|
-
# * *nodes_selectors_stack* (Array<Object>): Stack of nodes selectors impacted by those errors
|
|
86
|
-
# * *errors_on_stdout* (Array<String or Regexp>): List of errors match (as exact string match or using a regexp) to check against stdout
|
|
87
|
-
# * *errors_on_stderr* (Array<String or Regexp>): List of errors match (as exact string match or using a regexp) to check against stderr
|
|
88
|
-
@retriable_errors = []
|
|
89
78
|
# List of deployment schedules. Each info has the following properties:
|
|
90
79
|
# * *nodes_selectors_stack* (Array<Object>): Stack of nodes selectors impacted by this rule
|
|
91
80
|
# * *schedule* (IceCube::Schedule): The deployment schedule
|
|
@@ -162,30 +151,6 @@ module HybridPlatformsConductor
|
|
|
162
151
|
end
|
|
163
152
|
expose :expect_tests_to_fail
|
|
164
153
|
|
|
165
|
-
# Mark some errors on stdout to be retriable during a deploy
|
|
166
|
-
#
|
|
167
|
-
# Parameters::
|
|
168
|
-
# * *errors* (String, Regexp or Array<String or Regexp>): Single (or list of) errors matching pattern (either as exact string match or using a regexp).
|
|
169
|
-
def retry_deploy_for_errors_on_stdout(errors)
|
|
170
|
-
@retriable_errors << {
|
|
171
|
-
errors_on_stdout: errors.is_a?(Array) ? errors : [errors],
|
|
172
|
-
nodes_selectors_stack: current_nodes_selectors_stack
|
|
173
|
-
}
|
|
174
|
-
end
|
|
175
|
-
expose :retry_deploy_for_errors_on_stdout
|
|
176
|
-
|
|
177
|
-
# Mark some errors on stderr to be retriable during a deploy
|
|
178
|
-
#
|
|
179
|
-
# Parameters::
|
|
180
|
-
# * *errors* (String, Regexp or Array<String or Regexp>): Single (or list of) errors matching pattern (either as exact string match or using a regexp).
|
|
181
|
-
def retry_deploy_for_errors_on_stderr(errors)
|
|
182
|
-
@retriable_errors << {
|
|
183
|
-
errors_on_stderr: errors.is_a?(Array) ? errors : [errors],
|
|
184
|
-
nodes_selectors_stack: current_nodes_selectors_stack
|
|
185
|
-
}
|
|
186
|
-
end
|
|
187
|
-
expose :retry_deploy_for_errors_on_stderr
|
|
188
|
-
|
|
189
154
|
# Set a deployment schedule
|
|
190
155
|
#
|
|
191
156
|
# Parameters::
|
|
@@ -11,10 +11,27 @@ module Bundler
|
|
|
11
11
|
# @return [Hash] Environment with all bundler-related variables removed
|
|
12
12
|
def current_unbundled_env
|
|
13
13
|
env = ENV.clone.to_hash
|
|
14
|
+
%w[
|
|
15
|
+
PATH
|
|
16
|
+
RUBYLIB
|
|
17
|
+
RUBYOPT
|
|
18
|
+
].each do |env_name|
|
|
19
|
+
if original_env.key?(env_name)
|
|
20
|
+
env[env_name] = original_env[env_name]
|
|
21
|
+
else
|
|
22
|
+
env.delete(env_name)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
14
25
|
|
|
15
26
|
env['MANPATH'] = env['BUNDLER_ORIG_MANPATH'] if env.key?('BUNDLER_ORIG_MANPATH')
|
|
16
27
|
|
|
17
|
-
env.delete_if
|
|
28
|
+
env.delete_if do |k, _|
|
|
29
|
+
%w[
|
|
30
|
+
GEM_
|
|
31
|
+
BUNDLE_
|
|
32
|
+
BUNDLER_
|
|
33
|
+
].any? { |prefix| k.start_with?(prefix) }
|
|
34
|
+
end
|
|
18
35
|
|
|
19
36
|
if env.key?('RUBYOPT')
|
|
20
37
|
rubyopt = env['RUBYOPT'].split
|
|
@@ -18,6 +18,12 @@ module HybridPlatformsConductor
|
|
|
18
18
|
# Extend the Config DSL
|
|
19
19
|
module ConfigDSLExtension
|
|
20
20
|
|
|
21
|
+
# List of retriable errors. Each info has the following properties:
|
|
22
|
+
# * *nodes_selectors_stack* (Array<Object>): Stack of nodes selectors impacted by those errors
|
|
23
|
+
# * *errors_on_stdout* (Array<String or Regexp>): List of errors match (as exact string match or using a regexp) to check against stdout
|
|
24
|
+
# * *errors_on_stderr* (Array<String or Regexp>): List of errors match (as exact string match or using a regexp) to check against stderr
|
|
25
|
+
attr_reader :retriable_errors
|
|
26
|
+
|
|
21
27
|
# List of log plugins. Each info has the following properties:
|
|
22
28
|
# * *nodes_selectors_stack* (Array<Object>): Stack of nodes selectors impacted by this rule.
|
|
23
29
|
# * *log_plugins* (Array<Symbol>): List of log plugins to be used to store deployment logs.
|
|
@@ -36,6 +42,11 @@ module HybridPlatformsConductor
|
|
|
36
42
|
# Mixin initializer
|
|
37
43
|
def init_deployer_config
|
|
38
44
|
@packaging_timeout_secs = 60
|
|
45
|
+
# List of retriable errors. Each info has the following properties:
|
|
46
|
+
# * *nodes_selectors_stack* (Array<Object>): Stack of nodes selectors impacted by those errors
|
|
47
|
+
# * *errors_on_stdout* (Array<String or Regexp>): List of errors match (as exact string match or using a regexp) to check against stdout
|
|
48
|
+
# * *errors_on_stderr* (Array<String or Regexp>): List of errors match (as exact string match or using a regexp) to check against stderr
|
|
49
|
+
@retriable_errors = []
|
|
39
50
|
@deployment_logs = []
|
|
40
51
|
@secrets_readers = []
|
|
41
52
|
end
|
|
@@ -48,6 +59,28 @@ module HybridPlatformsConductor
|
|
|
48
59
|
@packaging_timeout_secs = packaging_timeout_secs
|
|
49
60
|
end
|
|
50
61
|
|
|
62
|
+
# Mark some errors on stdout to be retriable during a deploy
|
|
63
|
+
#
|
|
64
|
+
# Parameters::
|
|
65
|
+
# * *errors* (String, Regexp or Array<String or Regexp>): Single (or list of) errors matching pattern (either as exact string match or using a regexp).
|
|
66
|
+
def retry_deploy_for_errors_on_stdout(errors)
|
|
67
|
+
@retriable_errors << {
|
|
68
|
+
errors_on_stdout: errors.is_a?(Array) ? errors : [errors],
|
|
69
|
+
nodes_selectors_stack: current_nodes_selectors_stack
|
|
70
|
+
}
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Mark some errors on stderr to be retriable during a deploy
|
|
74
|
+
#
|
|
75
|
+
# Parameters::
|
|
76
|
+
# * *errors* (String, Regexp or Array<String or Regexp>): Single (or list of) errors matching pattern (either as exact string match or using a regexp).
|
|
77
|
+
def retry_deploy_for_errors_on_stderr(errors)
|
|
78
|
+
@retriable_errors << {
|
|
79
|
+
errors_on_stderr: errors.is_a?(Array) ? errors : [errors],
|
|
80
|
+
nodes_selectors_stack: current_nodes_selectors_stack
|
|
81
|
+
}
|
|
82
|
+
end
|
|
83
|
+
|
|
51
84
|
# Set the deployment log plugins to be used
|
|
52
85
|
#
|
|
53
86
|
# Parameters::
|
|
@@ -263,7 +263,7 @@ module HybridPlatformsConductor
|
|
|
263
263
|
raise "Missing file #{chef_versions_file} specifying the Chef Infra Client version to be deployed" unless File.exist?(chef_versions_file)
|
|
264
264
|
|
|
265
265
|
required_chef_client_version = YAML.load_file(chef_versions_file)['client']
|
|
266
|
-
sudo = (@actions_executor.connector(:ssh).ssh_user == 'root' ? '' : "#{@nodes_handler.sudo_on(node)} ")
|
|
266
|
+
sudo = (@actions_executor.connector(:ssh).ssh_user == 'root' ? '' : "#{@nodes_handler.sudo_on(node)} -E ")
|
|
267
267
|
[
|
|
268
268
|
{
|
|
269
269
|
# Install dependencies
|
|
@@ -47,7 +47,13 @@ describe HybridPlatformsConductor::CmdRunner do
|
|
|
47
47
|
|
|
48
48
|
it 'runs a command in an un-bundled environment' do
|
|
49
49
|
with_repository do
|
|
50
|
-
|
|
50
|
+
%w[
|
|
51
|
+
BUNDLE_GEMFILE
|
|
52
|
+
GEM_HOME
|
|
53
|
+
RUBYOPT
|
|
54
|
+
].each do |var_to_check|
|
|
55
|
+
expect(test_cmd_runner.run_cmd("echo \"${#{var_to_check}}\"")).to eq [0, "\n", '']
|
|
56
|
+
end
|
|
51
57
|
end
|
|
52
58
|
end
|
|
53
59
|
|
|
@@ -155,40 +155,6 @@ describe HybridPlatformsConductor::Config do
|
|
|
155
155
|
end
|
|
156
156
|
end
|
|
157
157
|
|
|
158
|
-
it 'returns the retriable errors correctly' do
|
|
159
|
-
with_platforms '
|
|
160
|
-
retry_deploy_for_errors_on_stdout \'Retry stdout global\'
|
|
161
|
-
retry_deploy_for_errors_on_stderr [
|
|
162
|
-
\'Retry stderr global\',
|
|
163
|
-
/.+Retry stderr regexp global/
|
|
164
|
-
]
|
|
165
|
-
for_nodes(%w[node1 node2 node3]) do
|
|
166
|
-
retry_deploy_for_errors_on_stdout \'Retry stdout nodes\'
|
|
167
|
-
retry_deploy_for_errors_on_stderr \'Retry stderr nodes\'
|
|
168
|
-
end
|
|
169
|
-
' do
|
|
170
|
-
sort_proc = proc { |retriable_error_info| ((retriable_error_info[:errors_on_stdout] || []) + (retriable_error_info[:errors_on_stderr] || [])).first.to_s }
|
|
171
|
-
expect(test_config.retriable_errors.sort_by(&sort_proc)).to eq [
|
|
172
|
-
{
|
|
173
|
-
nodes_selectors_stack: [],
|
|
174
|
-
errors_on_stdout: ['Retry stdout global']
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
nodes_selectors_stack: [],
|
|
178
|
-
errors_on_stderr: ['Retry stderr global', /.+Retry stderr regexp global/]
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
nodes_selectors_stack: [%w[node1 node2 node3]],
|
|
182
|
-
errors_on_stdout: ['Retry stdout nodes']
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
nodes_selectors_stack: [%w[node1 node2 node3]],
|
|
186
|
-
errors_on_stderr: ['Retry stderr nodes']
|
|
187
|
-
}
|
|
188
|
-
].sort_by(&sort_proc)
|
|
189
|
-
end
|
|
190
|
-
end
|
|
191
|
-
|
|
192
158
|
it 'returns the deployment schedules correctly' do
|
|
193
159
|
with_platforms '
|
|
194
160
|
deployment_schedule(IceCube::Schedule.new(Time.parse(\'2020-05-01 11:22:33 UTC\')))
|
|
@@ -8,6 +8,40 @@ describe HybridPlatformsConductor::Deployer do
|
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
it 'returns the retriable errors correctly' do
|
|
12
|
+
with_platforms '
|
|
13
|
+
retry_deploy_for_errors_on_stdout \'Retry stdout global\'
|
|
14
|
+
retry_deploy_for_errors_on_stderr [
|
|
15
|
+
\'Retry stderr global\',
|
|
16
|
+
/.+Retry stderr regexp global/
|
|
17
|
+
]
|
|
18
|
+
for_nodes(%w[node1 node2 node3]) do
|
|
19
|
+
retry_deploy_for_errors_on_stdout \'Retry stdout nodes\'
|
|
20
|
+
retry_deploy_for_errors_on_stderr \'Retry stderr nodes\'
|
|
21
|
+
end
|
|
22
|
+
' do
|
|
23
|
+
sort_proc = proc { |retriable_error_info| ((retriable_error_info[:errors_on_stdout] || []) + (retriable_error_info[:errors_on_stderr] || [])).first.to_s }
|
|
24
|
+
expect(test_config.retriable_errors.sort_by(&sort_proc)).to eq [
|
|
25
|
+
{
|
|
26
|
+
nodes_selectors_stack: [],
|
|
27
|
+
errors_on_stdout: ['Retry stdout global']
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
nodes_selectors_stack: [],
|
|
31
|
+
errors_on_stderr: ['Retry stderr global', /.+Retry stderr regexp global/]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
nodes_selectors_stack: [%w[node1 node2 node3]],
|
|
35
|
+
errors_on_stdout: ['Retry stdout nodes']
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
nodes_selectors_stack: [%w[node1 node2 node3]],
|
|
39
|
+
errors_on_stderr: ['Retry stderr nodes']
|
|
40
|
+
}
|
|
41
|
+
].sort_by(&sort_proc)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
11
45
|
it 'declares log plugins to be used' do
|
|
12
46
|
with_platforms(
|
|
13
47
|
<<~EO_CONFIG
|
|
@@ -35,7 +35,7 @@ describe HybridPlatformsConductor::HpcPlugins::PlatformHandler::ServerlessChef d
|
|
|
35
35
|
def expected_actions_to_deploy_chef(
|
|
36
36
|
repository,
|
|
37
37
|
check_mode: false,
|
|
38
|
-
sudo: 'sudo -u root ',
|
|
38
|
+
sudo: 'sudo -u root -E ',
|
|
39
39
|
env: 'prod',
|
|
40
40
|
policy: 'test_policy',
|
|
41
41
|
node: 'node',
|