Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move gpu autoscaling changes to prod #1384

Merged
merged 8 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion applications/testdata/web.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
autoscaling:
enabled: false
enabled: true
behavior:
enabled: true
scaleDown:
stabilizationWindowSeconds: 3600
type: Pods
value: 2
periodSeconds: 60
scaleUp:
stabilizationWindowSeconds: 3600
type: Pods
value: 2
periodSeconds: 60
gpu: false
maxReplicas: 10
minReplicas: 1
Expand Down
20 changes: 20 additions & 0 deletions applications/web/templates/hpa-blue-green.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ spec:
type: Utilization
averageUtilization: {{ . }}
{{- end }}
{{- if .Values.autoscaling.gpu }}
{{- with .Values.autoscaling.targetGPUUtilizationPercentage }}
- type: Pods
pods:
metric:
name: gpu_utilization
target:
type: AverageValue
averageValue: {{ . }}
{{- end }}
{{- with .Values.autoscaling.targetGPUMemoryUtilizationRatio }}
- type: Pods
pods:
metric:
name: gpu_memory_utilization_ratio
target:
type: AverageValue
averageValue: {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
22 changes: 22 additions & 0 deletions applications/web/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ spec:
{{- if .Values.autoscaling.behavior.enabled }}
behavior:
scaleDown:
stabilizationWindowSeconds: {{ .Values.autoscaling.behavior.scaleDown.stabilizationWindowSeconds | default 60 }}
policies:
- type: {{ .Values.autoscaling.behavior.scaleDown.type }}
value: {{ .Values.autoscaling.behavior.scaleDown.value }}
periodSeconds: {{ .Values.autoscaling.behavior.scaleDown.periodSeconds }}
scaleUp:
stabilizationWindowSeconds: {{ .Values.autoscaling.behavior.scaleUp.stabilizationWindowSeconds | default 60 }}
policies:
- type: {{ .Values.autoscaling.behavior.scaleUp.type }}
value: {{ .Values.autoscaling.behavior.scaleUp.value }}
Expand Down Expand Up @@ -50,5 +52,25 @@ spec:
type: Utilization
averageUtilization: {{ . }}
{{- end }}
{{- if .Values.autoscaling.gpu }}
{{- with .Values.autoscaling.targetGPUUtilizationPercentage }}
- type: Pods
pods:
metric:
name: gpu_utilization
target:
type: AverageValue
averageValue: {{ . }}
{{- end }}
{{- with .Values.autoscaling.targetGPUMemoryUtilizationRatio }}
- type: Pods
pods:
metric:
name: gpu_memory_utilization_ratio
target:
type: AverageValue
averageValue: {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions applications/web/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,13 @@ resources:

autoscaling:
enabled: false
gpu: false
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 50
targetMemoryUtilizationPercentage: 50
targetGPUUtilizationPercentage: 100
targetGPUMemoryUtilizationRatio: 1
behavior:
enabled: false
scaleDown:
Expand Down
20 changes: 20 additions & 0 deletions applications/worker/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,24 @@ spec:
type: Utilization
averageUtilization: {{ . }}
{{- end }}
{{- if .Values.autoscaling.gpu }}
{{- with .Values.autoscaling.targetGPUUtilizationPercentage }}
- type: Pods
pods:
metric:
name: gpu_utilization
target:
type: AverageValue
averageValue: {{ . }}
{{- end }}
{{- with .Values.autoscaling.targetGPUMemoryUtilizationRatio }}
- type: Pods
pods:
metric:
name: gpu_memory_utilization_ratio
target:
type: AverageValue
averageValue: {{ . }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions applications/worker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ autoscaling:
maxReplicas: 10
targetCPUUtilizationPercentage: 50
targetMemoryUtilizationPercentage: 50
targetGPUUtilizationPercentage: 100
targetGPUMemoryUtilizationRatio: 1
behavior:
enabled: false
scaleDown:
Expand Down
Loading