-
Notifications
You must be signed in to change notification settings - Fork 524
/
Copy pathray-cluster.overwrite-command.yaml
63 lines (63 loc) · 2.28 KB
/
ray-cluster.overwrite-command.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# This example config is used to describe how does the annotation "ray.io/overwrite-container-cmd" work.
# See https://docs.ray.io/en/latest/cluster/kubernetes/user-guides/pod-command.html#kuberay-pod-command for more details.
apiVersion: ray.io/v1
kind: RayCluster
metadata:
annotations:
ray.io/overwrite-container-cmd: "true"
name: raycluster-overwrite-cmd
spec:
rayVersion: '2.41.0' # should match the Ray version in the image of the containers
# Ray head Pod template
headGroupSpec:
rayStartParams: {}
# Pod template
template:
spec:
containers:
- name: ray-head
image: rayproject/ray:2.41.0
resources:
limits:
cpu: 1
memory: 2Gi
requests:
cpu: 500m
memory: 2Gi
ports:
- containerPort: 6379
name: gcs-server
- containerPort: 8265 # Ray dashboard
name: dashboard
- containerPort: 10001
name: client
# Because the annotation "ray.io/overwrite-container-cmd" is set to "true",
# KubeRay will overwrite the generated container command with `command` and
# `args` in the following. Hence, you need to specify the `ulimit` command
# by yourself to avoid Ray scalability issues.
command: ["/bin/bash", "-lc", "--"]
# Starting from v1.1.0, KubeRay injects the environment variable `KUBERAY_GEN_RAY_START_CMD`
# into the Ray container. This variable can be used to retrieve the generated Ray start command.
# Note that this environment variable does not include the `ulimit` command.
args: ["ulimit -n 65536; echo head; $KUBERAY_GEN_RAY_START_CMD"]
workerGroupSpecs:
- replicas: 1
minReplicas: 0
maxReplicas: 10
groupName: small-group
rayStartParams: {}
template:
spec:
containers:
- name: ray-worker
image: rayproject/ray:2.41.0
resources:
limits:
cpu: "1"
memory: "1G"
requests:
cpu: "500m"
memory: "1G"
# See the comments in headGroupSpec.
command: ["/bin/bash", "-lc", "--"]
args: ["ulimit -n 65536; echo worker; $KUBERAY_GEN_RAY_START_CMD"]