Skip to content

Instantly share code, notes, and snippets.

@WeiTang114
Last active November 10, 2018 17:51
Show Gist options
  • Save WeiTang114/ed3813ea801180c3cf860a3caa42eac9 to your computer and use it in GitHub Desktop.
Save WeiTang114/ed3813ea801180c3cf860a3caa42eac9 to your computer and use it in GitHub Desktop.
global-artifact-passing.yaml
# This example shows that the consume-artifact steps in the loop will
# wrongly get "AAA" as global-art output, while it should get "BBB" and
# "CCC" which are generated by loop-echo later than "AAA" generated by
# generate-artifact-A.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: global-artifact-passing-
spec:
entrypoint: global-artifact-example
templates:
- name: global-artifact-example
parallelism: 1
steps:
- - name: generate-artifact-A
template: echo
arguments:
parameters:
- name: msg
value: "AAA"
- - name: loop
template: loop
arguments:
parameters:
- name: msg
value: "{{item}}"
withItems:
- "BBB"
- "CCC"
- name: loop
inputs:
parameters:
- name: msg
steps:
- - name: loop-echo
template: echo
arguments:
parameters:
- name: msg
value: "{{inputs.parameters.msg}}"
- - name: consume-artifact
template: print-message
arguments:
artifacts:
- name: my-art
from: "{{workflow.outputs.artifacts.global-art}}"
- name: echo
inputs:
parameters:
- name: msg
container:
image: alpine:latest
command: [sh, -c]
args: ["echo {{inputs.parameters.msg}} | tee /tmp/echo.txt"]
outputs:
artifacts:
- name: echo-art
path: /tmp
globalName: global-art
- name: print-message
inputs:
artifacts:
- name: my-art
path: /tmp
container:
image: alpine:latest
command: [sh, -c]
args: ["cat /tmp/echo.txt"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment