Skip to content

Home

Step 1: Login to Kubeflow

In this step, you will login to your Kubeflow instance.

  • Navigate to your Kubeflow URL (This will be provided by your platform team)
  • Login using your local credentials or OKTA credentials

Login

Once logged in, you will see the home dashboard screen.

Dashboard


Step 2: Create Notebook

In this step, you will create a Jupyter Notebook.

  • Navigate to Notebooks
  • Click New Notebook
  • Enter a name for the notebook
  • Select JupyterLab
  • Select kubeflownotebookswg/jupyter-scipy:v1.8.0 for the custom notebook
  • Set the minimum CPU to 1
  • Set the minimum memory to 1
  • Click Advanced Options under Data Volumes
  • Select Configurations -> Allow access to Kubeflow Pipelines
  • Click Launch

Launch

It will take 1-2 minutes to create the notebook.

Launch


Step 3: Build MLOps Pipeline

In this step, you will build a model life cycle pipeline.

  • Navigate to Notebooks
  • Click Connect on the previously created notebook
  • Click Terminal to open the terminal

Terminal

  • Enter the following command in the terminal to install kfp-kubernetes
pip install --user kfp-kubernetes
  • Download the following notebook file
  • In the left hand folder tree, click on the upload files icon
  • Upload the previously downloaded demo-notebook.ipynb file
  • Double click the demo-notebook.ipynb file in the folder tree to open the notebook
  • Click the run icon
  • Click the refresh icon in the folder tree view and you will see a new file named demo-pipeline.yaml
  • Right click on the file and select Download to download the file to to your local machine

Pipeline


Step 4: Create Experiment

In this step, we will create a KFP experiment.

  • Navigate back to the Kubeflow dashboard
  • Click Experiments (KFP)
  • Click Create experiment
  • Enter a name for the experiment
  • Click Next

Experiment


Step 5: Create Pipeline

In this step, we will use the pipeline YAML file generated in a previous step and load it in.

  • Navigate back to the Kubeflow dashboard
  • Click Pipelines
  • Click Upload pipeline
  • Enter a name for the pipeline
  • Select Upload a file
  • Click Choose file and select the previously downloaded Demo.yaml file
  • Click Create

Pipeline

Now, we will run the pipeline.

  • Click Create run
  • Ensure the pipeline and pipeline version that were previously created are selected
  • Click Choose on the Experiment section and select the previously created experiment
  • Enter /data for the data_path parameter
  • Click Start

Pipeline

The pipeline will begin to run. After ~10 minutes, you should see the pipeline completed successfully.

Pipeline


Step 6: Model Registry

In this step, we will look at the newly created model details that would have been uploaded to the integrated MLflow based model registry.

  • Navigate back to the Kubeflow dashboard
  • Click MlFlow
  • Click new-exp

You will see the newly created model.

Model

  • Click on the model name for more details

Model


Step 7: Model Serving

In this step, you will review the endpoints that were created to serve the newly created model.

  • Navigate back to the Kubeflow dashboard
  • Click Endpoints

Endpoints

  • Click on the name of the endpoint

You will see the model is being served on the URLs listed. Note that the model is automatically retrieved from the integrated MLFlow based model registry.

Endpoints

  • Copy the URL internal
  • Update the internal URL in the command below and run the shell commands to generate the inference URL
INTERNAL_URL='UPDATE_VALUE'
INF_NAME="$(echo "${INTERNAL_URL}" | cut -d '.' -f1 | cut -d '/' -f3-)"
INFERENCE_URL="${INTERNAL_URL}/v2/models/${INF_NAME}/infer"
echo "${INFERENCE_URL}"
  • Save the inference URL for the next step

Step 8: Test Application

In this step, you will create a test application that uses the previously created model.

  • Log into the Rafay console
  • Navigate to Applications -> Workloads
  • Click New Workload -> Create New Workload
  • Enter a name for the workload
  • Select K8s YAML for the package type
  • Select Upload files manually
  • Select the namespace being used for your Notebook
  • Click Continue

Workload

  • Download the following application spec file
  • Update line 34 with the previously generated Inference URL
  • Click Choose File to upload the updated file
  • Click Save and Go to Placement

Workload

  • Select the cluster where Kubeflow is running
  • Click Save and go to Publish
  • Click Publish

Workload

  • Navigate to Infrastructure -> Clusters
  • Click KUBECTL on the cluster where Kubeflow is running
  • Enter the following command to retrieve the IP address of the application. Be sure to update the namespace with the namespace where the application was deployed
kubectl get ingress/iris-web-app-ingress -n <UPDATE_VALUE>
  • Enter the IP address into a web browser to access the application. Note, this is an HTTP only site.

Application

The user can update the sepal and Petal values and then click the predict button. This application is internally using the KServe inference service endpoint that was generated earlier on by the pipeline


Recap

Congratulations! At this point, you have successfully created a Jupyter notebook which used a pipeline to create a data model and expose and inference server that was then used by a sample web application.