Skip to content

cluster config generation using cluster config YAML file. #17089

Open

Description

@iostreamdoth

Description

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.

Activity

  1. boring-cyborg commented on Jul 19, 2021

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template!

  2. potiuk commented on Jul 19, 2021

    @potiuk
    Member

    Feel free to make a PR!

  3. mik-laj commented on Jul 19, 2021

    @mik-laj
    Member

    config generator

    DataprocCreateClusterOperatorClusterGenerator class is a deprecated and we are not adding new features to it.

    I think we can extend DataprocCreateClusterOperator to accept the file path in cluster_config parameter like Cloud Build operator.

    :param body: The build config with instructions to perform with CloudBuild.
    Can be a dictionary or path to a file type like YAML or JSON.
    See: https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds
    :type body: dict or string

  4. iostreamdoth commented on Jul 19, 2021

    @iostreamdoth
    ContributorAuthor

    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

  5. mik-laj commented on Jul 19, 2021

    @mik-laj
    Member

    @iostreamdoth ClusterGenerator from providers is legacy/deprecated method to generate dataproc cluster configuration. You should use cluster_config parameter. For details, see:

    "Passing cluster parameters by keywords to `{}` "
    "will be deprecated. Please provide cluster_config object using `cluster_config` parameter. "
    "You can use `airflow.dataproc.ClusterGenerator.generate_cluster` method to "
    "obtain cluster object.".format(type(self).__name__),
    DeprecationWarning,
    stacklevel=1,
    )

  6. iostreamdoth commented on Jul 19, 2021

    @iostreamdoth
    ContributorAuthor

    Got it, I got confused with the Operator name earlier.
    Thanks @mik-laj

  7. eladkal commented on Nov 28, 2021

    @eladkal
    Contributor

    @iostreamdoth do you plan to finish the stale PR?

  8. jbbqqf commented on May 22, 2026

    @jbbqqf
    Contributor

    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:

    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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions