kfp-notebook

raw JSON →
4.1.0 verified Fri May 01 auth: no python

Elyra's kfp-notebook package provides tools for converting Jupyter notebooks into Kubeflow Pipelines components. Version 4.1.0 is the latest, released as part of Elyra. The project follows a regular release cadence.

pip install kfp-notebook
error ModuleNotFoundError: No module named 'kfp_notebook'
cause The package is installed as `kfp-notebook` but import uses underscore.
fix
Install the package: pip install kfp-notebook. The import is from kfp_notebook... (underscore).
error AttributeError: module 'kfp_notebook' has no attribute 'compiler'
cause Importing the package incorrectly.
fix
Use from kfp_notebook.compiler import KfpCompiler.
breaking Version 4.0.0 dropped support for Python 3.8 and 3.9; requires Python >=3.10.
fix Upgrade Python to 3.10 or later.
deprecated The older import path `from kfp_notebook import something` may not work; use explicit submodule imports.
fix Use `from kfp_notebook.compiler import KfpCompiler` instead of `from kfp_notebook import KfpCompiler`.

Compile a simple Kubeflow pipeline from a function.

from kfp_notebook.compiler import KfpCompiler
from kfp import dsl

def my_pipeline():
    op = dsl.ContainerOp(name='hello', image='busybox', command=['echo', 'hello'])
    return op

compiler = KfpCompiler()
compiler.compile(pipeline_func=my_pipeline, package_path='pipeline.yaml')