Prototype an integration of ray with Open Data Hub on OpenShift, using a singleuser profile to provision a ray cluster.
- You have a project namespace in OpenShift to use for your demo, and that you have admin privileges on the cluster to install the Open Data Hub operator, add rolebindings define CRDs, etc.
- You have installed the Open Data Hub community operator from the Operator Catalog.
- You have created a deployment of the ODH operator into your demo namespace. The only ODH component necessary for this demo is JupyterHub, but others may be installed if desired.
This demo makes use of the Ray operator. To install the operator, install the following in your demo:
- Go to your demo namespace:
oc project <your-project-namespace>
- Install the CRD for a ray cluster:
oc apply -f deploy/operator/ray-cluster-crd.yaml
- Run the operator pod:
oc apply -f deploy/operator/ray-operator.yaml
- You should now see the ray operator running in pod
ray-operator-pod
- You may optionally test that the operator is working by creating a CR and ensuring it spins a ray cluster:
oc apply -f deploy/operator/ray-test-cluster-cr.yaml
This demo makes use of a role-binding to the role ray-operator-role
defined for the ray operator during the instructions above.
- Run
oc apply -f
on all the.yaml
files in thedeploy/odh
directory. - Wait a few minutes and log into the JupyterHub launcher via Routes. You should see a new notebook image option
ray-minimal-notebook:demo
: choose this. If the ray notebook is still not visible, you will need to restart thejupyterhub-xxxx
pod so that it reads the new profile you just installed. Simply deleting this pod will cause it to be restarted automatically. - Launch your JupyterHub environment. As part of the startup process, the ODH JupyterHub launcher should also start up a Ray cluster.
- Add the git repo
https://github.com/erikerlandson/ray-odh-demo.git
by clicking on "Git Clone" button on top left of Jupyter and pasting the link to repo. - In Jupyter, navigate to directory
ray-odh-demo.git/source
and open the demo notebook. - Run the notebook to confirm that it connects to your ray cluster and operates correctly.
- You could also see the head and worker nodes created under pods as
ray-cluster-$USER-ray-cluster-$USER-head-xxxxx
andray-cluster-$USER-ray-cluster-$USER-worker-xxxxx
pods