argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
15.11k stars 3.21k forks source link

Enhanced depends logic not working with omitted dag task #10321

Open jordantshaw opened 1 year ago

jordantshaw commented 1 year ago

Pre-requisites

What happened/what you expected to happen?

When a DAG task is Skipped/Omitted the dependent task does not run.

  O
 /  \
A    B <- B is skipped
|    |
C    D <- D gets omitted
     |
     E  <- (D.Succeeded || D.Omitted || D.Skipped)

In this scenario I would expect E to still run, but it doesnt.

Version

v3.4.3

Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  name: broken-depends
  generateName: broken-depends-
  namespace: argo
spec:
  entrypoint: main
  templates:
    - name: main
      inputs:
        parameters:
          - name: input_var
            default: 'true'
      dag:
        tasks:
          - name: A
            template: pass
          - name: B
            template: pass
            when: '{{ inputs.parameters.input_var }} == false'
          - name: C
            template: pass
            depends: A.Succeeded
          - name: D
            template: pass
            depends: B.Succeeded
          - name: E
            template: pass
            depends: (D.Succeeded || D.Omitted || D.Skipped)
    - name: pass
      container:
        image: 'alpine:3.7'
        command:
          - sh
          - '-c'
          - exit 0
    - name: fail
      container:
        image: 'alpine:3.7'
        command:
          - sh
          - '-c'
          - exit 1

Logs from the workflow controller

kubectl logs -n argo deploy/workflow-controller | grep ${workflow}

Logs from in your workflow's wait container

kubectl logs -n argo -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded
tahiraha commented 1 year ago

Running into this as well, but adding the Omitted state in the depends logic prevents the whole workflow from kicking off. When I use "task.Omitted" in a DAG with enhanced depends logic, I get this error Failed: invalid spec: templates.build.tasks.log task result 'Omitted' for task 'C' is invalid. Here is my depends logic: C || C.Failed || C.Errored || C.Omitted

When I try to run @jordantshaw workflow from the UI, I get this Internal Server Error: templates.main.tasks.E task result 'Omitted' for task 'D' is invalid


Found a workaround: #4527


Not running on :latest, running version 3.3.2 of Argo. Sorry if this comment isn't entirely relevant to current state!

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is a mentoring request, please provide an update here. Thank you for your contributions.

jordantshaw commented 1 year ago

Bumping as this is still an issue

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.