提交指定集群池的数据块笔记本 运行?

Submitting a databricks notebook run specifying a cluster pool?

我正在提交一次性笔记本作业:

azuredatabricks.net/api/2.0/jobs/runs/submit

$json = @"
{
    "run_name": "integration testing notebook task",
    "existing_cluster_id": "$global:clusterID",
    "timeout_seconds": 3600,
    "notebook_task": {
        "notebook_path": "$global:notebookPath"
    }
}
"@

但是,我希望它使用现有池中的集群,而不是指定现有的集群 ID(我最初必须自己创建)。这怎么可能?该架构似乎不接受此请求的 instance_pool_id。

您需要使用create request with new_cluster instead, and inside its definition指定instance_pool_id,方法与普通集群相同。像这样:

$json = @"
{
    "run_name": "integration testing notebook task",
    "new_cluster": : {
      "spark_version": "7.3.x-scala2.12",
      "node_type_id": "r3.xlarge",
      "aws_attributes": {
        "availability": "ON_DEMAND"
      },
      "num_workers": 10,
      "instance_pool_id": "$global:poolID"
    },
    "timeout_seconds": 3600,
    "notebook_task": {
        "notebook_path": "$global:notebookPath"
    }
}
"@

但这将创建一个集群,其中包含池中的机器,而不是附加到已分配到那里的某个集群。