apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: annotations: pipelines.kubeflow.org/pipeline_spec: '{"name": "artifact_passing_pipeline"}' generateName: artifact-passing-pipeline- spec: arguments: parameters: [] entrypoint: artifact-passing-pipeline serviceAccountName: pipeline-runner templates: - name: artifact-passing-pipeline dag: tasks: - name: consumer template: consumer arguments: parameters: - name: processor-Output-1 value: '{{tasks.processor.outputs.parameters.processor-Output-1}}' - name: processor-Output-2-subpath value: '{{tasks.processor.outputs.parameters.processor-Output-2-subpath}}' dependencies: - processor - name: processor template: processor arguments: parameters: - name: producer-Output-1 value: '{{tasks.producer.outputs.parameters.producer-Output-1}}' - name: producer-Output-2-subpath value: '{{tasks.producer.outputs.parameters.producer-Output-2-subpath}}' dependencies: - producer - name: producer template: producer - name: consumer metadata: annotations: pipelines.kubeflow.org/component_spec: '{"inputs": [{"name": "Input parameter"}, {"name": "Input artifact"}], "name": "Consumer"}' inputs: parameters: - name: processor-Output-1 - name: processor-Output-2-subpath container: image: alpine command: - sh - -c - | echo "Input parameter = $0" echo "Input artifact = " && cat "$1" args: - '{{inputs.parameters.processor-Output-1}}' - /tmp/inputs/Input_artifact/data volumeMounts: - name: data-storage mountPath: /tmp/inputs/Input_artifact readOnly: true subPath: '{{inputs.parameters.processor-Output-2-subpath}}' - name: processor metadata: annotations: pipelines.kubeflow.org/component_spec: '{"inputs": [{"name": "Input parameter"}, {"name": "Input artifact"}], "name": "Processor", "outputs": [{"name": "Output 1"}, {"name": "Output 2"}]}' inputs: parameters: - name: producer-Output-1 - name: producer-Output-2-subpath outputs: parameters: - name: processor-Output-1 valueFrom: path: /tmp/outputs/Output_1/data - name: processor-Output-1-subpath value: artifact_data/{{workflow.uid}}_{{pod.name}}/processor-Output-1 - name: processor-Output-2-subpath value: artifact_data/{{workflow.uid}}_{{pod.name}}/processor-Output-2 container: image: alpine command: - sh - -c - | mkdir -p "$(dirname "$2")" mkdir -p "$(dirname "$3")" echo "$0" > "$2" cp "$1" "$3" args: - '{{inputs.parameters.producer-Output-1}}' - /tmp/inputs/Input_artifact/data - /tmp/outputs/Output_1/data - /tmp/outputs/Output_2/data volumeMounts: - mountPath: /tmp/inputs/Input_artifact name: data-storage readOnly: true subPath: '{{inputs.parameters.producer-Output-2-subpath}}' - mountPath: /tmp/outputs/Output_1 name: data-storage subPath: artifact_data/{{workflow.uid}}_{{pod.name}}/processor-Output-1 - mountPath: /tmp/outputs/Output_2 name: data-storage subPath: artifact_data/{{workflow.uid}}_{{pod.name}}/processor-Output-2 - name: producer metadata: annotations: pipelines.kubeflow.org/component_spec: '{"name": "Producer", "outputs": [{"name": "Output 1"}, {"name": "Output 2"}]}' outputs: parameters: - name: producer-Output-1 valueFrom: path: /tmp/outputs/Output_1/data - name: producer-Output-1-subpath value: artifact_data/{{workflow.uid}}_{{pod.name}}/producer-Output-1 - name: producer-Output-2-subpath value: artifact_data/{{workflow.uid}}_{{pod.name}}/producer-Output-2 container: image: alpine command: - sh - -c - | mkdir -p "$(dirname "$0")" mkdir -p "$(dirname "$1")" echo "Data 1" > $0 echo "Data 2" > $1 args: - /tmp/outputs/Output_1/data - /tmp/outputs/Output_2/data volumeMounts: - mountPath: /tmp/outputs/Output_1 name: data-storage subPath: artifact_data/{{workflow.uid}}_{{pod.name}}/producer-Output-1 - mountPath: /tmp/outputs/Output_2 name: data-storage subPath: artifact_data/{{workflow.uid}}_{{pod.name}}/producer-Output-2 volumes: - name: data-storage persistentVolumeClaim: claimName: data-volume