Kubeflow管道中的ParallelFor

时间:2020-11-02 16:03:28

标签: kubeflow kubeflow-pipelines

我想使用自定义列表在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=[
            ...
        ]
    )
    ...

但是我得到了类似的错误。如何获取商品的“原始”名称?

0 个答案:

没有答案