Configure Custom Kale Python Image

This guide will walk you through how to configure Kale to use your custom Python image for its various operations, such as HP tuning.

What You’ll Need

Procedure

  1. Go to your GitOps repository, inside your rok-tools management environment:

    root@rok-tools:~# cd ~/ops/deployments
  2. Navigate to the deploy overlay of the skel-resources kustomization:

    root@rok-tools:~/ops/deployments# cd kubeflow/manifests/common/skel-resources/overlays/deploy
  3. Edit patches/ppoddefault-kale-python-image.yaml and set the value of KALE_PYTHON_IMAGE of the kale-python-image PodDefault to your custom Python image, for example, kale-python-custom:1234:

    apiVersion: kubeflow.org/v1alpha1 kind: PodDefault metadata: name: kale-python-image spec: env: - name: KALE_PYTHON_IMAGE value: "kale-python-custom:1234" # <-- edit this line
  4. Include the PodDefault patch in the overlay:

    root@rok-tools:~/ops/deployments/kubeflow/manifests/common/skel-resources/overlays/deploy# kustomize \ > edit add patch patches/poddefault-kale-python-image.yaml
  5. Return to the base directory of your GitOps repository, inside your rok-tools management environment:

    root@rok-tools:~/ops/deployments/kubeflow/manifests/common/skel-resources/overlays/deploy# cd ~/ops/deployments
  6. Commit changes:

    root@rok-tools:~/ops/deployments# git commit -am "Configue custom Kale Python image"
  7. Apply changes:

    root@rok-tools:~/ops/deployments# rok-deploy --apply kubeflow/manifests/common/skel-resources/overlays/deploy
  8. Optional

    Follow the Extend List of JWA Preselected Configurations guide to configure JWA to enable this configuration by default for all new Notebooks. Users can always enable or disable this when creating a new Notebook.

Verify

  1. Retrieve the PodDefault in the kubeflow-skel namespace and ensure it mentions your image:

    root@rok-tools:~# kubectl get -n kubeflow-user poddefault \ > kale-python-image -o json | jq -r ".spec.env" [ { "name": "KALE_PYTHON_IMAGE", "value": "kale-python-custom:1234" } ]

Summary

You have successfully configured Kale to use a custom Python image.

What’s Next

Check out the rest of the operations you can perform on your Kubeflow deployment.