install
git clone https://github.com/ray-project/ray.git
run
cd ray/deploy/charts
helm -n ray install example-cluster --create-namespace ./ray
確認
$ kubectl -n ray get rayclusters
NAME STATUS RESTARTS AGE
example-cluster 10s
$ kubectl -n ray get pods
NAME READY STATUS RESTARTS AGE
example-cluster-ray-head-type-5926k 1/1 Running 0 57s
example-cluster-ray-worker-type-8gbwx 1/1 Running 0 40s
example-cluster-ray-worker-type-l6cvx 1/1 Running 0 40s
# A service exposing the Ray head node.
$ kubectl -n ray get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
example-cluster-ray-head ClusterIP 10.8.11.17 <none> 10001/TCP,8265/TCP,8000/TCP 115s
# The operator deployment.
# By default, the deployment is launched in namespace "default".
$ kubectl get deployment ray-operator
NAME READY UP-TO-DATE AVAILABLE AGE
ray-operator 1/1 1 1 3m1s
# The single pod of the operator deployment.
$ kubectl get pod -l cluster.ray.io/component=operator
NAME READY STATUS RESTARTS AGE
ray-operator-84f5d57b7f-xkvtm 1/1 Running 0 3m35
# The Custom Resource Definition defining a RayCluster.
$ kubectl get crd rayclusters.cluster.ray.io
NAME CREATED AT
rayclusters.cluster.ray.io 2021-05-14T18:44:02
ダッシュボードを見る
$ kubectl -n ray port-forward service/example-cluster-ray-head 8265:8265
localhost:8265
Ray client を利用する
10001でheadのportを立ち上げます。
kubectl -n ray port-forward service/example-cluster-ray-head 10001:10001
その後、新しいターミナルで以下を実行