Connecting to Ray Cluster

Describes how to connect to Ray clusters to submit jobs.

NOTE
The Ray Client has multithreading and connection issues which impact its reliability and submitting Ray job using Ray Client is an outdated method. Hewlett Packard Enterprise recommends using JobSubmissionClient to submit Ray jobs. For details, see Using JobSubmissionClient to Submit Ray Jobs.
To submit jobs using Ray, you can connect to Ray cluster in two different ways:
Connecting to Ray in HPE Ezmeral Unified Analytics Software
To connect to Ray in HPE Ezmeral Unified Analytics Software, run:
ray.init(address="ray://kuberay-head-svc.kuberay:10001")
Connecting to Ray from outside of HPE Ezmeral Unified Analytics Software
To connect to Ray cluster from outside of HPE Ezmeral Unified Analytics Software, perform the following steps:
  1. To change service type to NodePort, run:
    kubectl -n kuberay edit service kuberay-head-svc
    Output:
    
    spec:
    ...
      type: NodePort
    ...
  2. To get the cluster master IP, run:
    kubectl cluster-info
    
  3. To get the client port, run:
    kubectl -n kuberay describe service kuberay-head-svc
    Output:
    
    ... 
    Port:                     client  10001/TCP
    TargetPort:               10001/TCP
    NodePort:                 client  31536/TCP
    Endpoints:                10.244.1.85:10001
  4. Connect through <K8 Master IP>:<Client Port>.
    ray.init(address="ray://<K8 Master IP>:31536")