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:
- To change service type to NodePort,
run:
Output:kubectl -n kuberay edit service kuberay-head-svc
spec: ... type: NodePort ...
- To get the cluster master IP, run:
kubectl cluster-info
- To get the client port,
run:
Output:kubectl -n kuberay describe service kuberay-head-svc
... Port: client 10001/TCP TargetPort: 10001/TCP NodePort: client 31536/TCP Endpoints: 10.244.1.85:10001
- Connect through
<K8 Master IP>:<Client Port>
.ray.init(address="ray://<K8 Master IP>:31536")
- To change service type to NodePort,
run: