Skip to content

Commit aa8d830

Browse files
authored
feat: Add runtimeClassName support for head and worker Pods (#4184)
* feat: Add runtimeClassName support for head and worker Pods * fix: pre-commit linting errors * chore: Update values.yaml
1 parent e1034a6 commit aa8d830

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

helm-chart/ray-cluster/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ helm uninstall raycluster
8484
| head.labels | object | `{}` | Labels for the head pod |
8585
| head.serviceAccountName | string | `""` | |
8686
| head.restartPolicy | string | `""` | |
87+
| head.runtimeClassName | string | `""` | runtimeClassName is the name of the RuntimeClass to use to run the head Pod. |
8788
| head.containerEnv | list | `[]` | |
8889
| head.envFrom | list | `[]` | envFrom to pass to head pod |
8990
| head.resources.limits.cpu | string | `"1"` | |
@@ -113,6 +114,7 @@ helm uninstall raycluster
113114
| worker.labels | object | `{}` | Labels for the worker pod |
114115
| worker.serviceAccountName | string | `""` | |
115116
| worker.restartPolicy | string | `""` | |
117+
| worker.runtimeClassName | string | `""` | runtimeClassName is the name of the RuntimeClass to use to run the worker Pods. |
116118
| worker.initContainers | list | `[]` | Init containers to add to the worker pod |
117119
| worker.containerEnv | list | `[]` | |
118120
| worker.envFrom | list | `[]` | envFrom to pass to worker pod |
@@ -142,6 +144,7 @@ helm uninstall raycluster
142144
| additionalWorkerGroups.smallGroup.labels | object | `{}` | Labels for the additional worker pod |
143145
| additionalWorkerGroups.smallGroup.serviceAccountName | string | `""` | |
144146
| additionalWorkerGroups.smallGroup.restartPolicy | string | `""` | |
147+
| additionalWorkerGroups.smallGroup.runtimeClassName | string | `""` | runtimeClassName for this additional worker group. Empty string means default runtime. |
145148
| additionalWorkerGroups.smallGroup.containerEnv | list | `[]` | |
146149
| additionalWorkerGroups.smallGroup.envFrom | list | `[]` | envFrom to pass to additional worker pod |
147150
| additionalWorkerGroups.smallGroup.resources.limits.cpu | int | `1` | |

helm-chart/ray-cluster/templates/raycluster-cluster.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ spec:
155155
{{- with .Values.head.restartPolicy }}
156156
restartPolicy: {{ . }}
157157
{{- end }}
158+
{{- with .Values.head.runtimeClassName }}
159+
runtimeClassName: {{ . }}
160+
{{- end }}
158161
{{- with .Values.head.serviceAccountName }}
159162
serviceAccountName: {{ . }}
160163
{{- end }}
@@ -281,6 +284,9 @@ spec:
281284
{{- with .Values.worker.restartPolicy }}
282285
restartPolicy: {{ . }}
283286
{{- end }}
287+
{{- with .Values.worker.runtimeClassName }}
288+
runtimeClassName: {{ . }}
289+
{{- end }}
284290
{{- with .Values.worker.serviceAccountName }}
285291
serviceAccountName: {{ . }}
286292
{{- end }}
@@ -408,6 +414,9 @@ spec:
408414
{{- with $values.restartPolicy }}
409415
restartPolicy: {{ . }}
410416
{{- end }}
417+
{{- with $values.runtimeClassName }}
418+
runtimeClassName: {{ . }}
419+
{{- end }}
411420
{{- with $values.serviceAccountName }}
412421
serviceAccountName: {{ . }}
413422
{{- end }}

helm-chart/ray-cluster/tests/raycluster_test.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,3 +2153,32 @@ tests:
21532153
- equal:
21542154
path: spec.workerGroupSpecs[?(@.groupName=="smallGroup")].template.spec.securityContext.fsGroup
21552155
value: 3000
2156+
2157+
- it: Should set head runtimeClassName when `head.runtimeClassName` is set
2158+
set:
2159+
head:
2160+
runtimeClassName: nvidia
2161+
asserts:
2162+
- equal:
2163+
path: spec.headGroupSpec.template.spec.runtimeClassName
2164+
value: nvidia
2165+
2166+
- it: Should set worker runtimeClassName when `worker.runtimeClassName` is set
2167+
set:
2168+
worker:
2169+
runtimeClassName: nvidia
2170+
asserts:
2171+
- equal:
2172+
path: spec.workerGroupSpecs[?(@.groupName=="workergroup")].template.spec.runtimeClassName
2173+
value: nvidia
2174+
2175+
- it: Should set additional worker group runtimeClassName when `additionalWorkerGroups.smallGroup.runtimeClassName` is set
2176+
set:
2177+
additionalWorkerGroups:
2178+
smallGroup:
2179+
disabled: false
2180+
runtimeClassName: nvidia
2181+
asserts:
2182+
- equal:
2183+
path: spec.workerGroupSpecs[?(@.groupName=="smallGroup")].template.spec.runtimeClassName
2184+
value: nvidia

helm-chart/ray-cluster/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ head:
9898
serviceAccountName: ""
9999
restartPolicy: ""
100100

101+
# -- runtimeClassName is the name of the RuntimeClass to use to run the head Pod.
102+
runtimeClassName: ""
103+
101104
# containerEnv specifies environment variables for the Ray container,
102105
# Follows standard K8s container env schema.
103106
containerEnv: []
@@ -211,6 +214,9 @@ worker:
211214
serviceAccountName: ""
212215
restartPolicy: ""
213216

217+
# -- runtimeClassName is the name of the RuntimeClass to use to run the worker Pods.
218+
runtimeClassName: ""
219+
214220
# -- Init containers to add to the worker pod
215221
initContainers: []
216222

@@ -319,6 +325,9 @@ additionalWorkerGroups:
319325
serviceAccountName: ""
320326
restartPolicy: ""
321327

328+
# -- runtimeClassName for this additional worker group. Empty string means default runtime.
329+
runtimeClassName: ""
330+
322331
# containerEnv specifies environment variables for the Ray container,
323332
# Follows standard K8s container env schema.
324333
containerEnv: []

0 commit comments

Comments
 (0)