Generates Kubeflow Components from Kubernetes CRD specifications.
pip install komponents
First, generate components. Components are specifications that Kubeflow uses to define steps of a pipeline. To generate a component, pipe a CRD specification to komponents generate, you must provide a success and failure condition. By default, component specification are written to the components directory.
kubectl get -o yaml crd/my-crd | komponents generate --success-condition status.state==SUCCESS --failure-condition status.state==FAILURE
Once you have generated your components you can plug them into a Kubeflow pipeline. Each field under spec of the crd becomes a parameter to the component function. Nested fields are differentiated with an underscore in the parameter name.
import kfp
crd_op = kfp.components.load_component('components/my-crd-group/my-crd-v1.yaml')
@kfp.dsl.pipeline()
def pipeline():
crd_op(foo='foo', bar='bar', baz_1='baz-1', baz_2='baz-2')python3 -m venv venv
source venv/bin/activate
pip install .
komponents --help