我有如下所述的 Argo DAG 示例。如下所示,我对每个任务的参数值进行了硬编码。每个任务使用不同的参数值。我知道 Argo 提供了一种以 JSON 或 YAML 格式提交参数文件以动态传递参数值的方法。但是,我想知道是否有一种方法可以通过参数文件为下面 DAG 中的每个任务传递不同的值。
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-diamond-custom-
spec:
entrypoint: diamond
templates:
- name: echo
retryStrategy:
limit: 3
inputs:
parameters:
- name: message
- name: task
container:
image: index_ruby:latest
imagePullPolicy: Never
command: [ruby, "index.rb", "-s" , "{{inputs.parameters.task}}" , "-r", "{{inputs.parameters.message}}"]
- name: diamond
dag:
tasks:
- name: A
template: echo
arguments:
parameters:
- name: message
value: |
{"key": "valueA"}
- name: task
value: A
- name: B
dependencies: [A]
template: echo
arguments:
parameters:
- name: message
value: |
{"key": "valueB"}
- name: task
value: B
- name: C
dependencies: [A]
template: echo
arguments:
parameters:
- name: message
value: |
{"key": "valueC"}
- name: task
value: C
- name: D
dependencies: [B, C]
template: echo
arguments:
parameters:
- name: message
value: |
{"key": "valueD"}
- name: task
value: D