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

Wrong order of DAG tasks may appear after sortDAGTasks when using Depends instead of Dependencies #6306

Closed
book987 opened this issue Jul 8, 2021 · 2 comments · Fixed by #6307
Labels

Comments

@book987
Copy link
Contributor

book987 commented Jul 8, 2021

Summary

What happened/what you expected to happen?

Running workflow belows may(about 12% chance to reproduce on my environment) got an error said 'invalid spec: templates.main.tasks.C templates.C-template: failed to resolve {{workflow.outputs.parameters.globalResult}}'

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: sort-dag-tasks-test-
  namespace: argo
spec:
  entrypoint: main
  templates:
    - dag:
        tasks:
          - name: A
            template: A-template
          - depends: A
            name: B
            template: B-template
          - depends: B.Succeeded || B.Failed || B.Errored
            name: C
            template: C-template
      name: main
    - name: A-template
      container:
        args:
          - echo "A instance" >/data/result
        command:
          - sh
          - -c
        image: alpine:latest
      outputs:
        parameters:
          - name: result
            globalName: globalResult
            valueFrom:
              default: ""
              path: /data/result
    - name: B-template
      container:
        args:
          - echo "B instance"
        command:
          - sh
          - -c
        image: alpine:latest
    - name: C-template
      container:
        args:
          - echo "{{workflow.outputs.parameters.globalResult}}"
        command:
          - sh
          - -c
        image: alpine:latest

Diagnostics

sortDAGTasks didn't support using Depends

TopologicalSorting is not stable cause it use map inside, thus this bug cannot reproduce stably

What Kubernetes provider are you using?
self host, k3d

What version of Argo Workflows are you running?
v3.1.1

What executor are you running? Docker/K8SAPI/Kubelet/PNS/Emissary
docker

Did this work in a previous version? I.e. is it a regression?
same on v3.0.7, v3.0.8

Are you pasting thousands of log lines? That's too much information.


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

@book987
Copy link
Contributor Author

book987 commented Jul 8, 2021

I'll submit a PR, make sortDAGTasks supports Depends.
Leaves you another one for discuss first, is argo accept unpredicted behaviors like this? a bug cannot stably reproduce
@alexec @terrytangyuan

@book987
Copy link
Contributor Author

book987 commented Jul 20, 2021

Closed, #6307

@book987 book987 closed this as completed Jul 20, 2021
@alexec alexec linked a pull request Jul 27, 2021 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant