-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yaml
230 lines (217 loc) · 5.33 KB
/
deploy.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
apiVersion: v1
kind: ConfigMap
metadata:
name: env-configmap
labels:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: env-configmap
data:
# STORE_URL: 's3://wbrannon-lsm-data/speechbox/'
STORE_URL: 'file:///hostdata/'
LOG_LEVEL: INFO
POLL_INTERVAL: '10'
CHUNK_SIZE_SECONDS: '30'
INGEST_CHUNK_ERROR_THRESHOLD: '-1'
INGEST_N_TASKS_PER_CONTAINER: '10'
WHISPER_VERSION: large-v3
COMPUTE_TYPE: int8
REMOVE_AUDIO: 'true'
TRANSCRIBE_CHUNK_ERROR_THRESHOLD: '1'
---
apiVersion: v1
kind: Service
metadata:
name: postgres-service
labels:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: postgres
spec:
selector:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: postgres
ports:
- protocol: TCP
port: 5432
targetPort: 5432
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
labels:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: postgres
spec:
accessModes:
- ReadWriteOncePod
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
labels:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: postgres
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: postgres
template:
metadata:
labels:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: postgres
spec:
restartPolicy: Always
volumes:
- name: postgres-storage
persistentVolumeClaim:
claimName: postgres-pvc
- name: output
hostPath:
path: /hostdata
type: Directory
initContainers:
- name: volume-permissions
image: busybox
command: ['sh', '-c', 'chown -R 999:999 /var/lib/postgresql/data']
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/postgresql/data
containers:
- name: postgres
image: audio-scraper-postgres
imagePullPolicy: IfNotPresent
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/postgresql/data
- name: output
mountPath: /hostdata
envFrom:
- configMapRef:
name: env-configmap
- secretRef:
name: env-secrets
livenessProbe:
exec:
command:
- pg_isready
failureThreshold: 5
periodSeconds: 30
timeoutSeconds: 30
readinessProbe:
exec:
command:
- pg_isready
failureThreshold: 5
periodSeconds: 30
timeoutSeconds: 30
resources:
requests:
cpu: 50m
memory: 50Mi
limits:
cpu: 1000m
memory: 256Mi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ingest
labels:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: ingest
spec:
replicas: 3
selector:
matchLabels:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: ingest
template:
metadata:
labels:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: ingest
spec:
restartPolicy: Always
volumes:
- name: output
hostPath:
path: /hostdata
type: Directory
containers:
- name: ingest
image: audio-scraper-ingest
imagePullPolicy: IfNotPresent
volumeMounts:
- name: output
mountPath: /hostdata
env:
- name: POSTGRES_HOST
value: postgres-service
envFrom:
- configMapRef:
name: env-configmap
- secretRef:
name: env-secrets
resources:
requests:
cpu: 384m
memory: 192Mi
limits:
cpu: 1000m
memory: 256Mi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: transcribe
labels:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: transcribe
spec:
replicas: 5
selector:
matchLabels:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: transcribe
template:
metadata:
labels:
app.kubernetes.io/name: audio-scraper
app.kubernetes.io/component: transcribe
spec:
restartPolicy: Always
volumes:
- name: output
hostPath:
path: /hostdata
type: Directory
containers:
- name: transcribe
image: audio-scraper-transcribe
imagePullPolicy: IfNotPresent
volumeMounts:
- name: output
mountPath: /hostdata
env:
- name: POSTGRES_HOST
value: postgres-service
envFrom:
- configMapRef:
name: env-configmap
- secretRef:
name: env-secrets
resources:
requests:
cpu: 1100m
memory: 3584Mi
limits:
cpu: 2000m
memory: 5120Mi
nvidia.com/gpu: 1