diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/app-values.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/app-values.yaml index 5f8216c0a7..6ac6588b9c 100644 --- a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/app-values.yaml +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/app-values.yaml @@ -59,12 +59,19 @@ resources: # resources, such as Minikube. If you do want to specify resources, uncomment the following # lines, adjust them as necessary, and remove the curly braces after 'resources:'. limits: - cpu: 1 - memory: 200Mi + cpu: 0.10 + memory: 100Mi requests: cpu: 0.10 memory: 100Mi +gpu: + enabled: false + provider: "nvidia.com/gpu" + resources: + limits: 1 + requests: 1 + # Optional configs LivenessProbe: Path: "" diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/schema.json b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/schema.json index 6a332631a9..2195d4aedb 100644 --- a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/schema.json +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/schema.json @@ -781,6 +781,36 @@ } } }, + "gpu": { + "type": "object", + "description": "GPU resource configuration", + "title": "GPU", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable GPU resources", + "title": "GPU Spec" + }, + "provider": { + "type": "string", + "description": "GPU driver type e.g. nvidia.com/gpu, amd.com/gpu, intel.com/gpu" + }, + "resources": { + "type": "object", + "description": "GPU resource requests and limits", + "properties": { + "limits": { + "type": "string", + "description": "GPU resource limits" + }, + "requests": { + "type": "string", + "description": "GPU resource requests" + } + } + } + } + }, "hostAliases":{ "type": "array", "title": "hostAliases", diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/deployment.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/deployment.yaml index 811ff84df5..05ebf70cf0 100644 --- a/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/deployment.yaml +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-21-0/templates/deployment.yaml @@ -192,11 +192,11 @@ spec: {{- if .args}} args: {{ toYaml .args | indent 12 -}} -{{- end}} +{{- end }} {{- if .resources}} resources: {{ toYaml .resources | indent 12 -}} -{{- end}} +{{- end }} {{- if .volumeMounts}} volumeMounts: {{ toYaml .volumeMounts | indent 12 -}} @@ -398,8 +398,30 @@ spec: {{ toYaml .Values.ReadinessProbe.grpc | indent 14 }} {{- end}} {{- end }} +{{- $resources := $.Values.resources | default dict }} +{{- $gpu := $.Values.gpu | default dict }} +{{- $gpuEnabled := and (hasKey $gpu "enabled") $gpu.enabled (hasKey $gpu "provider") (hasKey $gpu "resources") }} +{{- $gpuLimits := dict }} +{{- $gpuRequests := dict }} +{{- if $gpuEnabled }} + {{- $gpuLimits = dict $gpu.provider ($gpu.resources.limits | default 0) }} + {{- $gpuLimits = dict "limits" $gpuLimits }} + {{- $gpuRequests = dict $gpu.provider ($gpu.resources.requests | default 0) }} + {{- $gpuRequests = dict "requests" $gpuRequests }} +{{- end }} +{{- $limits := merge (get $resources "limits" | default dict) (get $gpuLimits "limits" | default dict) }} +{{- $requests := merge (get $resources "requests" | default dict) (get $gpuRequests "requests" | default dict) }} +{{- if or $limits $requests }} resources: -{{ toYaml $.Values.resources | trim | indent 12 }} +{{- if $limits }} + limits: +{{ toYaml $limits | indent 14 }} +{{- end }} +{{- if $requests }} + requests: +{{ toYaml $requests | indent 4 }} +{{- end }} +{{- end }} {{- if or $.Values.StartupProbe.Path $.Values.StartupProbe.command $.Values.StartupProbe.tcp $.Values.StartupProbe.grpc }} startupProbe: {{- if $.Values.StartupProbe.Path }} @@ -1013,8 +1035,30 @@ spec: {{ toYaml .Values.ReadinessProbe.grpc | indent 14 }} {{- end}} {{- end }} +{{- $resources := $.Values.resources | default dict }} +{{- $gpu := $.Values.gpu | default dict }} +{{- $gpuEnabled := and (hasKey $gpu "enabled") $gpu.enabled (hasKey $gpu "provider") (hasKey $gpu "resources") }} +{{- $gpuLimits := dict }} +{{- $gpuRequests := dict }} +{{- if $gpuEnabled }} + {{- $gpuLimits = dict $gpu.provider ($gpu.resources.limits | default 0) }} + {{- $gpuLimits = dict "limits" $gpuLimits }} + {{- $gpuRequests = dict $gpu.provider ($gpu.resources.requests | default 0) }} + {{- $gpuRequests = dict "requests" $gpuRequests }} +{{- end }} +{{- $limits := merge (get $resources "limits" | default dict) (get $gpuLimits "limits" | default dict) }} +{{- $requests := merge (get $resources "requests" | default dict) (get $gpuRequests "requests" | default dict) }} +{{- if or $limits $requests }} resources: -{{ toYaml $.Values.resources | trim | indent 12 }} +{{- if $limits }} + limits: +{{ toYaml $limits | indent 14 }} +{{- end }} +{{- if $requests }} + requests: +{{ toYaml $requests | indent 4 }} +{{- end }} +{{- end }} {{- if or $.Values.StartupProbe.Path $.Values.StartupProbe.command $.Values.StartupProbe.tcp $.Values.StartupProbe.grpc }} startupProbe: {{- if $.Values.StartupProbe.Path }} diff --git a/scripts/sql/33403700_gpu_workload_chart.down.sql b/scripts/sql/33403700_gpu_workload_chart.down.sql new file mode 100644 index 0000000000..d4fe449995 --- /dev/null +++ b/scripts/sql/33403700_gpu_workload_chart.down.sql @@ -0,0 +1,3 @@ +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'); + +DELETE FROM "public"."chart_ref" WHERE ("location" = 'gpu-workload-4-21-0' AND "version" = '4.21.0'); \ No newline at end of file diff --git a/scripts/sql/33403700_gpu_workload_chart.up.sql b/scripts/sql/33403700_gpu_workload_chart.up.sql new file mode 100644 index 0000000000..18d1ed0987 --- /dev/null +++ b/scripts/sql/33403700_gpu_workload_chart.up.sql @@ -0,0 +1,9 @@ +INSERT INTO "public"."chart_ref" ("name","location", "version", "deployment_strategy_path","is_default", "active", "created_on", "created_by", "updated_on", "updated_by") VALUES + ('GPU-Workload','gpu-workload-4-21-0', '4.21.0','pipeline-values.yaml','f', 't', 'now()', 1, 'now()', 1); + +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") +VALUES (1,(select id from chart_ref where version='4.21.0' and name='GPU-Workload'), true, now(), 1, now(), 1,true), +(4,(select id from chart_ref where version='4.21.0' and name='GPU-Workload'), true, now(), 1, now(), 1,false); + +INSERT INTO chart_ref_metadata("chart_name","chart_description") VALUES +('GPU-Workload','GPU Workload Charts to enable the deployment of GPU workloads on Kubernetes Clusters.'); \ No newline at end of file