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

Unable to resolve artifact when dag/tasks includes withItems parameter #1625

Closed
Itfly opened this issue Sep 26, 2019 · 7 comments
Closed

Unable to resolve artifact when dag/tasks includes withItems parameter #1625

Itfly opened this issue Sep 26, 2019 · 7 comments
Labels
area/artifacts S3/GCP/OSS/Git/HDFS etc area/looping `withParams`, `withItems`, and `withSequence` solution/superseded This PR or issue has been superseded by another one (slightly different from a duplicate) type/bug

Comments

@Itfly
Copy link

Itfly commented Sep 26, 2019

Is this a BUG REPORT or FEATURE REQUEST?:
Not sure, I guess this is a bug
What happened:
I use a DAG template with two tasks, one task with withItems parameter and outputs text to artifact, and second one use this artifact as input. However, the second task is failed with error
Unable to resolve: {{tasks.generate-artifact.outputs.artifacts.hello-art}}.

I also use a globalName in artifact, in this case the second task gets not content.

Here's my yaml file:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: artifact-passing-
spec:
  entrypoint: artifact-example
  templates:
  - name: artifact-example
    parallelism: 4
    dag:
      tasks:
      - name: generate-artifact
        template: whalesay
        arguments:
          parameters:
          - name: message
            value: "{{item}}"
        withItems: [0,1,2]

      - name: consume-artifact
        dependencies: [generate-artifact]
        template: print-message
        arguments:
          artifacts:
          - name: message
            #from: "{{tasks.generate-artifact.outputs.artifacts.hello-art}}"
            from: "{{workflow.outputs.artifacts.my-global-art}}"

  - name: whalesay
    inputs:
      parameters:
      - name: message
    container:
      image: docker/whalesay:latest
      command: [bash, -c]
      args: ["sleep 1; if [ {{inputs.parameters.message}} == '0' ]; then cowsay hello world | tee /tmp/hello_world.txt; fi"]
      #args: ["sleep 1; cowsay hello world {{inputs.parameters.message}}| tee /tmp/hello_world.txt"]
    outputs:
      artifacts:
      - name: hello-art
        path: /tmp/hello_world.txt
        optional: true
        globalName: my-global-art

  - name: print-message
    inputs:
      artifacts:
      - name: message
        path: /tmp/message
    container:
      image: alpine:latest
      command: [sh, -c]
      args: ["cat /tmp/message"]

What you expected to happen:
The next task can read the artifact from previous task's output artifact

How to reproduce it (as minimally and precisely as possible):
Run the yaml file

Anything else we need to know?:

Environment:

  • Argo version:
2.3.0
  • Kubernetes version :
clientVersion:
  buildDate: "2019-08-05T16:54:35Z"
  compiler: gc
  gitCommit: f6278300bebbb750328ac16ee6dd3aa7d3549568
  gitTreeState: clean
  gitVersion: v1.15.2
  goVersion: go1.12.7
  major: "1"
  minor: "15"
  platform: darwin/amd64
serverVersion:
  buildDate: "2019-08-05T09:15:22Z"
  compiler: gc
  gitCommit: f6278300bebbb750328ac16ee6dd3aa7d3549568
  gitTreeState: clean
  gitVersion: v1.15.2
  goVersion: go1.12.5
  major: "1"
  minor: "15"
  platform: linux/amd64
@simster7
Copy link
Member

simster7 commented Oct 7, 2019

Checking this

@simster7 simster7 removed their assignment Nov 27, 2019
@madhuresh04
Copy link

@simster7 any update on this?

@simster7
Copy link
Member

simster7 commented Jan 6, 2020

This should be resolved in 2.4.3. Could you please check? If the issue still exists please reopen.

@simster7 simster7 closed this as completed Jan 6, 2020
@Itfly
Copy link
Author

Itfly commented Jan 9, 2020

