Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aws
GitHub Repository: aws/aws-cli
Path: blob/develop/tests/unit/customizations/emr/test_constants.py
1569 views
1
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License"). You
4
# may not use this file except in compliance with the License. A copy of
5
# the License is located at
6
#
7
# http://aws.amazon.com/apache2.0/
8
#
9
# or in the "license" file accompanying this file. This file is
10
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
# ANY KIND, either express or implied. See the License for the specific
12
# language governing permissions and limitations under the License.
13
14
INSTANCE_GROUPS_WITH_AUTOSCALING_POLICY_ARG = (
15
' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge '
16
'InstanceGroupType=TASK,InstanceType=d2.xlarge,InstanceCount=2,'
17
'AutoScalingPolicy={Constraints={MinCapacity=1,MaxCapacity=2},'
18
'Rules=[{Name=TestRule,Description=TestDescription,Action={Market=ON_DEMAND,'
19
'SimpleScalingPolicyConfiguration={AdjustmentType=EXACT_CAPACITY,ScalingAdjustment=2,CoolDown=5}},'
20
'Trigger={CloudWatchAlarmDefinition={ComparisonOperator=GREATER_THAN,'
21
'EvaluationPeriods=5,MetricName=TestMetric,Namespace=EMR,Period=3,Statistic=MAXIMUM,'
22
'Threshold=4.565,Unit=NONE,Dimensions=[{Key=TestKey,Value=TestValue}]}}}]}'
23
)
24
25
INSTANCE_GROUPS_WITH_EBS_VOLUME_ARG = (
26
' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge '
27
'InstanceGroupType=CORE,InstanceType=d2.xlarge,InstanceCount=2,EbsConfiguration={EbsOptimized=true,EbsBlockDeviceConfigs=[{VolumeSpecification={VolumeType=gp2,SizeInGB=100,Iops=100},VolumesPerInstance=4},{VolumeSpecification={VolumeType=gp3,SizeInGB=100,Iops=3000,Throughput=200},VolumesPerInstance=1},{VolumeSpecification={VolumeType=gp3,SizeInGB=100}}]}')
28
29
INSTANCE_GROUPS_WITH_EBS_VOLUME_MISSING_VOLTYPE_ARG = (
30
' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge '
31
'InstanceGroupType=CORE,InstanceType=d2.xlarge,InstanceCount=2,EbsConfiguration={EbsOptimized=true,EbsBlockDeviceConfigs=[{VolumeSpecification={SizeInGB=100,Iops=100},VolumesPerInstance=4},{VolumeSpecification={VolumeType=gp2,SizeInGB=100,Iops=100}}]}')
32
33
INSTANCE_GROUPS_WITH_EBS_VOLUME_MISSING_SIZE_ARG = (
34
' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge '
35
'InstanceGroupType=CORE,InstanceType=d2.xlarge,InstanceCount=2,EbsConfiguration={EbsOptimized=true,EbsBlockDeviceConfigs=[{VolumeSpecification={VolumeType=gp2,Iops=100},VolumesPerInstance=4},{VolumeSpecification={VolumeType=gp2,SizeInGB=100,Iops=100}}]}')
36
37
INSTANCE_GROUPS_WITH_EBS_VOLUME_MISSING_VOLSPEC_ARG = (
38
' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge '
39
'InstanceGroupType=CORE,InstanceType=d2.xlarge,InstanceCount=2,EbsConfiguration={EbsOptimized=true}')
40
41
INSTANCE_GROUPS_WITH_EBS_VOLUME_MISSING_IOPS_ARG = (
42
' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge '
43
'InstanceGroupType=CORE,InstanceType=d2.xlarge,InstanceCount=2,EbsConfiguration={EbsOptimized=true,EbsBlockDeviceConfigs=[{VolumeSpecification={VolumeType=gp2,SizeInGB=100},VolumesPerInstance=4}]}')
44
45
MULTIPLE_INSTANCE_GROUPS_WITH_EBS_VOLUMES_VOLUME_ARG = (
46
' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge,EbsConfiguration={EbsOptimized=true,EbsBlockDeviceConfigs=[{VolumeSpecification={Iops=100,VolumeType=gp2,SizeInGB=20},VolumesPerInstance=4}]} '
47
'InstanceGroupType=CORE,InstanceType=d2.xlarge,InstanceCount=2,EbsConfiguration={EbsOptimized=true,EbsBlockDeviceConfigs=[{VolumeSpecification={VolumeType=gp2,SizeInGB=100}}]}')
48
49
INSTANCE_GROUPS_WITH_EBS = \
50
[{'InstanceCount': 1,
51
'InstanceRole': 'MASTER',
52
'InstanceType': 'd2.xlarge',
53
'Market': 'ON_DEMAND',
54
'Name': 'MASTER'},
55
{'EbsConfiguration': {'EbsOptimized': True,
56
'EbsBlockDeviceConfigs': [{'VolumeSpecification':
57
{'Iops': 100,
58
'SizeInGB': 100,
59
'VolumeType': 'gp2'},
60
'VolumesPerInstance': 4
61
},
62
{'VolumeSpecification':
63
{'Iops': 3000,
64
'SizeInGB': 100,
65
'VolumeType': 'gp3',
66
'Throughput': 200 },
67
'VolumesPerInstance': 1
68
},
69
{'VolumeSpecification':
70
{'SizeInGB': 100,
71
'VolumeType': 'gp3'}}]},
72
'InstanceCount': 2,
73
'InstanceRole': 'CORE',
74
'InstanceType': 'd2.xlarge',
75
'Market': 'ON_DEMAND',
76
'Name': 'CORE'}]
77
78
INSTANCE_GROUPS_WITH_EBS_VOLUME_MISSING_IOPS = \
79
[{'InstanceCount': 1,
80
'InstanceRole': 'MASTER',
81
'InstanceType': 'd2.xlarge',
82
'Market': 'ON_DEMAND',
83
'Name': 'MASTER'},
84
{'EbsConfiguration': {'EbsOptimized': True,
85
'EbsBlockDeviceConfigs': [{'VolumeSpecification':
86
{'SizeInGB': 100,
87
'VolumeType': 'gp2'},
88
'VolumesPerInstance': 4}]},
89
'InstanceCount': 2,
90
'InstanceRole': 'CORE',
91
'InstanceType': 'd2.xlarge',
92
'Market': 'ON_DEMAND',
93
'Name': 'CORE'}]
94
95
INSTANCE_GROUPS_WITH_EBS_VOLUME_MISSING_VOLSPEC = \
96
[{'InstanceCount': 1,
97
'InstanceRole': 'MASTER',
98
'InstanceType': 'd2.xlarge',
99
'Market': 'ON_DEMAND',
100
'Name': 'MASTER'},
101
{'EbsConfiguration': {'EbsOptimized': True},
102
'InstanceCount': 2,
103
'InstanceRole': 'CORE',
104
'InstanceType': 'd2.xlarge',
105
'Market': 'ON_DEMAND',
106
'Name': 'CORE'}]
107
108
MULTIPLE_INSTANCE_GROUPS_WITH_EBS_VOLUMES = \
109
[{'EbsConfiguration': {'EbsOptimized': True,
110
'EbsBlockDeviceConfigs': [{'VolumeSpecification':
111
{'Iops': 100,
112
'SizeInGB': 20,
113
'VolumeType': 'gp2'},
114
'VolumesPerInstance': 4}]},
115
'InstanceCount': 1,
116
'InstanceRole': 'MASTER',
117
'InstanceType': 'd2.xlarge',
118
'Market': 'ON_DEMAND',
119
'Name': 'MASTER'},
120
{'EbsConfiguration': {'EbsOptimized': True,
121
'EbsBlockDeviceConfigs': [{'VolumeSpecification':
122
{'SizeInGB': 100,
123
'VolumeType': 'gp2'}}]},
124
'InstanceCount': 2,
125
'InstanceRole': 'CORE',
126
'InstanceType': 'd2.xlarge',
127
'Market': 'ON_DEMAND',
128
'Name': 'CORE'}]
129
130
INSTANCE_GROUPS_WITH_AUTOSCALING_POLICY = \
131
[{'InstanceCount': 1,
132
'InstanceRole': 'MASTER',
133
'InstanceType': 'd2.xlarge',
134
'Market': 'ON_DEMAND',
135
'Name': 'MASTER'},
136
{'InstanceCount': 2,
137
'InstanceRole': 'TASK',
138
'InstanceType': 'd2.xlarge',
139
'Market': 'ON_DEMAND',
140
'Name': 'TASK',
141
'AutoScalingPolicy': {
142
'Constraints': {
143
'MinCapacity': 1,
144
'MaxCapacity': 2
145
},
146
'Rules': [
147
{
148
'Name': 'TestRule',
149
'Description': 'TestDescription',
150
'Action': {
151
'Market': 'ON_DEMAND',
152
'SimpleScalingPolicyConfiguration': {
153
'AdjustmentType': 'EXACT_CAPACITY',
154
'ScalingAdjustment': 2,
155
'CoolDown': 5
156
}
157
},
158
'Trigger': {
159
'CloudWatchAlarmDefinition': {
160
'ComparisonOperator': 'GREATER_THAN',
161
'Dimensions': [
162
{
163
'Key': 'TestKey',
164
'Value': 'TestValue'
165
}],
166
'EvaluationPeriods': 5,
167
'MetricName': 'TestMetric',
168
'Namespace': 'EMR',
169
'Period': 3,
170
'Statistic': 'MAXIMUM',
171
'Threshold': 4.565,
172
'Unit': 'NONE'
173
}
174
}
175
}
176
]
177
}
178
}]
179