Skip to content

feat(backend): implement ClearTask and MarkTaskSuccess actions with scope, cache-invalidation, and comments. - #13996

Open
singhshresth26 wants to merge 2 commits into
kubeflow:masterfrom
singhshresth26:feat/task-actions-backend
Open

feat(backend): implement ClearTask and MarkTaskSuccess actions with scope, cache-invalidation, and comments.#13996
singhshresth26 wants to merge 2 commits into
kubeflow:masterfrom
singhshresth26:feat/task-actions-backend

Conversation

@singhshresth26

Copy link
Copy Markdown

Description of your changes:
This PR implements manual, per-task lifecycle controls for in-flight or failed pipeline runs. It adds backend support for scoped Clear (re-run task) and Mark Success (manually override task outcome) actions in coordination with the underlying Argo Workflow engine.

Key Additions:

  1. API Schema (run.proto):
    • Added TaskScope enum (TASK_ONLY, DOWNSTREAM, UPSTREAM, UPSTREAM_DOWNSTREAM).
    • Defined ClearTaskRequest (includes invalidate_cache option) and MarkTaskSuccessRequest (includes mandatory comment field).
    • Added corresponding POST endpoints to RunService (:clear, :marksuccess).
  2. Server Handlers (run_server.go):
    • Implemented server-side endpoints checking retry permission for clearing tasks and update permission for marking success.
    • Validates that comments for manual overrides are non-empty and non-whitespace.
    • Added Prometheus counter metrics tracking request rates.
  3. DAG Resolution & mutations (resource_manager.go):
    • Formulates retries using Argo's native FormulateRetryWorkflow utility, safely preserving output and boundary IDs.
    • Restores unaffected/parent node statuses when executing scoped retries.
    • For Clear: if invalidateCache is enabled, appends the --cache_disabled argument to the task template definition in workflow.Spec so KFP driver bypasses the MLMD execution cache on retry.
    • For Mark Success: updates the target node phases to Succeeded and records the reason/comment in the node's status Message field for an audit trail.
    • Terminates running/pending pods associated with affected tasks to prevent races, resets workflow terminal flags, and notifies dispatcher plugins.
  4. Verification:
    • Added unit tests in run_server_test.go checking validation constraints, cache-invalidation templating, phase updates, and audit comments.

Checklist:

fixes #13883

…cope, cache-invalidation, and comments

Signed-off-by: Shresth Singh <shresthengineer@gmail.com>
@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chensun for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow

Copy link
Copy Markdown

Hi @singhshresth26. Thanks for your PR.

I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Support per-task Clear and Mark Success with upstream/downstream scope (Airflow-like)

1 participant