I’m running a JupyterHub installation on Kubernetes (EKS) and an elastic Ray cluster automatically starts for each user when their notebook starts, and automatically stops when the notebook closes. JupyterHub users can access their Ray cluster dashboard securely through their browsers through an dynamically created reverse proxy which provides authentication and TLS, so that no port-forwarding and other workarounds are required. Ray client is pre-installed on all notebooks, so all that users need to do to use Ray in their notebooks is to call ray.init()
to connect to their cluster (RAY_ADDRESS environment variable is injected to the notebook container).
The problem is when users run ray.init()
in their notebooks, they get a response that has a link to the cluster dashboard that uses in-cluster IP address in the URL, which means the URL cannot be opened in the browser. For example:
I want to override the URL returned from ray.init()
and displayed to the users, so the users see publicly accessible URL of their cluster dashboard instead, e.g., https://jupyterhub.example.org/ray-dashboard/username
instead of http://10.64.63.177:8265
. Is there a way I can do that without modifying the Ray client code?
For clarity’s sake, I already have Ray cluster dashboard securely accessible via https://jupyterhub.example.org/ray-dashboard/username
. What I need is for ray.init()
to return this address to the users.