我想使用自定义列表在 Kubeflow 管道中运行并行操作,并且我想将列表元素的值用于定义操作。我正在尝试这样的事情:
my_list = ['foo', 'bar']
with dsl.ParallelFor(my_list) as item:
op_first = dsl.ContainerOp(
name=f'{item} - First Op',
image=f'gcr.io/...',
arguments=[
...
]
)
...
但我收到这样的错误:
ValueError: Only letters, numbers, spaces, "_", and "-" are allowed in name.
Must begin with letter: {{pipelineparam:op=;name=loop-item-param-103a50f1}} - First Op
我也试过
my_dict = [{'name': 'foo'}, {'name': 'bar'}]
with dsl.ParallelFor(my_list) as item:
name = item.name
op_first = dsl.ContainerOp(
name=f'{name} - First Op',
image=f'gcr.io/...',
arguments=[
...
]
)
...
但我得到一个类似的错误。如何检索项目的“原始”名称?