To help you better monitor the operational status of the system, Ray provides an intuitive web interface called the Dashboard. The Dashboard allows you to perform visual monitoring, troubleshooting, performance tuning, and manage application operations. In a Container Service for Kubernetes (ACK) cluster, a Ray cluster created through the managed Kuberay-Operator component automatically generates a ClusterIP Service for the Head pod. However, since the Ray Dashboard lacks built-in authentication and authorization mechanisms, we do not recommend that you change this Service type to LoadBalancer
, which exposes the Service to the Internet. As a secure alternative, you can use the kubectl port-forward
command to forward ports from your local host, enabling secure access to the Ray Dashboard.
Kuberay-Operator provided by ACK clusters is in invitational preview. To use this component, submit a ticket and apply for it.
Prerequisites
A Ray cluster is created. For more information, see Efficient deployment and optimization of Ray in ACK Clusters.
Procedure
The display of metrics in Ray Dashboard is disabled by default.
Run the following command to query the service information of the Ray cluster in the namespace:
kubectl get svc -n ${RAY_CLUSTER_NS}
Expected output:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE myfirst-ray-cluster-head-svc ClusterIP 192.XX.XX.188 <none> 10001/TCP,8265/TCP,8080/TCP,6379/TCP,8000/TCP 18m
Run the following command to use
port-forward
to forward traffic from the local port 8265 to the port 8265 of the Ray cluster:kubectl port-forward svc/myfirst-ray-cluster-head-svc --address 0.0.0.0 8265:8265 -n ${RAY_CLUSTER_NS}
The following log is printed:
Forwarding from 0.0.0.0:8265 -> 8265
Access the address http://127.0.0.1:8265/ in the local browser.
What to do next
For more information about how to submit a job to run distributed tasks in a Ray cluster, see Submit a Ray job.
For information about how to use the Ray autoscaler to automatically scale Elastic Compute Service (ECS) nodes or virtual Elastic Container Instance nodes, see Elastic scaling based on the Ray autoscaler and ACK autoscaler and Elastic scaling of Elastic Container Instance nodes based on the Ray autoscaler.