Skip to content

Commit fb0cb90

Browse files
authored
[Feat, Misc] Disable PVC creation when pvcStorage is not provided (#176)
* [Add] fix for PVC storage Signed-off-by: ApostaC <[email protected]> * [Update] the tutorial of minimal example to exclude PVC configurations Signed-off-by: ApostaC <[email protected]> * Bumping the helm chart version Signed-off-by: ApostaC <[email protected]> * [fix] condition checking in pvc.yaml Signed-off-by: ApostaC <[email protected]> --------- Signed-off-by: ApostaC <[email protected]>
1 parent c558692 commit fb0cb90

File tree

8 files changed

+15
-19
lines changed

8 files changed

+15
-19
lines changed

.github/values-01-minimal-example.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ servingEngineSpec:
1212
requestMemory: "16Gi"
1313
requestGPU: 1
1414

15-
pvcStorage: "10Gi"
16-
pvcAccessMode:
17-
- ReadWriteOnce
18-
1915
routerSpec:
2016
repository: "localhost:5000/git-act-router"
2117
imagePullPolicy: "IfNotPresent"

helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.0.10
18+
version: 0.0.11
1919

2020
maintainers:
2121
- name: apostac

helm/templates/deployment-vllm-multi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ spec:
6868
imagePullPolicy: IfNotPresent
6969
env:
7070
- name: HF_HOME
71+
{{- if hasKey $modelSpec "pvcStorage" }}
7172
value: /data
73+
{{- else }}
74+
value: /tmp
75+
{{- end }}
7276
{{- with $modelSpec.vllmConfig}}
7377
{{- if hasKey . "v1" }}
7478
- name: VLLM_USE_V1
@@ -115,19 +119,23 @@ spec:
115119
containerPort: {{ include "chart.container-port" . }}
116120
{{- include "chart.probes" . | indent 10 }}
117121
resources: {{- include "chart.resources" $modelSpec | nindent 12 }}
122+
{{- if hasKey $modelSpec "pvcStorage" }}
118123
volumeMounts:
119124
- name: {{ .Release.Name }}-storage
120125
mountPath: /data
126+
{{- end }}
121127
{{- with $modelSpec.vllmConfig }}
122128
{{- if hasKey $modelSpec.vllmConfig "tensorParallelSize"}}
123129
- name: shm
124130
mountPath: /dev/shm
125131
{{- end}}
126132
{{- end}}
127133
volumes:
134+
{{- if hasKey $modelSpec "pvcStorage" }}
128135
- name: {{ .Release.Name }}-storage
129136
persistentVolumeClaim:
130137
claimName: "{{ .Release.Name }}-{{$modelSpec.name}}-storage-claim"
138+
{{- end }}
131139
{{- with $modelSpec.vllmConfig }}
132140
{{- if hasKey $modelSpec.vllmConfig "tensorParallelSize"}}
133141
- name: shm

helm/templates/pvc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{- range $modelSpec := .Values.servingEngineSpec.modelSpec }}
22
{{- with $ -}}
3+
{{- if and (hasKey $modelSpec "pvcStorage") (not (empty $modelSpec.pvcStorage)) }}
34
apiVersion: v1
45
kind: PersistentVolumeClaim
56
metadata:
@@ -24,5 +25,6 @@ spec:
2425
{{- toYaml $modelSpec.pvcMatchLabels | nindent 8 }}
2526
{{- end }}
2627
{{- end }}
28+
{{- end }}
2729
---
2830
{{- end }}

helm/values.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ servingEngineSpec:
2121
# - requestMemory: (string) The amount of memory requested for the model, e.g., "16Gi"
2222
# - requestGPU: (int) The number of GPUs requested for the model, e.g., 1
2323
#
24-
# - pvcStorage: (string) The amount of storage requested for the model, e.g., "50Gi"
25-
# - pvcAccessMode: (list) The access mode policy for the mounted volume, e.g., ["ReadWriteOnce"]
26-
# - storageClass: (String) The storage class of the PVC e.g., "", default is ""
27-
# - pvcMatchLabels: (optional, map) The labels to match the PVC, e.g., {model: "opt125m"}
24+
# - pvcStorage: (Optional, string) The amount of storage requested for the model, e.g., "50Gi".
25+
# - pvcAccessMode: (Optional, list) The access mode policy for the mounted volume, e.g., ["ReadWriteOnce"]
26+
# - storageClass: (Optional, String) The storage class of the PVC e.g., "", default is ""
27+
# - pvcMatchLabels: (Optional, map) The labels to match the PVC, e.g., {model: "opt125m"}
2828
#
2929
# - vllmConfig: (optional, map) The configuration for the VLLM model, supported options are:
3030
# - enablePrefixCaching: (optional, bool) Enable prefix caching, e.g., false

tutorials/01-minimal-helm-installation.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ servingEngineSpec:
4949
requestMemory: "16Gi"
5050
requestGPU: 1
5151

52-
pvcStorage: "10Gi"
5352
```
5453

5554
Explanation of the key fields:
@@ -62,7 +61,6 @@ Explanation of the key fields:
6261
- **`replicaCount`**: Sets the number of replicas to deploy.
6362
- **`requestCPU` and `requestMemory`**: Specifies the CPU and memory resource requests for the pod.
6463
- **`requestGPU`**: Specifies the number of GPUs required.
65-
- **`pvcStorage`**: Allocates persistent storage for the model.
6664

6765
**Note:** If you intend to set up TWO vllm pods, please refer to `tutorials/assets/values-01-2pods-minimal-example.yaml`.
6866

tutorials/assets/values-01-2pods-minimal-example.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ servingEngineSpec:
1414
requestMemory: "16Gi"
1515
requestGPU: 0.5
1616

17-
pvcStorage: "10Gi"
18-
pvcAccessMode:
19-
- ReadWriteMany
20-
2117
vllmConfig:
2218
maxModelLen: 1024
2319
extraArgs: ["--disable-log-requests", "--gpu-memory-utilization", "0.4"]

tutorials/assets/values-01-minimal-example.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,3 @@ servingEngineSpec:
1111
requestCPU: 6
1212
requestMemory: "16Gi"
1313
requestGPU: 1
14-
15-
pvcStorage: "10Gi"
16-
pvcAccessMode:
17-
- ReadWriteOnce

0 commit comments

Comments
 (0)