Path: blob/develop/tests/unit/customizations/emr/test_constants.py
1569 views
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.1#2# Licensed under the Apache License, Version 2.0 (the "License"). You3# may not use this file except in compliance with the License. A copy of4# the License is located at5#6# http://aws.amazon.com/apache2.0/7#8# or in the "license" file accompanying this file. This file is9# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF10# ANY KIND, either express or implied. See the License for the specific11# language governing permissions and limitations under the License.1213INSTANCE_GROUPS_WITH_AUTOSCALING_POLICY_ARG = (14' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge '15'InstanceGroupType=TASK,InstanceType=d2.xlarge,InstanceCount=2,'16'AutoScalingPolicy={Constraints={MinCapacity=1,MaxCapacity=2},'17'Rules=[{Name=TestRule,Description=TestDescription,Action={Market=ON_DEMAND,'18'SimpleScalingPolicyConfiguration={AdjustmentType=EXACT_CAPACITY,ScalingAdjustment=2,CoolDown=5}},'19'Trigger={CloudWatchAlarmDefinition={ComparisonOperator=GREATER_THAN,'20'EvaluationPeriods=5,MetricName=TestMetric,Namespace=EMR,Period=3,Statistic=MAXIMUM,'21'Threshold=4.565,Unit=NONE,Dimensions=[{Key=TestKey,Value=TestValue}]}}}]}'22)2324INSTANCE_GROUPS_WITH_EBS_VOLUME_ARG = (25' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge '26'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}}]}')2728INSTANCE_GROUPS_WITH_EBS_VOLUME_MISSING_VOLTYPE_ARG = (29' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge '30'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}}]}')3132INSTANCE_GROUPS_WITH_EBS_VOLUME_MISSING_SIZE_ARG = (33' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge '34'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}}]}')3536INSTANCE_GROUPS_WITH_EBS_VOLUME_MISSING_VOLSPEC_ARG = (37' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge '38'InstanceGroupType=CORE,InstanceType=d2.xlarge,InstanceCount=2,EbsConfiguration={EbsOptimized=true}')3940INSTANCE_GROUPS_WITH_EBS_VOLUME_MISSING_IOPS_ARG = (41' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge '42'InstanceGroupType=CORE,InstanceType=d2.xlarge,InstanceCount=2,EbsConfiguration={EbsOptimized=true,EbsBlockDeviceConfigs=[{VolumeSpecification={VolumeType=gp2,SizeInGB=100},VolumesPerInstance=4}]}')4344MULTIPLE_INSTANCE_GROUPS_WITH_EBS_VOLUMES_VOLUME_ARG = (45' InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge,EbsConfiguration={EbsOptimized=true,EbsBlockDeviceConfigs=[{VolumeSpecification={Iops=100,VolumeType=gp2,SizeInGB=20},VolumesPerInstance=4}]} '46'InstanceGroupType=CORE,InstanceType=d2.xlarge,InstanceCount=2,EbsConfiguration={EbsOptimized=true,EbsBlockDeviceConfigs=[{VolumeSpecification={VolumeType=gp2,SizeInGB=100}}]}')4748INSTANCE_GROUPS_WITH_EBS = \49[{'InstanceCount': 1,50'InstanceRole': 'MASTER',51'InstanceType': 'd2.xlarge',52'Market': 'ON_DEMAND',53'Name': 'MASTER'},54{'EbsConfiguration': {'EbsOptimized': True,55'EbsBlockDeviceConfigs': [{'VolumeSpecification':56{'Iops': 100,57'SizeInGB': 100,58'VolumeType': 'gp2'},59'VolumesPerInstance': 460},61{'VolumeSpecification':62{'Iops': 3000,63'SizeInGB': 100,64'VolumeType': 'gp3',65'Throughput': 200 },66'VolumesPerInstance': 167},68{'VolumeSpecification':69{'SizeInGB': 100,70'VolumeType': 'gp3'}}]},71'InstanceCount': 2,72'InstanceRole': 'CORE',73'InstanceType': 'd2.xlarge',74'Market': 'ON_DEMAND',75'Name': 'CORE'}]7677INSTANCE_GROUPS_WITH_EBS_VOLUME_MISSING_IOPS = \78[{'InstanceCount': 1,79'InstanceRole': 'MASTER',80'InstanceType': 'd2.xlarge',81'Market': 'ON_DEMAND',82'Name': 'MASTER'},83{'EbsConfiguration': {'EbsOptimized': True,84'EbsBlockDeviceConfigs': [{'VolumeSpecification':85{'SizeInGB': 100,86'VolumeType': 'gp2'},87'VolumesPerInstance': 4}]},88'InstanceCount': 2,89'InstanceRole': 'CORE',90'InstanceType': 'd2.xlarge',91'Market': 'ON_DEMAND',92'Name': 'CORE'}]9394INSTANCE_GROUPS_WITH_EBS_VOLUME_MISSING_VOLSPEC = \95[{'InstanceCount': 1,96'InstanceRole': 'MASTER',97'InstanceType': 'd2.xlarge',98'Market': 'ON_DEMAND',99'Name': 'MASTER'},100{'EbsConfiguration': {'EbsOptimized': True},101'InstanceCount': 2,102'InstanceRole': 'CORE',103'InstanceType': 'd2.xlarge',104'Market': 'ON_DEMAND',105'Name': 'CORE'}]106107MULTIPLE_INSTANCE_GROUPS_WITH_EBS_VOLUMES = \108[{'EbsConfiguration': {'EbsOptimized': True,109'EbsBlockDeviceConfigs': [{'VolumeSpecification':110{'Iops': 100,111'SizeInGB': 20,112'VolumeType': 'gp2'},113'VolumesPerInstance': 4}]},114'InstanceCount': 1,115'InstanceRole': 'MASTER',116'InstanceType': 'd2.xlarge',117'Market': 'ON_DEMAND',118'Name': 'MASTER'},119{'EbsConfiguration': {'EbsOptimized': True,120'EbsBlockDeviceConfigs': [{'VolumeSpecification':121{'SizeInGB': 100,122'VolumeType': 'gp2'}}]},123'InstanceCount': 2,124'InstanceRole': 'CORE',125'InstanceType': 'd2.xlarge',126'Market': 'ON_DEMAND',127'Name': 'CORE'}]128129INSTANCE_GROUPS_WITH_AUTOSCALING_POLICY = \130[{'InstanceCount': 1,131'InstanceRole': 'MASTER',132'InstanceType': 'd2.xlarge',133'Market': 'ON_DEMAND',134'Name': 'MASTER'},135{'InstanceCount': 2,136'InstanceRole': 'TASK',137'InstanceType': 'd2.xlarge',138'Market': 'ON_DEMAND',139'Name': 'TASK',140'AutoScalingPolicy': {141'Constraints': {142'MinCapacity': 1,143'MaxCapacity': 2144},145'Rules': [146{147'Name': 'TestRule',148'Description': 'TestDescription',149'Action': {150'Market': 'ON_DEMAND',151'SimpleScalingPolicyConfiguration': {152'AdjustmentType': 'EXACT_CAPACITY',153'ScalingAdjustment': 2,154'CoolDown': 5155}156},157'Trigger': {158'CloudWatchAlarmDefinition': {159'ComparisonOperator': 'GREATER_THAN',160'Dimensions': [161{162'Key': 'TestKey',163'Value': 'TestValue'164}],165'EvaluationPeriods': 5,166'MetricName': 'TestMetric',167'Namespace': 'EMR',168'Period': 3,169'Statistic': 'MAXIMUM',170'Threshold': 4.565,171'Unit': 'NONE'172}173}174}175]176}177}]178179