Skip to content

Commit

Permalink
[Feat, Misc] Disable PVC creation when pvcStorage is not provided (#…
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
ApostaC authored Feb 25, 2025
1 parent c558692 commit fb0cb90
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 19 deletions.
4 changes: 0 additions & 4 deletions .github/values-01-minimal-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ servingEngineSpec:
requestMemory: "16Gi"
requestGPU: 1

pvcStorage: "10Gi"
pvcAccessMode:
- ReadWriteOnce

routerSpec:
repository: "localhost:5000/git-act-router"
imagePullPolicy: "IfNotPresent"
Expand Down
2 changes: 1 addition & 1 deletion helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.10
version: 0.0.11

maintainers:
- name: apostac
8 changes: 8 additions & 0 deletions helm/templates/deployment-vllm-multi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ spec:
imagePullPolicy: IfNotPresent
env:
- name: HF_HOME
{{- if hasKey $modelSpec "pvcStorage" }}
value: /data
{{- else }}
value: /tmp
{{- end }}
{{- with $modelSpec.vllmConfig}}
{{- if hasKey . "v1" }}
- name: VLLM_USE_V1
Expand Down Expand Up @@ -115,19 +119,23 @@ spec:
containerPort: {{ include "chart.container-port" . }}
{{- include "chart.probes" . | indent 10 }}
resources: {{- include "chart.resources" $modelSpec | nindent 12 }}
{{- if hasKey $modelSpec "pvcStorage" }}
volumeMounts:
- name: {{ .Release.Name }}-storage
mountPath: /data
{{- end }}
{{- with $modelSpec.vllmConfig }}
{{- if hasKey $modelSpec.vllmConfig "tensorParallelSize"}}
- name: shm
mountPath: /dev/shm
{{- end}}
{{- end}}
volumes:
{{- if hasKey $modelSpec "pvcStorage" }}
- name: {{ .Release.Name }}-storage
persistentVolumeClaim:
claimName: "{{ .Release.Name }}-{{$modelSpec.name}}-storage-claim"
{{- end }}
{{- with $modelSpec.vllmConfig }}
{{- if hasKey $modelSpec.vllmConfig "tensorParallelSize"}}
- name: shm
Expand Down
2 changes: 2 additions & 0 deletions helm/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- range $modelSpec := .Values.servingEngineSpec.modelSpec }}
{{- with $ -}}
{{- if and (hasKey $modelSpec "pvcStorage") (not (empty $modelSpec.pvcStorage)) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand All @@ -24,5 +25,6 @@ spec:
{{- toYaml $modelSpec.pvcMatchLabels | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
---
{{- end }}
8 changes: 4 additions & 4 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ servingEngineSpec:
# - requestMemory: (string) The amount of memory requested for the model, e.g., "16Gi"
# - requestGPU: (int) The number of GPUs requested for the model, e.g., 1
#
# - pvcStorage: (string) The amount of storage requested for the model, e.g., "50Gi"

This comment has been minimized.

Copy link
@01967974760

01967974760 Feb 27, 2025

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-storage-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Gi
storageClassName: standard
selector:
matchLabels:
model: "opt125m"

# - pvcAccessMode: (list) The access mode policy for the mounted volume, e.g., ["ReadWriteOnce"]

This comment has been minimized.

Copy link
@01967974760

01967974760 Feb 27, 2025

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-storage-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Gi
storageClassName: standard
selector:
matchLabels:
model: "opt125m"

This comment has been minimized.

Copy link
@01967974760

01967974760 Feb 27, 2025

pvcMatchLabels:
model: "opt125m"

# - storageClass: (String) The storage class of the PVC e.g., "", default is ""
# - pvcMatchLabels: (optional, map) The labels to match the PVC, e.g., {model: "opt125m"}

This comment has been minimized.

Copy link
@01967974760

01967974760 Feb 27, 2025

Jack666

This comment has been minimized.

Copy link
@01967974760

01967974760 Feb 27, 2025

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-storage-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Gi
storageClassName: standard
selector:
matchLabels:
model: "opt125m"

This comment has been minimized.

Copy link
@01967974760

01967974760 Feb 27, 2025

pvcAccessMode: ["ReadWriteOnce"]

# - pvcStorage: (Optional, string) The amount of storage requested for the model, e.g., "50Gi".
# - pvcAccessMode: (Optional, list) The access mode policy for the mounted volume, e.g., ["ReadWriteOnce"]
# - storageClass: (Optional, String) The storage class of the PVC e.g., "", default is ""
# - pvcMatchLabels: (Optional, map) The labels to match the PVC, e.g., {model: "opt125m"}
#
# - vllmConfig: (optional, map) The configuration for the VLLM model, supported options are:
# - enablePrefixCaching: (optional, bool) Enable prefix caching, e.g., false
Expand Down
2 changes: 0 additions & 2 deletions tutorials/01-minimal-helm-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ servingEngineSpec:
requestMemory: "16Gi"
requestGPU: 1

pvcStorage: "10Gi"
```

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

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

Expand Down
4 changes: 0 additions & 4 deletions tutorials/assets/values-01-2pods-minimal-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ servingEngineSpec:
requestMemory: "16Gi"
requestGPU: 0.5

pvcStorage: "10Gi"
pvcAccessMode:
- ReadWriteMany

vllmConfig:
maxModelLen: 1024
extraArgs: ["--disable-log-requests", "--gpu-memory-utilization", "0.4"]
4 changes: 0 additions & 4 deletions tutorials/assets/values-01-minimal-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@ servingEngineSpec:
requestCPU: 6
requestMemory: "16Gi"
requestGPU: 1

pvcStorage: "10Gi"
pvcAccessMode:
- ReadWriteOnce

0 comments on commit fb0cb90

Please sign in to comment.