I'd like to use a custom list to run parallel Ops in a Kubeflow Pipeline, and I want to use the value of the element of the list into the definition of the Op. I'm trying something like this:
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=[
...
]
)
...
But I'm getting an error like this:
ValueError: Only letters, numbers, spaces, "_", and "-" are allowed in name.
Must begin with letter: {{pipelineparam:op=;name=loop-item-param-103a50f1}} - First Op
I've also tried
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=[
...
]
)
...
But i get a similar error. How can I retrieve the "original" name of the item?