@simster7 The issue is resolved in v2.4.3 if i use global artifiacts. However it still can not resolve artifact without globalName field. Here's workflow yaml content:

# This example demonstrates the ability to pass artifacts
# from one step to the next.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: artifact-passing-
spec:
  entrypoint: artifact-example
  templates:
  - name: artifact-example
    parallelism: 4
    dag:
      tasks:
      - name: generate-artifact
        template: whalesay
        arguments:
          parameters:
          - name: message
            value: "{{item}}"
        withItems: [0,1,2]

      - name: consume-artifact
        dependencies: [generate-artifact]
        template: print-message
        arguments:
          artifacts:
          - name: message
            from: "{{tasks.generate-artifact.outputs.artifacts.hello-art}}"
            #from: "{{workflow.outputs.artifacts.my-global-art}}"

  - name: whalesay
    inputs:
      parameters:
      - name: message
    container:
      image: docker/whalesay:latest
      command: [bash, -c]
      args: ["sleep 1; if [ {{inputs.parameters.message}} == '0' ]; then cowsay hello world | tee /tmp/hello_world.txt; fi"]
      #args: ["sleep 1; cowsay hello world {{inputs.parameters.message}}| tee /tmp/hello_world.txt"]
    outputs:
      artifacts:
      - name: hello-art
        path: /tmp/hello_world.txt
        optional: true
        #globalName: my-global-art

  - name: print-message
    inputs:
      artifacts:
      - name: message
        path: /tmp/message
    container:
      image: alpine:latest
      command: [sh, -c]
      args: ["cat /tmp/message"]
      #args: ["ls /tmp/message"]

The second task gets error with message Unable to resolve: {{tasks.generate-artifact.outputs.artifacts.hello-art}}.

@chenbodeng719
Copy link

chenbodeng719 commented Jun 29, 2022

@Itfly Do you solve it? I get the error sometimes. It's weird.

image

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: artifact-passing-
spec:
  entrypoint: artifact-example
  templates:
  - name: artifact-example
    steps:
    - - name: generate-artifact
        template: whalesay
    - - name: consume-artifact
        template: print-message
        arguments:
          artifacts:
          # bind message to the hello-art artifact
          # generated by the generate-artifact step
          - name: message
            from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}"
  - name: whalesay
    container:
      image: docker/whalesay:latest
      command: [sh, -c]
      args: ["cowsay hello world | tee /tmp/hello_world.txt"]
      volumeMounts:
        - name: out
          mountPath: /tmp
    volumes:
      - name: out
        emptyDir: { }
    outputs:
      artifacts:
      # generate hello-art artifact from /tmp/hello_world.txt
      # artifacts can be directories as well as files
      - name: hello-art
        path: /tmp/hello_world.txt

  - name: print-message
    inputs:
      artifacts:
      # unpack the message input artifact
      # and put it at /tmp/message
      - name: message
        path: /tmp/message
    container:
      image: alpine:latest
      command: [sh, -c]
      args: ["cat /tmp/message"]

@davidghiurco
Copy link

davidghiurco commented Jul 29, 2022

I still get this exact problem in Argo v3.3.8.

Should this issue be re-opened?

EDIT: I guess discussion is ongoing in #6805

@agilgur5 agilgur5 added area/artifacts S3/GCP/OSS/Git/HDFS etc area/looping `withParams`, `withItems`, and `withSequence` solution/superseded This PR or issue has been superseded by another one (slightly different from a duplicate) labels Oct 22, 2024
@agilgur5
Copy link

EDIT: I guess discussion is ongoing in #6805

Marking this as superseded as such

@argoproj argoproj locked as resolved and limited conversation to collaborators Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/artifacts S3/GCP/OSS/Git/HDFS etc area/looping `withParams`, `withItems`, and `withSequence` solution/superseded This PR or issue has been superseded by another one (slightly different from a duplicate) type/bug
Projects
None yet
Development

No branches or pull requests

7 participants