pipelines
pipelines copied to clipboard
container_component parameter check issue
/kind bug
What steps did you take and what happened: i use kfp v2.7.0 and i try to compile my pipeline dsl code
this is my container_component function signature
def whisper(audio: dsl.InputPath(Dataset), model: str, language: str, format: str, output_dir: dsl.OutputPath(Dataset)):
when i compile my code i get some error
Traceback (most recent call last):
File "C:\Users\USER\PycharmProjects\pythonProject\kuberflow\main.py", line 9, in param_type
is not a parameter type. Cannot get ParameterType name.
when i see this document https://kubeflow-pipelines.readthedocs.io/en/latest/source/dsl.html#kfp.dsl.container_component
there is a example that
from kfp.dsl import container_component, ContainerSpec, InputPath, OutputPath, Output
@container_component def my_component( dataset_path: InputPath(Dataset), model: Output[Model], num_epochs: int, output_parameter: OutputPath(str), ): return ContainerSpec( image='gcr.io/my-image', command=['sh', 'my_component.sh'], args=[ '--dataset_path', dataset_path, '--model_path', model.path, '--output_parameter_path', output_parameter, ] )
so i understand container_component can use InputPath class
but
follow error log in found some code in "C:\Users\USER\PycharmProjects\pythonProject\kuberflow\venv\lib\site-packages\kfp\dsl\component_factory.py", line 623,
def make_input_for_parameterized_container_component_function( name: str, annotation: Union[Type[List[artifact_types.Artifact]], Type[artifact_types.Artifact]] ) -> Union[placeholders.Placeholder, container_component_artifact_channel .ContainerComponentArtifactChannel]:
this code check container_component parameter can acceptable
but it only accept artifact_wrapped_in_Input type, artifact_wrapped_in_Output type, OutputPath type and primitive type
so i think basically inputPath can't accepted in container_component but official document example talk inputPath class can acceptable
what is correct?
What did you expect to happen:
Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]
Environment:
- kfp==2.7.0