Skip to content

Distributed Ray Clusters (KubeRay)

Berkelium provides native support for Ray via the KubeRay Operator, allowing you to spin up distributed Ray clusters on demand.

Create ray-cluster.yaml:

apiVersion: ray.io/v1
kind: RayCluster
metadata:
name: ray-als-cluster
namespace: sci-myproject
spec:
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:

Terminal window
kubectl apply -f ray-cluster.yaml
kubectl get rayclusters -n sci-myproject

Forward port 8265 to inspect worker graphs, actor states, and memory timelines:

Terminal window
kubectl port-forward service/ray-als-cluster-head-svc 8265:8265 -n sci-myproject

Navigate to http://localhost:8265 in your browser.