Skip to content

Commit 6ce9b77

Browse files
committed
fixes after testing
1 parent 59c8ff8 commit 6ce9b77

File tree

6 files changed

+74
-91
lines changed

6 files changed

+74
-91
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v1
22
appVersion: "1.0"
33
description: A Helm chart for Kubernetes
4-
name: deployment-chart_4-21-0
4+
name: gpu-workload-4-21-0
55
version: 4.21.0

scripts/devtron-reference-helm-charts/gpu-workload-4-21-0/app-values.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,10 @@ resources:
6767

6868
gpu:
6969
enabled: false
70+
provider: "nvidia.com/gpu"
7071
resources:
71-
requests:
72-
nvidia.com/gpu: 1
73-
limits:
74-
nvidia.com/gpu: 1
72+
limits: 1
73+
requests: 1
7574

7675
# Optional configs
7776
LivenessProbe:

scripts/devtron-reference-helm-charts/gpu-workload-4-21-0/schema.json

Lines changed: 42 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -734,65 +734,6 @@
734734
"type": "string",
735735
"description": "image of envoy to be used"
736736
},
737-
"gpu": {
738-
"type": "object",
739-
"description": "GPU resource configuration",
740-
"title": "GPU",
741-
"properties": {
742-
"enabled": {
743-
"type": "boolean",
744-
"description": "Enable GPU resources"
745-
},
746-
"driver": {
747-
"type": "string",
748-
"description": "GPU driver type (e.g. nvidia, amd64, intel). Supported: nvidia, amd64, intel."
749-
},
750-
"resources": {
751-
"type": "object",
752-
"description": "GPU resource requests and limits",
753-
"properties": {
754-
"requests": {
755-
"type": "object",
756-
"description": "Requested GPU resources",
757-
"properties": {
758-
"nvidia.com/gpu": {
759-
"type": ["integer", "string"],
760-
"description": "Number of NVIDIA GPUs requested"
761-
},
762-
"amd.com/gpu": {
763-
"type": ["integer", "string"],
764-
"description": "Number of AMD GPUs requested"
765-
},
766-
"intel.com/gpu": {
767-
"type": ["integer", "string"],
768-
"description": "Number of Intel GPUs requested"
769-
}
770-
},
771-
"additionalProperties": true
772-
},
773-
"limits": {
774-
"type": "object",
775-
"description": "GPU resource limits",
776-
"properties": {
777-
"nvidia.com/gpu": {
778-
"type": ["integer", "string"],
779-
"description": "Maximum number of NVIDIA GPUs allowed"
780-
},
781-
"amd.com/gpu": {
782-
"type": ["integer", "string"],
783-
"description": "Maximum number of AMD GPUs allowed"
784-
},
785-
"intel.com/gpu": {
786-
"type": ["integer", "string"],
787-
"description": "Maximum number of Intel GPUs allowed"
788-
}
789-
},
790-
"additionalProperties": true
791-
}
792-
}
793-
}
794-
}
795-
},
796737
"resources": {
797738
"type": "object",
798739
"description": "minimum and maximum RAM and CPU available to the application",
@@ -840,6 +781,48 @@
840781
}
841782
}
842783
},
784+
"gpu": {
785+
"type": "object",
786+
"description": "GPU resource configuration",
787+
"title": "GPU",
788+
"properties": {
789+
"enabled": {
790+
"type": "boolean",
791+
"description": "Enable GPU resources",
792+
"title": "GPU Spec"
793+
},
794+
"provider": {
795+
"type": "string",
796+
"description": "GPU driver type e.g. nvidia.com/gpu, amd.com/gpu, intel.com/gpu"
797+
},
798+
"resources": {
799+
"type": "object",
800+
"description": "GPU resource requests and limits",
801+
"properties": {
802+
"limits": {
803+
"type": "object",
804+
"description": "GPU resource limits",
805+
"properties": {
806+
"gpu": {
807+
"type": "string",
808+
"description": "Limit for GPU resources"
809+
}
810+
}
811+
},
812+
"requests": {
813+
"type": "object",
814+
"description": "GPU resource requests",
815+
"properties": {
816+
"gpu": {
817+
"type": "string",
818+
"description": "Request for GPU resources"
819+
}
820+
}
821+
}
822+
}
823+
}
824+
}
825+
},
843826
"hostAliases":{
844827
"type": "array",
845828
"title": "hostAliases",

scripts/devtron-reference-helm-charts/gpu-workload-4-21-0/templates/deployment.yaml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,10 @@ spec:
193193
args:
194194
{{ toYaml .args | indent 12 -}}
195195
{{- end }}
196-
{{- $resources := $.Values.resources | default dict }}
197-
{{- $gpuResources := (and (hasKey $.Values.gpu "enabled") $.Values.gpu.enabled (hasKey $.Values.gpu "resources")) | ternary $.Values.gpu.resources (dict) }}
198-
{{- $limits := merge (get $resources "limits" | default dict) (get $gpuResources "limits" | default dict) }}
199-
{{- $requests := merge (get $resources "requests" | default dict) (get $gpuResources "requests" | default dict) }}
200-
{{- if or $limits $requests }}
196+
{{- if .resources}}
201197
resources:
202-
{{- if $limits }}
203-
limits:
204-
{{ toYaml $limits | indent 14 }}
205-
{{- end }}
206-
{{- if $requests }}
207-
requests:
208-
{{ toYaml $requests | indent 14 }}
209-
{{- end }}
210-
{{- end }}
198+
{{ toYaml .resources | indent 12 -}}
199+
{{- end }}
211200
{{- if .volumeMounts}}
212201
volumeMounts:
213202
{{ toYaml .volumeMounts | indent 12 -}}
@@ -409,21 +398,30 @@ spec:
409398
{{ toYaml .Values.ReadinessProbe.grpc | indent 14 }}
410399
{{- end}}
411400
{{- end }}
412-
{{- $resources := $.Values.resources | default dict }}
413-
{{- $gpuResources := (and (hasKey $.Values.gpu "enabled") $.Values.gpu.enabled (hasKey $.Values.gpu "resources")) | ternary $.Values.gpu.resources (dict) }}
414-
{{- $limits := merge (get $resources "limits" | default dict) (get $gpuResources "limits" | default dict) }}
415-
{{- $requests := merge (get $resources "requests" | default dict) (get $gpuResources "requests" | default dict) }}
416-
{{- if or $limits $requests }}
401+
{{- $resources := $.Values.resources | default dict }}
402+
{{- $gpu := $.Values.gpu | default dict }}
403+
{{- $gpuEnabled := and (hasKey $gpu "enabled") $gpu.enabled (hasKey $gpu "provider") (hasKey $gpu "resources") }}
404+
{{- $gpuLimits := dict }}
405+
{{- $gpuRequests := dict }}
406+
{{- if $gpuEnabled }}
407+
{{- $gpuLimits = dict $gpu.provider ($gpu.resources.limits | default 0) }}
408+
{{- $gpuLimits = dict "limits" $gpuLimits }}
409+
{{- $gpuRequests = dict $gpu.provider ($gpu.resources.requests | default 0) }}
410+
{{- $gpuRequests = dict "requests" $gpuRequests }}
411+
{{- end }}
412+
{{- $limits := merge (get $resources "limits" | default dict) (get $gpuLimits "limits" | default dict) }}
413+
{{- $requests := merge (get $resources "requests" | default dict) (get $gpuRequests "requests" | default dict) }}
414+
{{- if or $limits $requests }}
417415
resources:
418-
{{- if $limits }}
416+
{{- if $limits }}
419417
limits:
420418
{{ toYaml $limits | indent 14 }}
421-
{{- end }}
422-
{{- if $requests }}
419+
{{- end }}
420+
{{- if $requests }}
423421
requests:
424422
{{ toYaml $requests | indent 14 }}
425-
{{- end }}
426-
{{- end }}
423+
{{- end }}
424+
{{- end }}
427425
{{- if or $.Values.StartupProbe.Path $.Values.StartupProbe.command $.Values.StartupProbe.tcp $.Values.StartupProbe.grpc }}
428426
startupProbe:
429427
{{- if $.Values.StartupProbe.Path }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DELETE FROM global_strategy_metadata_chart_ref_mapping WHERE chart_ref_id=(select id from chart_ref where version='4.21.0' and name='GPU-Workload');
22

3-
DELETE FROM "public"."chart_ref" WHERE ("location" = 'gpu-workload_4-21-0' AND "version" = '4.21.0');
3+
DELETE FROM "public"."chart_ref" WHERE ("location" = 'gpu-workload-4-21-0' AND "version" = '4.21.0');
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
INSERT INTO "public"."chart_ref" ("name","location", "version", "deployment_strategy_path","is_default", "active", "created_on", "created_by", "updated_on", "updated_by") VALUES
2-
('GPU-Workload','gpu-workload_4-21-0', '4.21.0','pipeline-values.yaml','f', 't', 'now()', 1, 'now()', 1);
2+
('GPU-Workload','gpu-workload-4-21-0', '4.21.0','pipeline-values.yaml','f', 't', 'now()', 1, 'now()', 1);
33

44
INSERT INTO global_strategy_metadata_chart_ref_mapping ("global_strategy_metadata_id", "chart_ref_id", "active", "created_on", "created_by", "updated_on", "updated_by","default")
55
VALUES (1,(select id from chart_ref where version='4.21.0' and name='GPU-Workload'), true, now(), 1, now(), 1,true),
6-
(4,(select id from chart_ref where version='4.21.0' and name='GPU-Workload'), true, now(), 1, now(), 1,false);
6+
(4,(select id from chart_ref where version='4.21.0' and name='GPU-Workload'), true, now(), 1, now(), 1,false);
7+
8+
INSERT INTO chart_ref_metadata("chart_name","chart_description") VALUES
9+
('GPU-Workload','GPU Workload Charts enable the deployment of GPU workloads on Kubernetes Clusters.');

0 commit comments

Comments
 (0)