Ray and Jupyter Lab on K8

Hi! I just deployed ray, version 2.0.0.dev0 on Kubernetes. I followed the instructions from Deploying on Kubernetes — Ray v2.0.0.dev0 and tried to run ipython using the recommended commands:
# From your local machine.
$ kubectl -n ray exec -it ray-head- – ipython

# From a remote shell on the head node.
$ kubectl -n ray exec -it ray-head- – bash
root@ray-head-6f566446c-5rdmb:/# ipython

However, the IPython binaries are not in Ray’s head container.

I just want to be able to use the Ray cluster to run jobs launched from a Jupyterlab notebook. I’m expecting something like opening a cluster session similar to what can be done with PySpark.

I’d appreciate your guidance on this. Thanks in advance. Enrique

@ecorro could you try setting up the Ray Client?

https://docs.ray.io/en/master/ray-client.html#basic-usage

You should be able to just do the following:

  1. Start a ray cluster
  2. Run python -m ray.util.client.server on the ray-head
  3. Then open a jupyter notebook (from a machine that has access to port 50051 of the head node), and within the jupyter notebook, call ray.util.connect("head-address:50051").

cc @barakmich

Thanks @rliaw! I will try that and let you know how it goes.

I got this error: AttributeError: module ‘ray.util’ has no attribute ‘connect’. I have ray 1.1.0 in my laptop. I wonder if this connect method is new to ray 2.0. Thanks

Yeah, could you try installing from the latest ray nightly wheels? Installing Ray — Ray v2.0.0.dev0

1 Like

besides connecting to ray.client, is there other API supported by ray client? e.g., querying job status