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

fix: Fail DAG templates with variables with invalid dependencies #4992

Merged
merged 2 commits into from Feb 3, 2021

Conversation

changhc
Copy link
Contributor

@changhc changhc commented Feb 2, 2021

This PR fixes #2314 . It was closed since I didn't create the PR in time.

Actually a test case for this issue already exists, but the fixture was set up incorrectly such that the test didn't capture this issue.

Tested locally for both artifacts and parameters with the following sample:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: output-parameter-
spec:
  entrypoint: abc
  templates:
  - name: abc
    dag:
      tasks:
        - name: generate-parameter
          template: whalesay
        - name: consume-parameter
          template: print-message
          dependencies: ["generate-parameter"]
          arguments:
            parameters:
            - name: message
              value: "{{tasks.generate-parameter.outputs.parameters.hello-param}}"
            artifacts:
            - name: message2
              from: "{{tasks.generate-parameter.outputs.artifacts.hello-art}}"
  - name: whalesay
    container:
      image: docker/whalesay:latest
      command: [sh, -c]
      args: ["sleep 1; echo -n hello world > /tmp/hello_world.txt"]
    outputs:
      parameters:
      - name: hello-param
        valueFrom:
          path: /tmp/hello_world.txt
      artifacts:
      - name: hello-art
        path: /tmp/hello_world.txt
  - name: print-message
    inputs:
      parameters:
      - name: message
    container:
      image: docker/whalesay:latest
      command: [cowsay]
      args: ["{{inputs.parameters.message}}"]

Commenting out dependencies: ["generate-parameter"] raises an error like this:
Failed to submit workflow: templates.abc.tasks.consume-parameter missing dependency 'generate-parameter' for parameter 'message'

But this sample indicates another issue: template print-message does not accept input artifacts, but argo does not throw an error when parsing the definition of task consume-parameter. Should this be fixed as well?

Checklist:

@changhc changhc changed the title fix: Fail templates with unresolved variables fix: Fail DAG templates with variables with invalid dependencies Feb 2, 2021
@simster7 simster7 self-assigned this Feb 2, 2021
@simster7
Copy link
Member

simster7 commented Feb 2, 2021

Reopened issue, will take a look at this today

@simster7
Copy link
Member

simster7 commented Feb 2, 2021

Please make sure you sign your commits according to https://github.com/argoproj/argo/pull/4992/checks?check_run_id=1813331712

Signed-off-by: Huan-Cheng Chang <changhc84@gmail.com>
Signed-off-by: Huan-Cheng Chang <changhc84@gmail.com>
@changhc
Copy link
Contributor Author

changhc commented Feb 2, 2021

Sorry about messing up the commits. It should have been fixed now.

@simster7
Copy link
Member

simster7 commented Feb 3, 2021

But this sample indicates another issue: template print-message does not accept input artifacts, but argo does not throw an error when parsing the definition of task consume-parameter. Should this be fixed as well?

Sure, why not

Copy link
Member

@simster7 simster7 left a comment

Choose a reason for hiding this comment

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

LGTM

@simster7 simster7 merged commit 5047f07 into argoproj:master Feb 3, 2021
@simster7 simster7 mentioned this pull request Feb 8, 2021
38 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reference to task A's output param not resolved if task B does not depend on task A
2 participants