Skip to content

Commit b4d7ac1

Browse files
committed
[Feat] Add per-model custom labels and podLabels to modelSpec
Signed-off-by: Nasir Amin <nasir.amin@outlook.com>
1 parent 7b9c025 commit b4d7ac1

4 files changed

Lines changed: 65 additions & 0 deletions

File tree

helm/templates/deployment-vllm-multi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ metadata:
2626
helm-release-name: {{ .Release.Name }}
2727
{{- include "chart.engineStandardLabels" (dict "releaseName" .Release.Name "modelName" $modelSpec.name "chartName" .Chart.Name) | nindent 4 }}
2828
{{- include "chart.engineLabels" . | nindent 4 }}
29+
{{- with $modelSpec.labels }}
30+
{{- toYaml . | nindent 4 }}
31+
{{- end }}
2932
spec:
3033
{{- if not (and $modelSpec.keda $modelSpec.keda.enabled) }}
3134
replicas: {{ $modelSpec.replicaCount }}
@@ -49,6 +52,9 @@ spec:
4952
helm-release-name: {{ .Release.Name }}
5053
{{- include "chart.engineStandardLabels" (dict "releaseName" .Release.Name "modelName" $modelSpec.name "chartName" .Chart.Name) | nindent 8 }}
5154
{{- include "chart.engineLabels" . | nindent 8 }}
55+
{{- with $modelSpec.podLabels }}
56+
{{- toYaml . | nindent 8 }}
57+
{{- end }}
5258
spec:
5359
{{- if $modelSpec.priorityClassName }}
5460
priorityClassName: {{ $modelSpec.priorityClassName | quote }}

helm/tests/deployment-vllm-multi_test.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,53 @@ tests:
176176
fieldRef:
177177
fieldPath: status.podIP
178178

179+
- it: should render per-model custom labels and podLabels
180+
release:
181+
name: vllm
182+
set:
183+
servingEngineSpec:
184+
enableEngine: true
185+
modelSpec:
186+
- name: "test-model"
187+
labels:
188+
gpu-size: large
189+
team: ml-platform
190+
podLabels:
191+
cost-center: ml-infra
192+
gpu-type: a100
193+
repository: "vllm/vllm-openai"
194+
tag: "latest"
195+
modelURL: "facebook/opt-125m"
196+
replicaCount: 1
197+
requestCPU: 1
198+
requestMemory: "1Gi"
199+
requestGPU: 1
200+
asserts:
201+
- hasDocuments:
202+
count: 1
203+
- documentIndex: 0
204+
isSubset:
205+
path: metadata.labels
206+
content:
207+
gpu-size: large
208+
team: ml-platform
209+
- documentIndex: 0
210+
isSubset:
211+
path: spec.template.metadata.labels
212+
content:
213+
cost-center: ml-infra
214+
gpu-type: a100
215+
- documentIndex: 0
216+
isNotSubset:
217+
path: spec.selector.matchLabels
218+
content:
219+
gpu-size: large
220+
- documentIndex: 0
221+
isNotSubset:
222+
path: spec.selector.matchLabels
223+
content:
224+
cost-center: ml-infra
225+
179226
- it: should render two models, one with chat templates
180227
release:
181228
name: vllm

helm/values.schema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,10 @@
10891089
"description": "The annotations to add to the deployment",
10901090
"type": "object"
10911091
},
1092+
"labels": {
1093+
"description": "Additional labels to add to the deployment",
1094+
"type": "object"
1095+
},
10921096
"enableLoRA": {
10931097
"description": "Whether to enable LoRA",
10941098
"type": "boolean"
@@ -1376,6 +1380,10 @@
13761380
"description": "The annotations to add to the pods",
13771381
"type": "object"
13781382
},
1383+
"podLabels": {
1384+
"description": "Additional labels to add to the pods",
1385+
"type": "object"
1386+
},
13791387
"priorityClassName": {
13801388
"description": "The name of the priority class name for the deployment",
13811389
"type": "string"

helm/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ servingEngineSpec:
3131
annotations: {}
3232
# -- The annotations to add to the pods
3333
podAnnotations: {}
34+
# -- Additional labels to add to the deployment
35+
labels: {}
36+
# -- Additional labels to add to the pods
37+
podLabels: {}
3438
# -- The name of the service account to use for the deployment
3539
serviceAccountName: ""
3640
# -- The name of the priority class name for the deployment

0 commit comments

Comments
 (0)