Closed fbpo23 closed 11 months ago
It seems that while InputPath does not work, we can simply use the Input class, like in the snippet below
from kfp.dsl import Input, Output, Dataset
@dsl.container_component
def create_dataset(dataset: Output[Dataset]):
return dsl.ContainerSpec(
image='alpine:3.18.2',
command=['sh', '-c', '''echo "I am data" > $0'''],
args=[dataset.path])
@dsl.container_component
def debug_info(dataset: Input[Dataset]):
return dsl.ContainerSpec(
image='alpine:3.18.2',
command=['echo'],
args=[dataset.path])
@dsl.pipeline(
name='test-pipeline', description='Some pipeline')
def demo_pipeline():
dataset_task = create_dataset()
debug_info(dataset=dataset_task.output)
I'll consider this issue solved!
Environment
Steps to reproduce
I'm trying to setup a pipeline using container components, but the InputPath seems to not be working correctly with them. In this code snippet:
It all compiles correctly with no problems. However by switching to container_component in this snippet:
The pipeline no longer compiles and it gives me the error:
This is weird because I kept the exact same function signature in both snippets, the real only thing that changed was I used container_components instead of components. Can someone help me out with this?
Expected result
Compilation with no issues.
Impacted by this bug? Give it a 👍.