Run Kubeflow Pipelines from JupyterLab with Elyra
Elyra lets you build a visual pipeline in JupyterLab by connecting notebooks on a canvas, then submitting the pipeline to Kubeflow Pipelines (KFP). This guide walks through a two-notebook "hello world" pipeline and shows how to verify the run in the KFP UI.
This workflow uses KFP v2. Each notebook node is executed as a containerized pipeline step, and KFP stores run artifacts in S3-compatible object storage such as Ceph Object Storage.
TOC
PrerequisitesVerify the Namespace KFP Runtime ConfigurationConfigure Elyra Metadata MountsKFP Runtime Configuration Mounted at/opt/app-root/runtimesPipeline Runtime Image Metadata Mounted at /opt/app-root/pipeline-runtimesAvailable Elyra Pipeline Runtime ImagesOpen JupyterLabCreate Two Demo NotebooksCreate the Pipeline in ElyraOpen the Pipeline EditorAdd Notebook NodesConfigure Node PropertiesSubmit the Pipeline to KFPVerify the Run in Kubeflow PipelinesTroubleshootingThe namespace is not visible in KubeflowElyra does not show a KFP runtime configurationThe runtime image is not available in ElyraThe run fails before notebook code startsThe Elyra success dialog was closedPrerequisites
Before you start, make sure the following platform prerequisites are ready:
- Alauda AI Workbench is installed and you can create or open a JupyterLab workbench. For workbench creation steps, see Create Workbench.
- Kubeflow Base (
kfbase) and Kubeflow Pipelines (kfp) are deployed. For deployment steps, see Install Kubeflow Plugins. - Your namespace is visible in Kubeflow. If the namespace does not appear after you log in to Kubeflow, follow the namespace binding instructions in Install Kubeflow Plugins.
- KFP object storage is configured. For the namespace-side
kfp-launcherconfiguration, see Use Kubeflow Pipelines. - You use a JupyterLab workbench image that includes Elyra and the KFP SDK 2.x, for example the Standard Data Science Jupyter image listed in Create Workbench.
- Elyra runtime metadata is mounted into the workbench. The runtime configuration tells Elyra how to submit to KFP, and the runtime image metadata tells Elyra which image each pipeline node can run with.
The code-server workbench image does not provide the Elyra visual pipeline editor. Use a JupyterLab image when you want to create Elyra pipelines.
Verify the Namespace KFP Runtime Configuration
Before using Elyra, ask your platform administrator to confirm that the workbench namespace is ready for KFP v2 runs:
- The namespace is visible in Kubeflow and is bound to the user. See Install Kubeflow Plugins.
- KFP is configured to store artifacts in object storage. See Use Kubeflow Pipelines.
This guide does not repeat the KFP installation and object-storage manifests. It focuses on the Elyra configuration inside JupyterLab.
Configure Elyra Metadata Mounts
This section is usually completed by a platform administrator. Elyra reads two different metadata directories when the JupyterLab workbench starts:
The ..data path is expected. Kubernetes creates this symlink layout automatically for ConfigMap and Secret volumes, and the JupyterLab image follows that layout by design. The current PVC workaround for /opt/app-root/runtimes needs the same layout, so create the ..data directory yourself when preparing the PVC.
In a future Workbench version, Workspace-level Secret mounting will allow /opt/app-root/runtimes to be mounted from a Secret directly. After that support is available, you can stop using the PVC workaround for sensitive Elyra runtime configuration.
KFP Runtime Configuration Mounted at /opt/app-root/runtimes
The current Workbench version does not support mounting a Secret directly in a Workspace. Because the Elyra KFP runtime configuration may contain object-storage credentials, use a dedicated PVC as a temporary workaround and treat that PVC as sensitive.
The PVC must contain a file like this:
Use the following mlops-kfp.json as a template. Replace the namespace, endpoint, bucket, and credentials with your own values:
If the PVC is already mounted into a workbench, you can create the file from a JupyterLab terminal:
Mount the PVC into the Workspace:
Restart the workbench after creating or updating the file so Elyra can load the runtime configuration.
Pipeline Runtime Image Metadata Mounted at /opt/app-root/pipeline-runtimes
Pipeline runtime image metadata is not user-specific. A namespace ConfigMap is a better fit, and it can be mounted through WorkspaceKind so all JupyterLab workspaces of that kind get the same runtime image list.
Create a ConfigMap named pipeline-runtime-images in each namespace that runs Elyra pipelines:
If your cluster pulls images from a private registry mirror, replace docker.io/alaudadockerhub/...:<tag> with the mirrored image address.
Mount the ConfigMap through the JupyterLab WorkspaceKind:
The ConfigMap mount automatically creates the Kubernetes atomic volume layout. Inside the pod, Elyra sees files like this:
Available Elyra Pipeline Runtime Images
The Elyra pipeline runtime images are published under alaudadockerhub on Docker Hub. They are different from the JupyterLab workbench image: the workbench image runs the authoring UI, while these runtime images run individual KFP pipeline nodes.
Like the additional workbench images described in Create Workbench, these Docker Hub addresses are public source images. In a private or air-gapped environment, synchronize the required pipeline runtime images to your internal image registry first, then update the metadata.image_name field in the pipeline-runtime-images ConfigMap to point to the internal registry address.
The following table describes the five commonly used runtime images. Package lists are representative and are based on the matching source directories under runtimes/ in the image build repository.
Open JupyterLab
- Log in to Alauda AI.
- Go to Workbench.
- Open an existing JupyterLab workbench or create a new one with a JupyterLab image that includes Elyra.
- Wait for the workbench status to become
Running. - Click Connect to open JupyterLab.
After JupyterLab opens, you can optionally verify the KFP SDK version from a JupyterLab terminal:
The version should be 2.x.
Create Two Demo Notebooks
This hello world pipeline uses three files that you create directly in JupyterLab:
In the JupyterLab file browser, create a folder named hello-two-nodes.
Inside this folder, create the first notebook named 01-hello.ipynb with the following cell:
Create the second notebook named 02-world.ipynb with the following cell:
Run both notebooks once in JupyterLab to confirm that they execute locally without syntax errors.
Create the Pipeline in Elyra
After JupyterLab opens, wait until the main launcher page and Elyra panels finish loading. In browser-based validation, JupyterLab sometimes needed several seconds before the Pipeline Editor and Runtime Images panels became usable.
Open the Pipeline Editor
- In the JupyterLab file browser, open the
hello-two-nodesfolder. - Open the Launcher tab. If the launcher is not visible, click File > New Launcher.
- Click Pipeline Editor. JupyterLab opens a new untitled Elyra pipeline canvas.
- Save the empty pipeline as
hello-two-nodes.pipelinein thehello-two-nodesfolder.
Add Notebook Nodes
- Drag
01-hello.ipynbfrom the JupyterLab file browser onto the pipeline canvas. - Drag
02-world.ipynbfrom the file browser onto the same canvas. - Arrange the nodes from left to right so the execution order is easy to read.
- Connect the output port of
01-hello.ipynbto the input port of02-world.ipynb. This edge is the dependency that makes the second notebook start only after the first notebook succeeds.
Configure Node Properties
-
Click the
01-hello.ipynbnode. -
Open the node properties panel. Depending on your JupyterLab layout, the properties panel appears on the right side of the canvas or through the node context menu.
-
Confirm that the node file points to
01-hello.ipynb. -
Set Runtime Image to one of the Elyra pipeline runtime images prepared for your platform, for example:
-
If the node has CPU, memory, GPU, environment variable, input file, or output file fields, keep the defaults for this hello world example.
-
Click the
02-world.ipynbnode and repeat the same Runtime Image setting. -
Save the pipeline file again.
For this hello world example, the connection is only an execution dependency. If your second notebook must consume a file created by the first notebook, configure the node file dependencies and outputs in Elyra so the file is transferred through the pipeline artifact store.
Submit the Pipeline to KFP
- In the Elyra pipeline editor, click Run Pipeline.
- In the run dialog, set Runtime Platform to Kubeflow Pipelines.
- Select the KFP v2 runtime configuration provided by your administrator, for example
MLOps KFP. - Enter a pipeline name, for example
hello-two-nodes. - Enter a run name or keep the generated run name.
- Select an existing experiment or create a new experiment, for example
elyra-demo. - Review the runtime image values for both notebook nodes.
- Click OK or Submit.
When submission succeeds, Elyra shows a dialog similar to Job submission to Pipelines succeeded.
Elyra is a pipeline authoring and submission UI. After submission, it does not provide a durable run-history view inside the JupyterLab canvas. Use Kubeflow Pipelines to check the execution status.
Verify the Run in Kubeflow Pipelines
-
Open the Kubeflow UI.
-
Select the same namespace where your workbench runs.
-
Go to Pipelines > Runs.
-
Open the latest run for
hello-two-nodes. -
In the Graph tab, confirm that the two notebook nodes appear in order.
-
Click each node and check the logs. You should see:
-
Wait until the run status becomes
Succeeded.
Depending on your Kubeflow route, the run details URL may look like one of the following:
You can also inspect the Kubernetes resources in the namespace:
For KFP v2, it is normal to see driver and implementation pods for a run. The user notebook code runs in the implementation container.
Troubleshooting
The namespace is not visible in Kubeflow
The namespace must be associated with a Kubeflow Profile and the user must be bound to the namespace. Follow the namespace binding steps in Install Kubeflow Plugins.
Elyra does not show a KFP runtime configuration
Use a JupyterLab workbench image that includes Elyra. Then ask your administrator to confirm that the Elyra runtime metadata is mounted into the workbench and that the runtime points to your KFP endpoint and object storage.
The runtime image is not available in Elyra
Ask your administrator to create or update the pipeline-runtime-images ConfigMap and mount it at /opt/app-root/pipeline-runtimes through WorkspaceKind. Restart the workbench after changing the ConfigMap.
The run fails before notebook code starts
Check the namespace-side KFP objects:
Also check the failing pod logs in the namespace. Storage-related failures usually point to the object-storage endpoint, bucket, credentials, or kfp-launcher configuration. Metadata reporting failures usually point to metadata-grpc-configmap or the metadata gRPC service.
The Elyra success dialog was closed
Open Kubeflow Pipelines directly and check Runs in the same namespace. Elyra does not keep a persistent run link after the success dialog is closed.