Skip to content

Add pipeline run stop support for Vertex AI orchestrator#4604

Closed
martinpanacek789 wants to merge 1 commit intozenml-io:developfrom
martinpanacek789:feat/vertex-stop-run
Closed

Add pipeline run stop support for Vertex AI orchestrator#4604
martinpanacek789 wants to merge 1 commit intozenml-io:developfrom
martinpanacek789:feat/vertex-stop-run

Conversation

@martinpanacek789
Copy link
Copy Markdown

Summary

  • Implements _stop_run() on VertexOrchestrator, enabling users to stop running Vertex AI pipeline runs via CLI (zenml pipeline runs stop) or the dashboard
  • Handles both static pipelines (PipelineJob.cancel()) and dynamic pipelines (CustomJob.cancel())
  • Follows the same pattern as the existing Kubernetes orchestrator implementation
  • No new dependencies, schema changes, or migrations needed — all infrastructure (CLI, API endpoint, status mapping) already exists

Test plan

  • mypy passes on the changed file
  • bash scripts/format.sh produces no changes
  • Unit tests added and passing (graceful stop, forceful static, forceful dynamic, missing run ID)
  • Test stopping a static Vertex AI pipeline run (PipelineJob) on live environment
  • Test stopping a dynamic Vertex AI pipeline run (CustomJob) on live environment
  • Verify dashboard stop button appears and works for Vertex AI runs

🤖 Generated with Claude Code

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 13, 2026

CLA assistant check
All committers have signed the CLA.

Implement _stop_run() on VertexOrchestrator, enabling users to stop
running pipeline runs via CLI or dashboard. Handles both static
(PipelineJob) and dynamic (CustomJob) pipelines by calling the
appropriate Google Cloud cancel API. Add tests for graceful stop,
forceful stop (static and dynamic), and missing run ID error case.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines +858 to +863
if graceful:
logger.info(
"Graceful stop requested - letting the Vertex AI pipeline "
"finish naturally."
)
return
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should work, but only as long as step heartbeat is enabled. So we might need to check for that here, and fail if it's not as otherwise I don't think we can gracefully shut down on vertex. This is something that @bcdurak can confirm maybe.

Comment on lines +865 to +868
if METADATA_ORCHESTRATOR_RUN_ID in run.run_metadata:
run_id = run.run_metadata[METADATA_ORCHESTRATOR_RUN_ID]
elif run.orchestrator_run_id is not None:
run_id = run.orchestrator_run_id
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should usually be fine (as in, they should be the same value), but it runs the risk that some users (on purpose or accidentally) modify the orchestrator run ID in the metadata.

For that reason, I would suggest we swap these conditions around and use the run.orchestrator_run_id as the primary source of truth if it exists.

@schustmi schustmi added the release-notes Release notes will be attached and used publicly for this PR. label Mar 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ This PR has been inactive for 2 weeks and has been marked as stale.
Timeline:

  • Week 2 (now): First reminder - PR marked as stale
  • Week 4: PR will be automatically closed if no activity
    Please update this PR or leave a comment to keep it active. Any activity will reset the timer and remove the stale label.

@github-actions github-actions Bot added the stale label Mar 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔒 This PR has been automatically closed due to 4 weeks of inactivity.
If you'd like to continue working on this, please feel free to reopen it. We're happy to help you get it merged!

@github-actions github-actions Bot closed this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes Release notes will be attached and used publicly for this PR. stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants