Distributed Ray Clusters (KubeRay)
Berkelium provides native support for Ray via the KubeRay Operator, allowing you to spin up distributed Ray clusters on demand.
Defining a RayCluster Custom Resource
Section titled “Defining a RayCluster Custom Resource”Create ray-cluster.yaml:
apiVersion: ray.io/v1kind: RayClustermetadata: name: ray-als-cluster namespace: sci-myprojectspec: rayVersion: '2.30.0' headGroupSpec: rayStartParams: dashboard-host: '0.0.0.0' template: spec: containers: - name: ray-head image: rayproject/ray:2.30.0-py310-gpu resources: limits: cpu: "8" memory: "32Gi" workerGroupSpecs: - groupName: gpu-workers replicas: 4 minReplicas: 1 maxReplicas: 8 template: spec: containers: - name: ray-worker image: rayproject/ray:2.30.0-py310-gpu resources: limits: cpu: "16" memory: "64Gi" nvidia.com/gpu: "1"Apply and verify:
kubectl apply -f ray-cluster.yamlkubectl get rayclusters -n sci-myprojectConnecting to the Ray Dashboard
Section titled “Connecting to the Ray Dashboard”Forward port 8265 to inspect worker graphs, actor states, and memory timelines:
kubectl port-forward service/ray-als-cluster-head-svc 8265:8265 -n sci-myprojectNavigate to http://localhost:8265 in your browser.
