|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + labels: |
| 5 | + llm-model: {{ .Release.Name }} |
| 6 | + annotations: |
| 7 | + porter.run/hf-llm-model-version: "{{ .Chart.Version }}" |
| 8 | + name: {{ .Release.Name }}-workload |
| 9 | +spec: |
| 10 | + replicas: 1 |
| 11 | + strategy: |
| 12 | + type: Recreate |
| 13 | + selector: |
| 14 | + matchLabels: |
| 15 | + llm-model: {{ .Release.Name }} |
| 16 | + template: |
| 17 | + metadata: |
| 18 | + labels: |
| 19 | + llm-model: {{ .Release.Name }} |
| 20 | + spec: |
| 21 | + tolerations: |
| 22 | + - key: "removable" |
| 23 | + operator: "Equal" |
| 24 | + value: "true" |
| 25 | + effect: "NoSchedule" |
| 26 | + {{- if .Values.tolerations }} |
| 27 | + {{- toYaml .Values.tolerations | nindent 8 }} |
| 28 | + {{- end }} |
| 29 | + containers: |
| 30 | + - command: |
| 31 | + - python3 |
| 32 | + - -m |
| 33 | + - vllm.entrypoints.openai.api_server |
| 34 | + - --model |
| 35 | + - {{ .Values.modelID }} |
| 36 | + {{- if .Values.quantization }} |
| 37 | + - --quantization |
| 38 | + - {{ .Values.quantization }} |
| 39 | + {{- end }} |
| 40 | + - --download-dir |
| 41 | + - {{ .Values.modelDir }} |
| 42 | + - --gpu-memory-utilization={{ printf "%.2f" .Values.gpuMemoryUtilization }} |
| 43 | + {{- if .Values.dType}} |
| 44 | + - --dtype |
| 45 | + - {{ .Values.dType }} |
| 46 | + {{- end }} |
| 47 | + - --tensor-parallel-size={{ .Values.tensorParallelSize }} |
| 48 | + {{- if .Values.maxModelLen }} |
| 49 | + - --max-model-len={{ .Values.maxModelLen }} |
| 50 | + {{- end }} |
| 51 | + image: {{ .Values.vllmImage }} |
| 52 | + imagePullPolicy: Always |
| 53 | + env: |
| 54 | + - name: HF_TOKEN |
| 55 | + value: {{ .Values.huggingFaceToken }} |
| 56 | + ports: |
| 57 | + - containerPort: 8000 |
| 58 | + protocol: TCP |
| 59 | + name: https |
| 60 | + resources: |
| 61 | + requests: |
| 62 | + {{- if .Values.resources.requests.cpu }} |
| 63 | + cpu: {{ .Values.resources.requests.cpu }} |
| 64 | + {{- end }} |
| 65 | + {{- if .Values.resources.requests.memory }} |
| 66 | + memory: {{ .Values.resources.requests.memory }} |
| 67 | + {{- end }} |
| 68 | + {{- if .Values.resources.requests.nvidiaGpu }} |
| 69 | + nvidia.com/gpu: {{ .Values.resources.requests.nvidiaGpu }} |
| 70 | + {{- end }} |
| 71 | + limits: |
| 72 | + {{- if .Values.resources.limits.cpu }} |
| 73 | + cpu: {{ .Values.resources.limits.cpu }} |
| 74 | + {{- end }} |
| 75 | + {{- if .Values.resources.limits.memory }} |
| 76 | + memory: {{ .Values.resources.limits.memory }} |
| 77 | + {{- end }} |
| 78 | + {{- if .Values.resources.limits.nvidiaGpu }} |
| 79 | + nvidia.com/gpu: {{ .Values.resources.limits.nvidiaGpu }} |
| 80 | + {{- end }} |
| 81 | + volumeMounts: |
| 82 | + - name: model-volume |
| 83 | + mountPath: {{ .Values.modelDir }} |
| 84 | + name: vllm |
| 85 | + securityContext: |
| 86 | + allowPrivilegeEscalation: false |
| 87 | + terminationGracePeriodSeconds: 10 |
| 88 | + volumes: |
| 89 | + - name: model-volume |
| 90 | + persistentVolumeClaim: |
| 91 | + claimName: "{{ .Release.Name }}-model-pvc" |
0 commit comments