awscli 1.42.69__py3-none-any.whl → 1.44.6__py3-none-any.whl
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.
Potentially problematic release.
This version of awscli might be problematic. Click here for more details.
- awscli/__init__.py +1 -1
- awscli/alias.py +3 -3
- awscli/argprocess.py +2 -1
- awscli/bcdoc/docevents.py +3 -0
- awscli/clidocs.py +19 -2
- awscli/clidriver.py +55 -9
- awscli/customizations/argrename.py +1 -0
- awscli/customizations/cliinputjson.py +4 -0
- awscli/customizations/cloudformation/deploy.py +19 -3
- awscli/customizations/cloudtrail/validation.py +22 -2
- awscli/customizations/commands.py +2 -1
- awscli/customizations/emr/argumentschema.py +355 -344
- awscli/customizations/emr/createcluster.py +12 -0
- awscli/customizations/emr/emrutils.py +83 -50
- awscli/customizations/emr/helptext.py +10 -0
- awscli/customizations/emr/steputils.py +92 -52
- awscli/customizations/globalargs.py +169 -0
- awscli/customizations/paginate.py +66 -1
- awscli/customizations/s3/filegenerator.py +4 -1
- awscli/customizations/s3/fileinfo.py +4 -1
- awscli/customizations/s3/fileinfobuilder.py +6 -0
- awscli/customizations/s3/s3handler.py +9 -0
- awscli/customizations/s3/subcommands.py +147 -6
- awscli/customizations/s3/syncstrategy/base.py +9 -0
- awscli/customizations/s3/syncstrategy/caseconflict.py +92 -0
- awscli/customizations/s3/utils.py +14 -0
- awscli/customizations/scalarparse.py +42 -5
- awscli/data/cli.json +5 -0
- awscli/examples/cloudformation/create-generated-template.rst +50 -0
- awscli/examples/cloudformation/create-stack-refactor.rst +16 -0
- awscli/examples/cloudformation/delete-generated-template.rst +10 -0
- awscli/examples/cloudformation/describe-generated-template.rst +62 -0
- awscli/examples/cloudformation/describe-resource-scan.rst +38 -0
- awscli/examples/cloudformation/describe-stack-refactor.rst +20 -0
- awscli/examples/cloudformation/execute-stack-refactor.rst +10 -0
- awscli/examples/cloudformation/list-generated-templates.rst +41 -0
- awscli/examples/cloudformation/list-resource-scan-related-resources.rst +47 -0
- awscli/examples/cloudformation/list-resource-scan-resources.rst +30 -0
- awscli/examples/cloudformation/list-stack-refactor-actions.rst +71 -0
- awscli/examples/cloudformation/start-resource-scan.rst +14 -0
- awscli/examples/global_options.rst +4 -0
- awscli/examples/global_synopsis.rst +1 -0
- awscli/examples/medical-imaging/create-datastore.rst +19 -2
- awscli/examples/medical-imaging/get-datastore.rst +24 -1
- awscli/paramfile.py +21 -4
- awscli/testutils.py +17 -0
- awscli/topics/s3-case-insensitivity.rst +105 -0
- awscli/topics/topic-tags.json +16 -0
- awscli/utils.py +19 -2
- {awscli-1.42.69.dist-info → awscli-1.44.6.dist-info}/METADATA +3 -3
- {awscli-1.42.69.dist-info → awscli-1.44.6.dist-info}/RECORD +59 -45
- {awscli-1.42.69.data → awscli-1.44.6.data}/scripts/aws +0 -0
- {awscli-1.42.69.data → awscli-1.44.6.data}/scripts/aws.cmd +0 -0
- {awscli-1.42.69.data → awscli-1.44.6.data}/scripts/aws_bash_completer +0 -0
- {awscli-1.42.69.data → awscli-1.44.6.data}/scripts/aws_completer +0 -0
- {awscli-1.42.69.data → awscli-1.44.6.data}/scripts/aws_zsh_completer.sh +0 -0
- {awscli-1.42.69.dist-info → awscli-1.44.6.dist-info}/LICENSE.txt +0 -0
- {awscli-1.42.69.dist-info → awscli-1.44.6.dist-info}/WHEEL +0 -0
- {awscli-1.42.69.dist-info → awscli-1.44.6.dist-info}/top_level.txt +0 -0
|
@@ -212,6 +212,11 @@ class CreateCluster(Command):
|
|
|
212
212
|
'schema': argumentschema.AUTO_TERMINATION_POLICY_SCHEMA,
|
|
213
213
|
'help_text': helptext.AUTO_TERMINATION_POLICY,
|
|
214
214
|
},
|
|
215
|
+
{
|
|
216
|
+
'name': 'monitoring-configuration',
|
|
217
|
+
'schema': argumentschema.MONITORING_CONFIGURATION_SCHEMA,
|
|
218
|
+
'help_text': helptext.MONITORING_CONFIGURATION,
|
|
219
|
+
},
|
|
215
220
|
{
|
|
216
221
|
'name': 'extended-support',
|
|
217
222
|
'action': 'store_true',
|
|
@@ -553,6 +558,13 @@ class CreateCluster(Command):
|
|
|
553
558
|
parsed_args.auto_termination_policy,
|
|
554
559
|
)
|
|
555
560
|
|
|
561
|
+
if parsed_args.monitoring_configuration is not None:
|
|
562
|
+
emrutils.apply_dict(
|
|
563
|
+
params,
|
|
564
|
+
'MonitoringConfiguration',
|
|
565
|
+
parsed_args.monitoring_configuration,
|
|
566
|
+
)
|
|
567
|
+
|
|
556
568
|
self._validate_required_applications(parsed_args)
|
|
557
569
|
|
|
558
570
|
run_job_flow_response = emrutils.call(
|
|
@@ -15,12 +15,10 @@ import json
|
|
|
15
15
|
import logging
|
|
16
16
|
import os
|
|
17
17
|
|
|
18
|
+
from botocore.exceptions import NoCredentialsError
|
|
18
19
|
|
|
19
20
|
from awscli.clidriver import CLIOperationCaller
|
|
20
|
-
from awscli.customizations.emr import constants
|
|
21
|
-
from awscli.customizations.emr import exceptions
|
|
22
|
-
from botocore.exceptions import WaiterError, NoCredentialsError
|
|
23
|
-
from botocore import xform_name
|
|
21
|
+
from awscli.customizations.emr import constants, exceptions
|
|
24
22
|
|
|
25
23
|
LOG = logging.getLogger(__name__)
|
|
26
24
|
|
|
@@ -56,11 +54,16 @@ def parse_key_value_string(key_value_string):
|
|
|
56
54
|
|
|
57
55
|
|
|
58
56
|
def apply_boolean_options(
|
|
59
|
-
|
|
57
|
+
true_option, true_option_name, false_option, false_option_name
|
|
58
|
+
):
|
|
60
59
|
if true_option and false_option:
|
|
61
|
-
error_message =
|
|
62
|
-
'aws: error: cannot use both '
|
|
63
|
-
|
|
60
|
+
error_message = (
|
|
61
|
+
'aws: error: cannot use both '
|
|
62
|
+
+ true_option_name
|
|
63
|
+
+ ' and '
|
|
64
|
+
+ false_option_name
|
|
65
|
+
+ ' options together.'
|
|
66
|
+
)
|
|
64
67
|
raise ValueError(error_message)
|
|
65
68
|
elif true_option:
|
|
66
69
|
return True
|
|
@@ -91,13 +94,16 @@ def apply_params(src_params, src_key, dest_params, dest_key):
|
|
|
91
94
|
|
|
92
95
|
|
|
93
96
|
def build_step(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
jar,
|
|
98
|
+
name='Step',
|
|
99
|
+
action_on_failure=constants.DEFAULT_FAILURE_ACTION,
|
|
100
|
+
args=None,
|
|
101
|
+
main_class=None,
|
|
102
|
+
properties=None,
|
|
103
|
+
log_uri=None,
|
|
104
|
+
encryption_key_arn=None,
|
|
105
|
+
):
|
|
106
|
+
check_required_field(structure='HadoopJarStep', name='Jar', value=jar)
|
|
101
107
|
|
|
102
108
|
step = {}
|
|
103
109
|
apply_dict(step, 'Name', name)
|
|
@@ -108,17 +114,26 @@ def build_step(
|
|
|
108
114
|
apply_dict(jar_config, 'MainClass', main_class)
|
|
109
115
|
apply_dict(jar_config, 'Properties', properties)
|
|
110
116
|
step['HadoopJarStep'] = jar_config
|
|
117
|
+
step_monitoring_config = {}
|
|
118
|
+
s3_monitoring_configuration = {}
|
|
119
|
+
apply_dict(s3_monitoring_configuration, 'LogUri', log_uri)
|
|
120
|
+
apply_dict(
|
|
121
|
+
s3_monitoring_configuration, 'EncryptionKeyArn', encryption_key_arn
|
|
122
|
+
)
|
|
123
|
+
if s3_monitoring_configuration:
|
|
124
|
+
step_monitoring_config['S3MonitoringConfiguration'] = (
|
|
125
|
+
s3_monitoring_configuration
|
|
126
|
+
)
|
|
127
|
+
step['StepMonitoringConfiguration'] = step_monitoring_config
|
|
111
128
|
|
|
112
129
|
return step
|
|
113
130
|
|
|
114
131
|
|
|
115
|
-
def build_bootstrap_action(
|
|
116
|
-
path,
|
|
117
|
-
name='Bootstrap Action',
|
|
118
|
-
args=None):
|
|
132
|
+
def build_bootstrap_action(path, name='Bootstrap Action', args=None):
|
|
119
133
|
if path is None:
|
|
120
134
|
raise exceptions.MissingParametersError(
|
|
121
|
-
object_name='ScriptBootstrapActionConfig', missing='Path'
|
|
135
|
+
object_name='ScriptBootstrapActionConfig', missing='Path'
|
|
136
|
+
)
|
|
122
137
|
ba_config = {}
|
|
123
138
|
apply_dict(ba_config, 'Name', name)
|
|
124
139
|
script_config = {}
|
|
@@ -132,20 +147,22 @@ def build_bootstrap_action(
|
|
|
132
147
|
def build_s3_link(relative_path='', region='us-east-1'):
|
|
133
148
|
if region is None:
|
|
134
149
|
region = 'us-east-1'
|
|
135
|
-
return 's3://{
|
|
150
|
+
return f's3://{region}.elasticmapreduce{relative_path}'
|
|
136
151
|
|
|
137
152
|
|
|
138
153
|
def get_script_runner(region='us-east-1'):
|
|
139
154
|
if region is None:
|
|
140
155
|
region = 'us-east-1'
|
|
141
156
|
return build_s3_link(
|
|
142
|
-
relative_path=constants.SCRIPT_RUNNER_PATH, region=region
|
|
157
|
+
relative_path=constants.SCRIPT_RUNNER_PATH, region=region
|
|
158
|
+
)
|
|
143
159
|
|
|
144
160
|
|
|
145
161
|
def check_required_field(structure, name, value):
|
|
146
162
|
if not value:
|
|
147
163
|
raise exceptions.MissingParametersError(
|
|
148
|
-
object_name=structure, missing=name
|
|
164
|
+
object_name=structure, missing=name
|
|
165
|
+
)
|
|
149
166
|
|
|
150
167
|
|
|
151
168
|
def check_empty_string_list(name, value):
|
|
@@ -153,8 +170,14 @@ def check_empty_string_list(name, value):
|
|
|
153
170
|
raise exceptions.EmptyListError(param=name)
|
|
154
171
|
|
|
155
172
|
|
|
156
|
-
def call(
|
|
157
|
-
|
|
173
|
+
def call(
|
|
174
|
+
session,
|
|
175
|
+
operation_name,
|
|
176
|
+
parameters,
|
|
177
|
+
region_name=None,
|
|
178
|
+
endpoint_url=None,
|
|
179
|
+
verify=None,
|
|
180
|
+
):
|
|
158
181
|
# We could get an error from get_endpoint() about not having
|
|
159
182
|
# a region configured. Before this happens we want to check
|
|
160
183
|
# for credentials so we can give a good error message.
|
|
@@ -162,8 +185,11 @@ def call(session, operation_name, parameters, region_name=None,
|
|
|
162
185
|
raise NoCredentialsError()
|
|
163
186
|
|
|
164
187
|
client = session.create_client(
|
|
165
|
-
'emr',
|
|
166
|
-
|
|
188
|
+
'emr',
|
|
189
|
+
region_name=region_name,
|
|
190
|
+
endpoint_url=endpoint_url,
|
|
191
|
+
verify=verify,
|
|
192
|
+
)
|
|
167
193
|
LOG.debug('Calling ' + str(operation_name))
|
|
168
194
|
return getattr(client, operation_name)(**parameters)
|
|
169
195
|
|
|
@@ -181,7 +207,8 @@ def get_client(session, parsed_globals):
|
|
|
181
207
|
'emr',
|
|
182
208
|
region_name=get_region(session, parsed_globals),
|
|
183
209
|
endpoint_url=parsed_globals.endpoint_url,
|
|
184
|
-
verify=parsed_globals.verify_ssl
|
|
210
|
+
verify=parsed_globals.verify_ssl,
|
|
211
|
+
)
|
|
185
212
|
|
|
186
213
|
|
|
187
214
|
def get_cluster_state(session, parsed_globals, cluster_id):
|
|
@@ -209,12 +236,13 @@ def which(program):
|
|
|
209
236
|
return None
|
|
210
237
|
|
|
211
238
|
|
|
212
|
-
def call_and_display_response(
|
|
213
|
-
|
|
239
|
+
def call_and_display_response(
|
|
240
|
+
session, operation_name, parameters, parsed_globals
|
|
241
|
+
):
|
|
214
242
|
cli_operation_caller = CLIOperationCaller(session)
|
|
215
243
|
cli_operation_caller.invoke(
|
|
216
|
-
'emr', operation_name,
|
|
217
|
-
|
|
244
|
+
'emr', operation_name, parameters, parsed_globals
|
|
245
|
+
)
|
|
218
246
|
|
|
219
247
|
|
|
220
248
|
def display_response(session, operation_name, result, parsed_globals):
|
|
@@ -222,7 +250,8 @@ def display_response(session, operation_name, result, parsed_globals):
|
|
|
222
250
|
# Calling a private method. Should be changed after the functionality
|
|
223
251
|
# is moved outside CliOperationCaller.
|
|
224
252
|
cli_operation_caller._display_response(
|
|
225
|
-
operation_name, result, parsed_globals
|
|
253
|
+
operation_name, result, parsed_globals
|
|
254
|
+
)
|
|
226
255
|
|
|
227
256
|
|
|
228
257
|
def get_region(session, parsed_globals):
|
|
@@ -244,8 +273,9 @@ def join(values, separator=',', lastSeparator='and'):
|
|
|
244
273
|
return values[0]
|
|
245
274
|
else:
|
|
246
275
|
separator = '%s ' % separator
|
|
247
|
-
return ' '.join(
|
|
248
|
-
|
|
276
|
+
return ' '.join(
|
|
277
|
+
[separator.join(values[:-1]), lastSeparator, values[-1]]
|
|
278
|
+
)
|
|
249
279
|
|
|
250
280
|
|
|
251
281
|
def split_to_key_value(string):
|
|
@@ -255,21 +285,24 @@ def split_to_key_value(string):
|
|
|
255
285
|
return string.split('=', 1)
|
|
256
286
|
|
|
257
287
|
|
|
258
|
-
def get_cluster(cluster_id, session, region,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
288
|
+
def get_cluster(cluster_id, session, region, endpoint_url, verify_ssl):
|
|
289
|
+
describe_cluster_params = {'ClusterId': cluster_id}
|
|
290
|
+
describe_cluster_response = call(
|
|
291
|
+
session,
|
|
292
|
+
'describe_cluster',
|
|
293
|
+
describe_cluster_params,
|
|
294
|
+
region,
|
|
295
|
+
endpoint_url,
|
|
296
|
+
verify_ssl,
|
|
297
|
+
)
|
|
265
298
|
|
|
266
|
-
|
|
267
|
-
|
|
299
|
+
if describe_cluster_response is not None:
|
|
300
|
+
return describe_cluster_response.get('Cluster')
|
|
268
301
|
|
|
269
302
|
|
|
270
|
-
def get_release_label(cluster_id, session, region,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
303
|
+
def get_release_label(cluster_id, session, region, endpoint_url, verify_ssl):
|
|
304
|
+
cluster = get_cluster(
|
|
305
|
+
cluster_id, session, region, endpoint_url, verify_ssl
|
|
306
|
+
)
|
|
307
|
+
if cluster is not None:
|
|
308
|
+
return cluster.get('ReleaseLabel')
|
|
@@ -570,3 +570,13 @@ UNHEALTHY_NODE_REPLACEMENT = (
|
|
|
570
570
|
)
|
|
571
571
|
|
|
572
572
|
EXTENDED_SUPPORT = '<p>Reserved.</p> '
|
|
573
|
+
|
|
574
|
+
MONITORING_CONFIGURATION = (
|
|
575
|
+
'<p>Monitoring configuration for an Amazon EMR cluster. '
|
|
576
|
+
'The configuration specifies CloudWatch logging settings for the cluster. '
|
|
577
|
+
'You can configure the CloudWatchLogConfiguration which includes '
|
|
578
|
+
'the Enabled flag (required), LogGroupName, LogStreamNamePrefix, '
|
|
579
|
+
'EncryptionKeyArn, and LogTypes. The LogTypes parameter is a map '
|
|
580
|
+
'of log type categories (e.g., "STEP_LOGS", "SPARK_DRIVER", '
|
|
581
|
+
'"SPARK_EXECUTOR") to a list of file names (e.g., "STDOUT", "STDERR").</p>'
|
|
582
|
+
)
|
|
@@ -11,9 +11,7 @@
|
|
|
11
11
|
# ANY KIND, either express or implied. See the License for the specific
|
|
12
12
|
# language governing permissions and limitations under the License.
|
|
13
13
|
|
|
14
|
-
from awscli.customizations.emr import emrutils
|
|
15
|
-
from awscli.customizations.emr import constants
|
|
16
|
-
from awscli.customizations.emr import exceptions
|
|
14
|
+
from awscli.customizations.emr import constants, emrutils, exceptions
|
|
17
15
|
|
|
18
16
|
|
|
19
17
|
def build_step_config_list(parsed_step_list, region, release_label):
|
|
@@ -29,23 +27,24 @@ def build_step_config_list(parsed_step_list, region, release_label):
|
|
|
29
27
|
step_config = build_custom_jar_step(parsed_step=step)
|
|
30
28
|
elif step_type == constants.STREAMING:
|
|
31
29
|
step_config = build_streaming_step(
|
|
32
|
-
parsed_step=step, release_label=release_label
|
|
30
|
+
parsed_step=step, release_label=release_label
|
|
31
|
+
)
|
|
33
32
|
elif step_type == constants.HIVE:
|
|
34
33
|
step_config = build_hive_step(
|
|
35
|
-
parsed_step=step, region=region,
|
|
36
|
-
|
|
34
|
+
parsed_step=step, region=region, release_label=release_label
|
|
35
|
+
)
|
|
37
36
|
elif step_type == constants.PIG:
|
|
38
37
|
step_config = build_pig_step(
|
|
39
|
-
parsed_step=step, region=region,
|
|
40
|
-
|
|
38
|
+
parsed_step=step, region=region, release_label=release_label
|
|
39
|
+
)
|
|
41
40
|
elif step_type == constants.IMPALA:
|
|
42
41
|
step_config = build_impala_step(
|
|
43
|
-
parsed_step=step, region=region,
|
|
44
|
-
|
|
42
|
+
parsed_step=step, region=region, release_label=release_label
|
|
43
|
+
)
|
|
45
44
|
elif step_type == constants.SPARK:
|
|
46
45
|
step_config = build_spark_step(
|
|
47
|
-
parsed_step=step, region=region,
|
|
48
|
-
|
|
46
|
+
parsed_step=step, region=region, release_label=release_label
|
|
47
|
+
)
|
|
49
48
|
else:
|
|
50
49
|
raise exceptions.UnknownStepTypeError(step_type=step_type)
|
|
51
50
|
|
|
@@ -57,14 +56,17 @@ def build_step_config_list(parsed_step_list, region, release_label):
|
|
|
57
56
|
def build_custom_jar_step(parsed_step):
|
|
58
57
|
name = _apply_default_value(
|
|
59
58
|
arg=parsed_step.get('Name'),
|
|
60
|
-
value=constants.DEFAULT_CUSTOM_JAR_STEP_NAME
|
|
59
|
+
value=constants.DEFAULT_CUSTOM_JAR_STEP_NAME,
|
|
60
|
+
)
|
|
61
61
|
action_on_failure = _apply_default_value(
|
|
62
62
|
arg=parsed_step.get('ActionOnFailure'),
|
|
63
|
-
value=constants.DEFAULT_FAILURE_ACTION
|
|
63
|
+
value=constants.DEFAULT_FAILURE_ACTION,
|
|
64
|
+
)
|
|
64
65
|
emrutils.check_required_field(
|
|
65
66
|
structure=constants.CUSTOM_JAR_STEP_CONFIG,
|
|
66
67
|
name='Jar',
|
|
67
|
-
value=parsed_step.get('Jar')
|
|
68
|
+
value=parsed_step.get('Jar'),
|
|
69
|
+
)
|
|
68
70
|
return emrutils.build_step(
|
|
69
71
|
jar=parsed_step.get('Jar'),
|
|
70
72
|
args=parsed_step.get('Args'),
|
|
@@ -72,22 +74,27 @@ def build_custom_jar_step(parsed_step):
|
|
|
72
74
|
action_on_failure=action_on_failure,
|
|
73
75
|
main_class=parsed_step.get('MainClass'),
|
|
74
76
|
properties=emrutils.parse_key_value_string(
|
|
75
|
-
parsed_step.get('Properties')
|
|
77
|
+
parsed_step.get('Properties')
|
|
78
|
+
),
|
|
79
|
+
log_uri=parsed_step.get('LogUri'),
|
|
80
|
+
encryption_key_arn=parsed_step.get('EncryptionKeyArn'),
|
|
81
|
+
)
|
|
76
82
|
|
|
77
83
|
|
|
78
84
|
def build_streaming_step(parsed_step, release_label):
|
|
79
85
|
name = _apply_default_value(
|
|
80
86
|
arg=parsed_step.get('Name'),
|
|
81
|
-
value=constants.DEFAULT_STREAMING_STEP_NAME
|
|
87
|
+
value=constants.DEFAULT_STREAMING_STEP_NAME,
|
|
88
|
+
)
|
|
82
89
|
action_on_failure = _apply_default_value(
|
|
83
90
|
arg=parsed_step.get('ActionOnFailure'),
|
|
84
|
-
value=constants.DEFAULT_FAILURE_ACTION
|
|
91
|
+
value=constants.DEFAULT_FAILURE_ACTION,
|
|
92
|
+
)
|
|
85
93
|
|
|
86
94
|
args = parsed_step.get('Args')
|
|
87
95
|
emrutils.check_required_field(
|
|
88
|
-
structure=constants.STREAMING_STEP_CONFIG,
|
|
89
|
-
|
|
90
|
-
value=args)
|
|
96
|
+
structure=constants.STREAMING_STEP_CONFIG, name='Args', value=args
|
|
97
|
+
)
|
|
91
98
|
emrutils.check_empty_string_list(name='Args', value=args)
|
|
92
99
|
args_list = []
|
|
93
100
|
|
|
@@ -103,27 +110,34 @@ def build_streaming_step(parsed_step, release_label):
|
|
|
103
110
|
jar=jar,
|
|
104
111
|
args=args_list,
|
|
105
112
|
name=name,
|
|
106
|
-
action_on_failure=action_on_failure
|
|
113
|
+
action_on_failure=action_on_failure,
|
|
114
|
+
log_uri=parsed_step.get('LogUri'),
|
|
115
|
+
encryption_key_arn=parsed_step.get('EncryptionKeyArn'),
|
|
116
|
+
)
|
|
107
117
|
|
|
108
118
|
|
|
109
119
|
def build_hive_step(parsed_step, release_label, region=None):
|
|
110
120
|
args = parsed_step.get('Args')
|
|
111
121
|
emrutils.check_required_field(
|
|
112
|
-
structure=constants.HIVE_STEP_CONFIG, name='Args', value=args
|
|
122
|
+
structure=constants.HIVE_STEP_CONFIG, name='Args', value=args
|
|
123
|
+
)
|
|
113
124
|
emrutils.check_empty_string_list(name='Args', value=args)
|
|
114
125
|
name = _apply_default_value(
|
|
115
|
-
arg=parsed_step.get('Name'),
|
|
116
|
-
|
|
117
|
-
action_on_failure =
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
arg=parsed_step.get('Name'), value=constants.DEFAULT_HIVE_STEP_NAME
|
|
127
|
+
)
|
|
128
|
+
action_on_failure = _apply_default_value(
|
|
129
|
+
arg=parsed_step.get('ActionOnFailure'),
|
|
130
|
+
value=constants.DEFAULT_FAILURE_ACTION,
|
|
131
|
+
)
|
|
121
132
|
|
|
122
133
|
return emrutils.build_step(
|
|
123
134
|
jar=_get_runner_jar(release_label, region),
|
|
124
135
|
args=_build_hive_args(args, release_label, region),
|
|
125
136
|
name=name,
|
|
126
|
-
action_on_failure=action_on_failure
|
|
137
|
+
action_on_failure=action_on_failure,
|
|
138
|
+
log_uri=parsed_step.get('LogUri'),
|
|
139
|
+
encryption_key_arn=parsed_step.get('EncryptionKeyArn'),
|
|
140
|
+
)
|
|
127
141
|
|
|
128
142
|
|
|
129
143
|
def _build_hive_args(args, release_label, region):
|
|
@@ -131,8 +145,11 @@ def _build_hive_args(args, release_label, region):
|
|
|
131
145
|
if release_label:
|
|
132
146
|
args_list.append(constants.HIVE_SCRIPT_COMMAND)
|
|
133
147
|
else:
|
|
134
|
-
args_list.append(
|
|
135
|
-
|
|
148
|
+
args_list.append(
|
|
149
|
+
emrutils.build_s3_link(
|
|
150
|
+
relative_path=constants.HIVE_SCRIPT_PATH, region=region
|
|
151
|
+
)
|
|
152
|
+
)
|
|
136
153
|
|
|
137
154
|
args_list.append(constants.RUN_HIVE_SCRIPT)
|
|
138
155
|
|
|
@@ -149,20 +166,25 @@ def _build_hive_args(args, release_label, region):
|
|
|
149
166
|
def build_pig_step(parsed_step, release_label, region=None):
|
|
150
167
|
args = parsed_step.get('Args')
|
|
151
168
|
emrutils.check_required_field(
|
|
152
|
-
structure=constants.PIG_STEP_CONFIG, name='Args', value=args
|
|
169
|
+
structure=constants.PIG_STEP_CONFIG, name='Args', value=args
|
|
170
|
+
)
|
|
153
171
|
emrutils.check_empty_string_list(name='Args', value=args)
|
|
154
172
|
name = _apply_default_value(
|
|
155
|
-
arg=parsed_step.get('Name'),
|
|
156
|
-
|
|
173
|
+
arg=parsed_step.get('Name'), value=constants.DEFAULT_PIG_STEP_NAME
|
|
174
|
+
)
|
|
157
175
|
action_on_failure = _apply_default_value(
|
|
158
176
|
arg=parsed_step.get('ActionOnFailure'),
|
|
159
|
-
value=constants.DEFAULT_FAILURE_ACTION
|
|
177
|
+
value=constants.DEFAULT_FAILURE_ACTION,
|
|
178
|
+
)
|
|
160
179
|
|
|
161
180
|
return emrutils.build_step(
|
|
162
181
|
jar=_get_runner_jar(release_label, region),
|
|
163
182
|
args=_build_pig_args(args, release_label, region),
|
|
164
183
|
name=name,
|
|
165
|
-
action_on_failure=action_on_failure
|
|
184
|
+
action_on_failure=action_on_failure,
|
|
185
|
+
log_uri=parsed_step.get('LogUri'),
|
|
186
|
+
encryption_key_arn=parsed_step.get('EncryptionKeyArn'),
|
|
187
|
+
)
|
|
166
188
|
|
|
167
189
|
|
|
168
190
|
def _build_pig_args(args, release_label, region):
|
|
@@ -170,8 +192,11 @@ def _build_pig_args(args, release_label, region):
|
|
|
170
192
|
if release_label:
|
|
171
193
|
args_list.append(constants.PIG_SCRIPT_COMMAND)
|
|
172
194
|
else:
|
|
173
|
-
args_list.append(
|
|
174
|
-
|
|
195
|
+
args_list.append(
|
|
196
|
+
emrutils.build_s3_link(
|
|
197
|
+
relative_path=constants.PIG_SCRIPT_PATH, region=region
|
|
198
|
+
)
|
|
199
|
+
)
|
|
175
200
|
|
|
176
201
|
args_list.append(constants.RUN_PIG_SCRIPT)
|
|
177
202
|
|
|
@@ -189,43 +214,55 @@ def build_impala_step(parsed_step, release_label, region=None):
|
|
|
189
214
|
if release_label:
|
|
190
215
|
raise exceptions.UnknownStepTypeError(step_type=constants.IMPALA)
|
|
191
216
|
name = _apply_default_value(
|
|
192
|
-
arg=parsed_step.get('Name'),
|
|
193
|
-
|
|
217
|
+
arg=parsed_step.get('Name'), value=constants.DEFAULT_IMPALA_STEP_NAME
|
|
218
|
+
)
|
|
194
219
|
action_on_failure = _apply_default_value(
|
|
195
220
|
arg=parsed_step.get('ActionOnFailure'),
|
|
196
|
-
value=constants.DEFAULT_FAILURE_ACTION
|
|
221
|
+
value=constants.DEFAULT_FAILURE_ACTION,
|
|
222
|
+
)
|
|
197
223
|
args_list = [
|
|
198
224
|
emrutils.build_s3_link(
|
|
199
|
-
relative_path=constants.IMPALA_INSTALL_PATH, region=region
|
|
200
|
-
|
|
225
|
+
relative_path=constants.IMPALA_INSTALL_PATH, region=region
|
|
226
|
+
),
|
|
227
|
+
constants.RUN_IMPALA_SCRIPT,
|
|
228
|
+
]
|
|
201
229
|
args = parsed_step.get('Args')
|
|
202
230
|
emrutils.check_required_field(
|
|
203
|
-
structure=constants.IMPALA_STEP_CONFIG, name='Args', value=args
|
|
231
|
+
structure=constants.IMPALA_STEP_CONFIG, name='Args', value=args
|
|
232
|
+
)
|
|
204
233
|
args_list += args
|
|
205
234
|
|
|
206
235
|
return emrutils.build_step(
|
|
207
236
|
jar=emrutils.get_script_runner(region),
|
|
208
237
|
args=args_list,
|
|
209
238
|
name=name,
|
|
210
|
-
action_on_failure=action_on_failure
|
|
239
|
+
action_on_failure=action_on_failure,
|
|
240
|
+
log_uri=parsed_step.get('LogUri'),
|
|
241
|
+
encryption_key_arn=parsed_step.get('EncryptionKeyArn'),
|
|
242
|
+
)
|
|
211
243
|
|
|
212
244
|
|
|
213
245
|
def build_spark_step(parsed_step, release_label, region=None):
|
|
214
246
|
name = _apply_default_value(
|
|
215
|
-
arg=parsed_step.get('Name'),
|
|
216
|
-
|
|
247
|
+
arg=parsed_step.get('Name'), value=constants.DEFAULT_SPARK_STEP_NAME
|
|
248
|
+
)
|
|
217
249
|
action_on_failure = _apply_default_value(
|
|
218
250
|
arg=parsed_step.get('ActionOnFailure'),
|
|
219
|
-
value=constants.DEFAULT_FAILURE_ACTION
|
|
251
|
+
value=constants.DEFAULT_FAILURE_ACTION,
|
|
252
|
+
)
|
|
220
253
|
args = parsed_step.get('Args')
|
|
221
254
|
emrutils.check_required_field(
|
|
222
|
-
structure=constants.SPARK_STEP_CONFIG, name='Args', value=args
|
|
255
|
+
structure=constants.SPARK_STEP_CONFIG, name='Args', value=args
|
|
256
|
+
)
|
|
223
257
|
|
|
224
258
|
return emrutils.build_step(
|
|
225
259
|
jar=_get_runner_jar(release_label, region),
|
|
226
260
|
args=_build_spark_args(args, release_label, region),
|
|
227
261
|
name=name,
|
|
228
|
-
action_on_failure=action_on_failure
|
|
262
|
+
action_on_failure=action_on_failure,
|
|
263
|
+
log_uri=parsed_step.get('LogUri'),
|
|
264
|
+
encryption_key_arn=parsed_step.get('EncryptionKeyArn'),
|
|
265
|
+
)
|
|
229
266
|
|
|
230
267
|
|
|
231
268
|
def _build_spark_args(args, release_label, region):
|
|
@@ -247,5 +284,8 @@ def _apply_default_value(arg, value):
|
|
|
247
284
|
|
|
248
285
|
|
|
249
286
|
def _get_runner_jar(release_label, region):
|
|
250
|
-
return
|
|
287
|
+
return (
|
|
288
|
+
constants.COMMAND_RUNNER
|
|
289
|
+
if release_label
|
|
251
290
|
else emrutils.get_script_runner(region)
|
|
291
|
+
)
|