Repository navigation
ci: create Dataproc clusters with an action that deletes them in its post step - #345
Merged
Merged
Conversation
tnazarew
marked this pull request as ready for review
October 21, 2026 20:29
tnazarew
force-pushed
the
ci/dataproc-cluster-action
branch
from
October 21, 2026 20:29
7fd9f0b to
105f889
Compare
…post step The spark and hive dataproc workflows ran the producer step with continue-on-error, terminated the cluster in an always() step and then failed the job in a separate step, because composite actions can't have post steps. The new dataproc_cluster action creates the cluster with the given command and deletes it in its post step, which runs after all other steps whatever their result, so the producer step can just fail. The action uses only Node built-ins, so there is nothing to install or bundle. The cluster name is saved before creating, so a cluster left behind by a failed create is deleted too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: tnazarew <[email protected]>
tnazarew
force-pushed
the
ci/dataproc-cluster-action
branch
from
October 21, 2026 21:32
105f889 to
389af25
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The spark and hive Dataproc workflows clean up their cluster with a workaround:
continue-on-erroralways()stepAll this because composite actions can't have post steps, as the workflow's own comment explains. This replaces that with a small JavaScript action that has a post step.
.github/actions/dataproc_clustercreate-command. Saving first means the post step also deletes a cluster left behind by a failed create.post-if: always()): runs after all other steps of the job, whatever their result. If the cluster exists, it deletes it withgcloud dataproc clusters delete. Post steps run in reverse order, so it runs before the GCP auth step removes its credentials.Usage:
Workflow changes
producer_hive_dataproc.yml: "Start producer" now uses the action, with the create command unchanged. Removedcontinue-on-error, "Terminate producer cluster" and "Fail if hive jobs failed". A failing producer step now fails the job directly, and the cluster is still deleted.producer_spark_dataproc.yml(as reworked in spark_dataproc: one cluster per Spark version for all OpenLineage versions #344): "Start producer" now uses the action, and thealways()"Terminate producer cluster" step is removed. spark_dataproc: one cluster per Spark version for all OpenLineage versions #344 had already droppedcontinue-on-errorand the "Fail if" step there.Relation to other PRs
Testing
main_pr.ymlstarts them only when a path underproducer/spark_dataproc/orproducer/hive_dataproc/changes, and this PR changes only.github/.producer_hive_dataproc.ymlbuilds the report name frominputs.hive_release, which isn't an input of that workflow. It's not changed here.🤖 Generated with Claude Code