Running Pipelines¶
Once your notebook is annotated, you can compile and run it three ways:
CLI —
kale --nb ..., good for scripts and CI.JupyterLab extension — interactive Compile and Run button.
Compile-only — inspect the generated KFP DSL before submitting.
All three call into the same underlying Python API, so the behavior is identical.
From the command line¶
The kale CLI is the fastest path to a running pipeline. The core
invocation is:
kale --nb path/to/notebook.ipynb
This compiles the notebook into .kale/<pipeline_name>.kale.py and exits.
To also submit the pipeline to a running KFP instance, add:
kale --nb path/to/notebook.ipynb \
--kfp_host http://127.0.0.1:8080 \
--run_pipeline
Useful CLI flags¶
Flag |
Effect |
|---|---|
|
Path to the notebook (required). |
|
KFP API endpoint for upload and run. |
|
Upload the pipeline without starting a run. |
|
Upload and create a run. |
|
Override the pipeline name (default comes from notebook metadata). |
|
Override the KFP experiment (default |
|
Set a pipeline description shown in the KFP UI. |
|
Override the default base image for all steps. |
|
Keep intermediate files and print verbose logs. |
See CLI Reference for the complete list.
From the JupyterLab extension¶
Open your notebook in JupyterLab, click the Kale icon in the left sidebar, and toggle the Kale panel on. At the bottom of the panel you’ll see:
Pipeline Name and Experiment Name — override notebook defaults.
Docker Image — base image used for every step that doesn’t declare its own via an
image:tag.Compile and Save — generate the KFP DSL only.
Compile and Run — generate, upload, and start a run.
The Deploy button streams progress through a notification area at the top of the panel, and surfaces the KFP run URL when the run is created so you can click straight through to the KFP UI.
Compile-only mode¶
When you want to read or debug the generated code before sending it to KFP,
skip the --run_pipeline flag on the CLI (or use Compile and Save in
the extension). You’ll end up with:
.kale/
├── my_notebook.kale.py
└── my_notebook.yaml # KFP YAML IR (produced when running the DSL)
The .kale.py file is pure KFP v2 DSL. The .yaml file is the compiled
pipeline IR that can be manually uploaded to the KFP UI without using Kale’s
“Compile and Run” button. You can:
Read it line by line to verify that your step dependencies, inputs, and outputs look right.
Run it directly (
python .kale/my_notebook.kale.py) to reproduce KFP compilation errors locally.Edit it to experiment with changes before committing them to the notebook.
Monitoring runs¶
Once a run is submitted, open the KFP UI and navigate to Runs. You can:
Watch step status in real time.
Click a step to see its logs, the generated component source, and artifact inputs/outputs.
See pipeline parameters and pipeline metrics in the run summary.
Compare two runs side by side from the Runs list.
Kale doesn’t add any custom tracking on top of KFP — everything runs through the standard KFP backend, so anything you can do with a hand-rolled KFP pipeline, you can also do with a Kale-generated one.
Environment variables¶
A few environment variables are useful when running Kale:
Variable |
Purpose |
|---|---|
|
Default KFP API endpoint if |
|
KFP UI URL used when Kale renders run links. |
|
Comma-separated pip index URLs baked into the generated components (used for local dev). |
|
Trusted hosts for HTTP pip index URLs. |
The last two are most useful when testing an unpublished version of Kale against a local KFP cluster — see the “Testing with KFP Clusters” section of Contributing.