Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow final status #13967

Open
jiahe0510 opened this issue Dec 4, 2024 · 4 comments
Open

Workflow final status #13967

jiahe0510 opened this issue Dec 4, 2024 · 4 comments
Labels
solution/workaround There's a workaround, might not be great, but exists type/feature Feature request

Comments

@jiahe0510
Copy link

Summary

The current workflow using DAG template will set the skipped task as parent status. Hence if the parent task of the leaf is failed, then the leaf task will be considered as failed. Therefore, the whole workflow will be set as Failed. Handle scenario that set skipped task as succeeded.

Use Cases

Consider we have a DAG that have 3 tasks.
1 ----- 2
|
-------3

The logic is if 1 failed then run 3, if 1 succeeded run 2. Any of 2 or 3 is succeeded, we want the whole workflow as succeeded.


Message from the maintainers:

Love this feature request? Give it a 👍. We prioritise the proposals with the most 👍.

@jiahe0510 jiahe0510 added the type/feature Feature request label Dec 4, 2024
@Joibel
Copy link
Member

Joibel commented Dec 4, 2024

I'm not sure I follow your request well enough. Can you write a workflow we can talk about using enhanced depends and tell us where this doesn't work for you.

@Joibel Joibel added the problem/more information needed Not enough information has been provide to diagnose this issue. label Dec 4, 2024
@jiahe0510
Copy link
Author

I'm not sure I follow your request well enough. Can you write a workflow we can talk about using enhanced depends and tell us where this doesn't work for you.

Thanks for your reply. Here is the workflow I was talking about.

name: test
outputs: {}
metadata: {}
dag:
  tasks:
  - name: task1
    arguments:
      parameters: []
    templateRef:
      name: root
      template: v1
      clusterScope: true
  - name: task2
    arguments:
      parameters: []
    templateRef:
      name: success
      template: v1
      clusterScope: true
    dependencies:
    - task1
    when: "({{tasks.task1.status}}==Failed)"
  - name: task3
    arguments:
      parameters: []
    templateRef:
      name: fail
      template: v1
      clusterScope: true
    dependencies:
    - task1
    when: "({{tasks.task1.status}}==Succeeded)"
  failFast: false

If the root task(task1) is failed, then it will go to the leaf task(task2), and it will success. The workflow now is completed. When calculating the whole workflow status, the task3(skipped task) will be assigned to its parent status, which is failed. Hence, the whole workflow will be assigned to Failed. Is there anyway to count such scenario as succeeded?

@tczhao
Copy link
Member

tczhao commented Dec 5, 2024

you could add a task 4 (simple echo) that depends on 2 or 3 succeeded,
so that task 4 will always execute if 2 or 3 is good, this will make the workflow marked successful

you could try use depends to make the yaml slightly cleaner

@jiahe0510
Copy link
Author

you could add a task 4 (simple echo) that depends on 2 or 3 succeeded, so that task 4 will always execute if 2 or 3 is good, this will make the workflow marked successful

you could try use depends to make the yaml slightly cleaner

Thanks for the suggestion. It seems that it could solve the issue. Though, it make the whole workflow weird. lol

@tczhao tczhao added solution/workaround There's a workaround, might not be great, but exists and removed problem/more information needed Not enough information has been provide to diagnose this issue. labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution/workaround There's a workaround, might not be great, but exists type/feature Feature request
Projects
None yet
Development

No branches or pull requests

3 participants