【问题标题】:How to specify pre-emptible SPOT VMs in Airflow cluster creation operator如何在 Airflow 集群创建操作符中指定抢占式 SPOT 虚拟机
【发布时间】:2022-12-20 00:44:29
【问题描述】:

通过 GCP 控制台或 GCP API 创建集群提供了一个选项来指定辅助 workers[SPOT, pre-emptible or non-preemptible]。但是,在通过 AirFlow operator 创建集群时,无法找到相应的 CLUSTER_CONFIG 来使用。默认情况下,辅助工作程序是可抢占的,而不是 SPOT VM。 附上用户界面截图 Airflow 辅助工作节点配置。

"secondary_worker_config": {
        "num_instances": 5,
        "machine_type_uri": SOME_MACHINE_TYPE,
        "disk_config": {"boot_disk_type": "pd-standard", "boot_disk_size_gb": 1024},
        "image_uri" : SOME_IMAGE_URI
    }

需要关于 Airflow 辅助工作负载更改的建议以创建 SPOT 工作人员。

【问题讨论】:

    标签: airflow google-cloud-dataproc


    【解决方案1】:

    使用preemptibility参数:

    "secondaryWorkerConfig": {
        "numInstances": "2",
        "machineTypeUri": "n1-standard-4",
        "diskConfig": {
          "bootDiskType": "pd-standard",
          "bootDiskSizeGb": 500
        },
        "preemptibility": "SPOT"
    }
    

    【讨论】:

    • @NehaRanjan 但 Airflow DataprocCreateClusterOperator 运算符使用相同的 API,因此您可以在 cluster_config 参数中传递此配置。见create-a-cluster
    • 寻找气流有效载荷,dataproc api 已经在为我工作。下面是气流配置 "secondary_worker_config": { "num_instances": 5, "machine_type_uri": SOME_MACHINE_TYPE, "disk_config": {"boot_disk_type": "pd-standard", "boot_disk_size_gb": 1024}, "image_uri": SOME_IMAGE_URI, “preemptibility”:“SPOT”} ValueError:未知枚举标签“Spot”
    • 收到错误:ValueError:未知枚举标签“Spot”..它与版本有关吗?
    • 这是我的配置.. CLUSTER_CONFIG = {"master_config": {"num_instances": 1,"machine_type_uri": MACHINE_TYPE,"disk_config": {"boot_disk_type": "pd-standard", "boot_disk_size_gb": 1024},"image_uri ":IMAGE_URI},"worker_config":{"num_instances":10,"machine_type_uri":MACHINE_TYPE,"disk_config":{"boot_disk_type":"pd-standard","boot_disk_size_gb":1024},"image_uri":IMAGE_URI} “secondary_worker_config”:{“num_instances”:5,“machine_type_uri”:MACHINE_TYPE,“disk_config”:{“boot_disk_type”:“pd-standard”,“boot_disk_size_gb”:1024},“image_uri”:IMAGE_URI,“preemptibility”: “点”}}
    猜你喜欢
    • 2020-02-20
    • 1970-01-01
    • 1970-01-01
    • 2019-07-27
    • 2016-10-17
    • 2020-05-19
    • 2019-01-23
    • 1970-01-01
    • 2019-05-06
    相关资源
    最近更新 更多