将多个模板化输入传递到 Argo Workflow 值中
Pass multiple templated inputs into an Argo Workflow value
我在下面写下了 Argo 的工作流程,其中包含一个(基于容器的)模板和一个 DAG。 DAG 应将可变数量的值传递到模板的输入参数中。
这可能吗?
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: do-something
templates:
- name: something
inputs:
parameters:
- name: values
container:
image: some-image
args: ["{{inputs.parameters.values}}"] # This field must be converted to ["1", "3", "6", "9"]
- name: do-something
dag:
tasks:
- name: do-it
template: something
arguments:
parameters:
- name: values
value: [1, 3, 6, 9]
我加注了an issue,这样不行。建议的解决方法是创建一个将字符串解析为列表的层:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: do-something
templates:
- name: something
inputs:
parameters:
- name: values
container:
image: alpine:latest
command: [sh, -c]
args: ["parselist {{inputs.parameters.values}}"]
- name: do-something
dag:
tasks:
- name: do-it
template: something
arguments:
parameters:
- name: values
value: '["1", "3", "6", "9"]'
我在下面写下了 Argo 的工作流程,其中包含一个(基于容器的)模板和一个 DAG。 DAG 应将可变数量的值传递到模板的输入参数中。
这可能吗?
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: do-something
templates:
- name: something
inputs:
parameters:
- name: values
container:
image: some-image
args: ["{{inputs.parameters.values}}"] # This field must be converted to ["1", "3", "6", "9"]
- name: do-something
dag:
tasks:
- name: do-it
template: something
arguments:
parameters:
- name: values
value: [1, 3, 6, 9]
我加注了an issue,这样不行。建议的解决方法是创建一个将字符串解析为列表的层:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: do-something
templates:
- name: something
inputs:
parameters:
- name: values
container:
image: alpine:latest
command: [sh, -c]
args: ["parselist {{inputs.parameters.values}}"]
- name: do-something
dag:
tasks:
- name: do-it
template: something
arguments:
parameters:
- name: values
value: '["1", "3", "6", "9"]'