Skip to content

Commit e2ce68d

Browse files
authored
Merge pull request #1442 from porter-dev/main
Move gpu enabled jobs to prod
2 parents 8d4acfb + 02273a0 commit e2ce68d

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

applications/job/templates/cronjob.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ spec:
169169
requests:
170170
cpu: {{ .Values.resources.requests.cpu }}
171171
memory: {{ .Values.resources.requests.memory }}
172+
{{ if .Values.resources.requests }}
173+
{{ if .Values.resources.requests.nvidiaGpu }}
174+
nvidia.com/gpu: {{ .Values.resources.requests.nvidiaGpu }}
175+
{{ end }}
176+
{{ end }}
172177
limits:
173178
{{- if .Values.resources.setCPULimits }}
174179
{{- if .Values.resources.limits.cpu }}
@@ -182,6 +187,9 @@ spec:
182187
{{- else }}
183188
memory: {{ .Values.resources.requests.memory }}
184189
{{- end }}
190+
{{- if .Values.resources.limits.nvidiaGpu }}
191+
nvidia.com/gpu: {{ .Values.resources.limits.nvidiaGpu }}
192+
{{- end }}
185193
- name: sidecar
186194
image: ghcr.io/porter-dev/job_sidecar_container:31e471f4d
187195
imagePullPolicy: Always
@@ -262,6 +270,13 @@ spec:
262270
value: {{ $nodeGroup.id | quote }}
263271
effect: "NoSchedule"
264272
{{- end }}
273+
# nvidia.com/gpu toleration is automatically injected in EKS/GKE, but not in AKS
274+
# since we want to be cloud agnostic, we just add it ourselves wherever we need it
275+
{{- if .Values.resources.requests.nvidiaGpu}}
276+
- key: "nvidia.com/gpu"
277+
operator: "Exists"
278+
effect: "NoSchedule"
279+
{{- end }}
265280
backoffLimit: 0
266281
{{- if (.Values.sidecar.timeout) }}
267282
activeDeadlineSeconds: {{ .Values.sidecar.timeout }}

applications/web/templates/deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,13 @@ spec:
462462
value: {{ $nodeGroup.id | quote }}
463463
effect: "NoSchedule"
464464
{{- end }}
465+
# nvidia.com/gpu toleration is automatically injected in EKS/GKE, but not in AKS
466+
# since we want to be cloud agnostic, we just add it ourselves wherever we need it
467+
{{- if .Values.resources.requests.nvidiaGpu}}
468+
- key: "nvidia.com/gpu"
469+
operator: "Exists"
470+
effect: "NoSchedule"
471+
{{- end }}
465472
{{- if .Values.topology.enabled }}
466473
topologySpreadConstraints:
467474
- maxSkew: {{ .Values.topology.maxSkew }}

applications/worker/templates/deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,13 @@ spec:
375375
value: {{ $nodeGroup.id | quote }}
376376
effect: "NoSchedule"
377377
{{- end }}
378+
# nvidia.com/gpu toleration is automatically injected in EKS/GKE, but not in AKS
379+
# since we want to be cloud agnostic, we just add it ourselves wherever we need it
380+
{{- if .Values.resources.requests.nvidiaGpu}}
381+
- key: "nvidia.com/gpu"
382+
operator: "Exists"
383+
effect: "NoSchedule"
384+
{{- end }}
378385
{{- if .Values.topology.enabled }}
379386
topologySpreadConstraints:
380387
- maxSkew: {{ .Values.topology.maxSkew }}

0 commit comments

Comments
 (0)