You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cluster config generation using cluster config YAML file. #17089
Add cluster config generation from yaml file which is generated using gcloud dataproc clusters export command.
Use case / motivation
We are generating quite a lot of clusters using a cluster config which keeps on changing depending upon project to project. I wrote custom operator which reads yaml config and converts it to dict and then uses the same config to genreate cluster. Wondering if it will be useful if cluster config generator operator can accept a yaml config or can create a new operator.
Are you willing to submit a PR?
I do have a working code for converting yaml stored on gcs to dict.
Related Issues
There is no issue as such, it is a functionality which allows users to specify cluster config as yaml file.
you mean airflow.providers.google.cloud.operators.dataproc.DataprocCreateClusterOperator or you mean airflow.contrib.operators.dataproc_operator.DataprocClusterCreateOperator ? I thought this is going to be in providers package. @mik-laj
@iostreamdoth ClusterGenerator from providers is legacy/deprecated method to generate dataproc cluster configuration. You should use cluster_config parameter. For details, see:
Hi! Triaging older issues — I think this one may be answerable with the existing API, and could potentially be closed.
The use case described (loading a YAML-exported Dataproc cluster config and feeding it to DataprocCreateClusterOperator) is already supported via the cluster_config parameter, which accepts a dict shaped like the google.cloud.dataproc_v1.types.ClusterConfig protobuf message:
The original reporter acknowledged this back in 2021 ("Got it, I got confused with the Operator name earlier") after @mik-laj pointed out cluster_config was the recommended path.
In practice this means a gcloud dataproc clusters export ... > cfg.yaml output can be loaded with yaml.safe_load(...) in the DAG file and passed directly to cluster_config=... — no dedicated YAML-loading operator needed.
If I'm missing something (a YAML-specific feature beyond what dict-via-yaml.safe_load covers, or a deprecation I haven't spotted), happy to dig further. Otherwise this looks closeable.
(Disclosure: I drafted this comment with help from Claude Code while triaging stale issues; the references above were verified manually against the current main branch.)
Activity
boring-cyborg commentedon Jul 19, 2021
Thanks for opening your first issue here! Be sure to follow the issue template!
potiuk commentedon Jul 19, 2021
Feel free to make a PR!
mik-laj commentedon Jul 19, 2021
DataprocCreateClusterOperatorClusterGenerator class is a deprecated and we are not adding new features to it.I think we can extend
DataprocCreateClusterOperatorto accept the file path incluster_configparameter like Cloud Build operator.airflow/airflow/providers/google/cloud/operators/cloud_build.py
Lines 172 to 175 in d268016
iostreamdoth commentedon Jul 19, 2021
you mean
airflow.providers.google.cloud.operators.dataproc.DataprocCreateClusterOperatoror you meanairflow.contrib.operators.dataproc_operator.DataprocClusterCreateOperator? I thought this is going to be in providers package.@mik-laj
mik-laj commentedon Jul 19, 2021
@iostreamdoth ClusterGenerator from providers is legacy/deprecated method to generate dataproc cluster configuration. You should use
cluster_configparameter. For details, see:airflow/airflow/providers/google/cloud/operators/dataproc.py
Lines 553 to 559 in 026ffe6
iostreamdoth commentedon Jul 19, 2021
Got it, I got confused with the Operator name earlier.
Thanks @mik-laj
eladkal commentedon Nov 28, 2021
@iostreamdoth do you plan to finish the stale PR?
jbbqqf commentedon May 22, 2026
Hi! Triaging older issues — I think this one may be answerable with the existing API, and could potentially be closed.
The use case described (loading a YAML-exported Dataproc cluster config and feeding it to
DataprocCreateClusterOperator) is already supported via thecluster_configparameter, which accepts adictshaped like thegoogle.cloud.dataproc_v1.types.ClusterConfigprotobuf message:providers/google/src/airflow/providers/google/cloud/operators/dataproc.py#L602-L605— docstring: "If a dict is provided, it must be of the same form as the protobuf message ClusterConfig".providers/google/src/airflow/providers/google/cloud/operators/dataproc.py#L656— signature:cluster_config: dict | Cluster | None = None.cluster_configwas the recommended path.In practice this means a
gcloud dataproc clusters export ... > cfg.yamloutput can be loaded withyaml.safe_load(...)in the DAG file and passed directly tocluster_config=...— no dedicated YAML-loading operator needed.If I'm missing something (a YAML-specific feature beyond what
dict-via-yaml.safe_loadcovers, or a deprecation I haven't spotted), happy to dig further. Otherwise this looks closeable.(Disclosure: I drafted this comment with help from Claude Code while triaging stale issues; the references above were verified manually against the current
mainbranch.)