如何访问在argo中的另一个工作流模板中生成的工作流中的输出



我需要将Argo输出传递回在另一个工作流模板中生成的工作流

所以我有一个名为A的工作流和两个名为BC的工作流模板

当我运行工作流A时,它调用工作流模板B,然后B调用另一个工作流模板C

触发流程如下A -> B -> c

现在,WorkflowTemplateC将输出作为工件生成。我想将这些输出传递回WorkflowTemplateB,并将其传递回WorkflowA。这样我就可以使用该输出作为同一工作流A中另一个任务的输入

输出通过流程应类似C -> B -> A

argo工作流中有什么方法可以做到这一点吗?你能给我举个例子吗?

通过templateRef从另一个WorkflowTemplate调用模板与通过template从同一工作流调用模板的工作原理完全相同。

(注:我写了一篇关于区分Argo工作流中"模板"一词的使用的帖子。(

下面是一个改编自工件传递示例的示例:

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: templates
spec:
templates:
- name: whalesay
container:
image: docker/whalesay:latest
command: [sh, -c]
args: ["cowsay hello world | tee /tmp/hello_world.txt"]
outputs:
artifacts:
- name: hello-art
path: /tmp/hello_world.txt
- name: print-message
inputs:
artifacts:
- name: message
path: /tmp/message
container:
image: alpine:latest
command: [sh, -c]
args: ["cat /tmp/message"]
---
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: artifact-passing-
spec:
entrypoint: artifact-example
templates:
- name: artifact-example
steps:
- - name: generate-artifact
templateRef:
name: templates
template: whalesay
- - name: consume-artifact
templateRef: 
name: templates
template: print-message
arguments:
artifacts:
- name: message
from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}"

最新更新