在 GCP 中,从 UI 或 gcloud 命令安装和运行JupyterHub 组件相当简单。我正在尝试通过 Airflow 和DataprocClusterCreateOperator 编写进程脚本,这里是 DAG 的摘录
from airflow.contrib.operators import dataproc_operator
create_cluster=dataproc_operator.DataprocClusterCreateOperator(
task_id='create-' + CLUSTER_NAME,
cluster_name=CLUSTER_NAME,
project_id=PROJECT_ID,
num_workers=3,
num_masters=1,
master_machine_type='n1-standard-2',
worker_machine_type='n1-standard-2',
master_disk_size=100,
worker_disk_size=100,
storage_bucket='test-dataproc-jupyter',
region='europe-west4',
zone='europe-west4-a',
auto_delete_ttl=21600,
optional_components=['JUPYTER', 'ANACONDA']
)
Run Code Online (Sandbox Code Playgroud)
但是我无法指定所需的enable-component-gateway参数。查看源代码,似乎参数不是有意的(无论是在已弃用的还是 最后一个稳定的运算符中)。
我知道 REST API 提供了endpointConfig.enableHttpPortAccess,但我更愿意使用官方运营商。有谁知道如何实现这一目标?