Tutorial: Kale Extension in Kubedirector Notebook
The Kale extension for HPE Ezmeral Runtime Enterprise enables the automation of Jupyter Notebook deployments to Kubeflow Pipelines.
Kale enables you to deploy local or cloud-based Jupyter Notebooks to Kubeflow Pipelines, automatically converting the Notebook to a valid Kubeflow Pipelines deployment. Kale also resolves data dependencies and manages the lifecycle of the pipeline.
Kale Tutorial
If you have not done so already: Before beginning this tutorial, download the Kubeflow tutorials zip file, which contains sample files for all the included Kubeflow tutorials.
To complete this tutorial:
- Log in to the Kubedirector notebook.
- Before enabling the Kale extension, execute the steps from
examples/kubeflow/kale/README.ipynb
in the Kubedirector notebook. Proceed as follows:- Run the following
cells:
from ezmllib.kubeconfig.ezkubeconfig import set_kubeconfig set_kubeconfig()
from ezmllib.kubeflow.ezkfp import KfSession K = KfSession() client=K.kf_client()
# List the current kubeflow pipelines print(client.list_pipelines())
- If
print(client.list_pipelines())
returns a nonempty array of pipelines, you have successfully created your KFP client.
- Run the following
cells:
- Upload
candies_sharing.ipynb
using the Upload Files button in the Kubedirector notebook. - Enable the Kale extension, as follows:
- Click the Kale button in the navigation pane. The Kale Deployment Panel opens.
- Select Enable.
For more information on the Kale Deployment Panel, see The Kale Deployment Panel.
- Open the
candies_sharing.ipynb
file. - Run all cells in the notebook using .
- At the bottom of the Kale Deployment Panel, click Compile and Run.
- On the Kubeflow Dashboard, open the Runs page. Check the status of the pipeline run launched from the Kubedirector notebook.
- Perform cleanup steps to remove the pod from your namespace, as described in Cleaning the Namespace After Running the Sample.
Cleaning the Namespace After Running the Sample
After completing the Kale Tutorial, you can perform cleanup steps to remove the pod from your namespace.
tenant
namespace after successful completion of the tutorial: ```
NAME READY STATUS RESTARTS AGE
candies-sharing-bq9mb-1430592451 0/2 Completed 0 17h
candies-sharing-bq9mb-196233272 0/2 Completed 0 17h
candies-sharing-bq9mb-213010891 0/2 Completed 0 17h
candies-sharing-bq9mb-229788510 0/2 Completed 0 17h
candies-sharing-bq9mb-833381010 0/1 Completed 0 17h
```
- Start a new terminal session in the KubeDirector notebook.
- Run the following
kubectl
commands to remove the pipeline's resources:-
kubectl get wf ``` NAME STATUS AGE candies-sharing-zshg5 Succeeded 3m44s ```
For example:kubectl delete wf <wf_name>
kubectl delete wf candies-sharing-zshg5
-
- The result of the pipeline run remains on the Runs page of the Kubeflow dashboard. If you want to remove the results from the list on the Runs page, you can archive the results instead.
The Kale Deployment Panel
The Kale Deployment Panel contains the following sections:
- Pipeline Metadata: Define the name of the experiment and pipeline, and provide a description.
- Run: Enable the Katib feature for this pipeline. Set up appropriate hyperparameters and other variables by clicking the Enable Katib Job button.
- Click Advanced Settings. In Advanced Settings, you can set a container image. This container image is used for all steps of the current pipeline.
Editing a Cell
To edit a cell:
- Click the pencil icon. Cell information for Kale opens.
- Edit the information about this cell.
- Click the x button. Cell information closes.