kfp-tekton
kfp-tekton copied to clipboard
Unable to return values in KF Components
/kind bug
What steps did you take and what happened: [A clear and concise description of what the bug is.]
I updated the latest version of kfp-tekton, and component values are unable to be returned.
What did you expect to happen:
When I add @kfp.dsl.component to the top of a python function which wraps create_from_func, I expect the ability to return a value by doing the following:
@kfp.dsl.component def component() -> str: return "name" func_to_container_op(component, ...)
I am hoping to access the returned value by running .output on the wrapped component in the pipeline definition.
I just get a failing component with no errors or logs. I tried kfp.v2.dsl also, but get a returned dictionary.
Also, I have searched through the documentation and cannot find anything relevant. Any information would be helpful or if there are explicit documentation elsewhere for creating components through functions would be helpful.
Thank you.
Additional information: [Miscellaneous information that will assist in solving the issue.]
Running KF 1.4 with the latest version of kfp-tekton installed.
Environment:
- Python Version (use
python --version): - SDK Version:
- Tekton Version (use
tkn version): - Kubernetes Version (use
kubectl version): - OS (e.g. from
/etc/os-release):
For the current version of kfp-tekton, you have to use @components.func_to_container_op like the example below.
https://github.com/kubeflow/kfp-tekton/blob/master/sdk/python/tests/compiler/testdata/conditions_with_global_params.py
@kfp.dsl.component and kfp.v2.dsl are for building component into the next generation IR (intermediate representation) in the JSON/dictionary format. V2 compiler is still work in progress, so you can compile pipelines with the component DSL, but might not work as a pipeline since not all the features are completed yet.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.