In GCP it is fairly simply to install and run a JupyterHub component from the UI or the gcloud command. I'm trying to script the processus through Airflow and the DataprocClusterCreateOperator, here an extract of the 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']
)
However I can not managed to specifify the needed enable-component-gateway
parameter. Looking at the source code, it seems the parameters is not intended (both in the deprecated or the last stable operator).
I know the REST API provides the endpointConfig.enableHttpPortAccess
, but I would rather use the official operator.
Does anyone has an idea how to achieved that?