-
Notifications
You must be signed in to change notification settings - Fork 121
/
deployment.yaml
84 lines (84 loc) · 2.95 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: {{ template "app.name" . }}
{{- if .Values.deployment.additionalLabels }}
{{- toYaml .Values.deployment.additionalLabels | nindent 4 }}
{{- end }}
name: {{ template "app.name" . }}
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ .Values.deployment.replicas }}
selector:
matchLabels:
app: {{ template "app.name" . }}
{{- if .Values.deployment.updateStrategy }}
strategy: {{- toYaml .Values.deployment.updateStrategy | nindent 4 }}
{{- end }}
template:
metadata:
labels:
app: {{ template "app.name" . }}
{{- if .Values.deployment.additionalPodLabels }}
{{- toYaml .Values.deployment.additionalPodLabels | nindent 8 }}
{{- end }}
{{- if .Values.deployment.additionalPodAnnotations }}
annotations: {{- toYaml .Values.deployment.additionalPodAnnotations | nindent 8 }}
{{- end }}
spec:
{{- if .Values.deployment.affinity }}
affinity:
{{- toYaml .Values.deployment.affinity | nindent 8 }}
{{- end }}
containers:
- args:
- --model-id
- {{ .Values.deployment.args.modelId }}
- --max-input-length
- {{ .Values.deployment.args.maxInputLength | quote }}
- --max-total-tokens
- {{ .Values.deployment.args.maxTotalTokens | quote }}
- --max-batch-total-tokens
- {{ .Values.deployment.args.maxBatchTotalTokens | quote }}
- --max-batch-prefill-tokens
- {{ .Values.deployment.args.maxBatchPrefillTokens | quote }}
- --sharded
- {{ .Values.deployment.args.sharded | quote }}
env:
- name: PORT
value: "8000"
- name: HUGGING_FACE_HUB_TOKEN
value: {{ .Values.deployment.env.huggingFaceHubToken | quote }}
image: {{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}
imagePullPolicy: IfNotPresent
livenessProbe: {{ toYaml .Values.deployment.livenessProbe | nindent 10 }}
name: lorax
ports:
- containerPort: 8000
name: http
protocol: TCP
readinessProbe: {{ toYaml .Values.deployment.readinessProbe | nindent 10 }}
resources: {{ toYaml .Values.deployment.resources | nindent 10 }}
volumeMounts:
- mountPath: /data
name: data
- mountPath: /dev/shm
name: shm
{{- if .Values.deployment.tolerations }}
tolerations:
{{- toYaml .Values.deployment.tolerations | nindent 6 }}
{{- end }}
nodeSelector: {{ toYaml .Values.deployment.nodeSelector | nindent 8 }}
restartPolicy: Always
schedulerName: default-scheduler
terminationGracePeriodSeconds: 30
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.deployment.priorityClassName | quote }}
{{- end }}
volumes:
- emptyDir:
medium: Memory
name: shm
- emptyDir:
name: data