【问题标题】:Bid Price in AWS Instance FleetsAWS 实例队列中的投标价格
【发布时间】:2022-01-06 17:13:00
【问题描述】:

我通过 boto3 run_job_flow() 使用实例队列来创建 aws 集群。我不断收到此错误:

ClientError: An error occurred (ValidationException) when calling the RunJobFlow operation: The bid price is invalid. Revise the configuration and resubmit.

我不知道它不喜欢 my_bid_price 变量的什么地方。我试过提交0.50OnDemandPrice - 都作为字符串。还尝试将0.50 作为浮点数。这些都不起作用。但是,当我从字典中完全删除 BidPrice 键时,它确实作为 OnDemandPrice 提交。

我正在使用 boto3 1.12.28 和 botocore 1.22.5。

我错过了什么?我已经简化了我传递的字典,但它仍然产生同样的错误:

config = {
'Applications': [],
'BootstrapActions': [
    {
        'Name': 'bootstrap',
        'ScriptBootstrapAction': {
            'Path': my_bootstrap_path
        }
    }
],
'Configurations': [
    {
        'Classification': 'emrfs-site',
        'Properties': {
            'fs.s3.enableServerSideEncryption': 'true'
        },
        'Configurations': []
    },
    {
        'Classification': 'spark-env',
        'Configurations': [
            {
                'Classification': 'export',
                'Properties': {
                    'PYSPARK_PYTHON': '/usr/bin/python3'
                }
            }
        ]
    }
],
'Instances': {
    'Ec2SubnetIds': my_emr_subnet_ids,
    'EmrManagedMasterSecurityGroup': my_emr_master_sg,
    'EmrManagedSlaveSecurityGroup': my_emr_node_sg,
    'InstanceFleets': [ 
        {
            'Name': 'My Master Node',
            'InstanceFleetType': 'MASTER',
            'InstanceTypeConfigs': [
                { 
                    'BidPrice': my_bid_price,
                    'EbsConfiguration': { 
                        'EbsBlockDeviceConfigs': [ 
                            { 
                                'VolumeSpecification': { 
                                    'SizeInGB': my_core_ebs_size,
                                    'VolumeType': my_core_ebs_volume_type
                                },
                                'VolumesPerInstance': my_core_ebs_volumes
                            }
                        ],
                        'EbsOptimized': True
                    },
                    'InstanceType': my_master_instance_type,
                    'WeightedCapacity': 1
                }
            ],
            'TargetOnDemandCapacity': 1
        },
        {
            'Name': 'My Core Node',
            'InstanceFleetType': 'CORE',
            'InstanceTypeConfigs': [
                { 
                    'BidPrice': my_bid_price,
                    'EbsConfiguration': { 
                        'EbsBlockDeviceConfigs': [ 
                            { 
                                'VolumeSpecification': { 
                                    'SizeInGB': my_core_ebs_size,
                                    'VolumeType': my_core_ebs_volume_type
                                },
                                'VolumesPerInstance': my_core_ebs_volumes
                            }
                        ],
                        'EbsOptimized': True
                    },
                    'InstanceType': my_core_node_instance_type,
                    'WeightedCapacity': 1
                }
            ],
            'TargetSpotCapacity': my_num_core_nodes
        }
    ],
    'KeepJobFlowAliveWhenNoSteps': my_keep_alive,
    'ServiceAccessSecurityGroup': my_emr_access_sg,
},
'JobFlowRole': 'MyJobFlowRole',
'LogUri': my_log_uri,
'Name': my_cluster_name,
'ReleaseLabel': my_release_label,
'ServiceRole': 'MyRole',
'StepConcurrencyLevel': my_step_concurrency,
'Tags': [],
'VisibleToAllUsers': True
}

【问题讨论】:

    标签: python amazon-web-services boto3 amazon-emr


    【解决方案1】:

    要使其正常工作,我需要在提交按需定价的车队时删除 bid_price 键。我将字符串 OnDemandPrice 作为 bid_price 键的值传递,这是 boto3 不喜欢的。

    【讨论】:

      猜你喜欢
      • 2019-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-15
      • 1970-01-01
      • 2022-01-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多