Skip to content

Commit cf4e347

Browse files
committed
✨(helm) add support multiple transcribe worker / endpoint
Udate the helm chart to support multiple transcribe worker in the summary service. This is useful when using multiple WhisperX instances to have one deployment for each endpoint. This enables some kind of horizontal scaling (we still keep one call per WhisperX endpoint but can have multiple WhisperX endpoints)
1 parent fc260b2 commit cf4e347

4 files changed

Lines changed: 69 additions & 40 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to
1111
### Added
1212

1313
- 🔒️(backend) add validation of Room.configuration
14+
- ✨(helm) add support multiple transcribe worker / endpoint #1247
1415

1516
### Fixed
1617

bin/Tiltfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ k8s_resource('meet-backend', resource_deps=['postgresql', 'minio', 'redis', 'liv
109109
k8s_resource('meet-celery-backend', resource_deps=['redis'])
110110
k8s_resource('meet-celery-summarize', resource_deps=['redis'])
111111
k8s_resource('meet-celery-summary-backend', resource_deps=['redis'])
112-
k8s_resource('meet-celery-transcribe', resource_deps=['redis'])
112+
k8s_resource('meet-celery-transcribe-default', resource_deps=['redis'])
113113
k8s_resource('meet-backend-migrate', resource_deps=['meet-backend'])
114114
k8s_resource('livekit-livekit-server', resource_deps=['redis'])
115115
k8s_resource('livekit-livekit-server-test-connection', resource_deps=['livekit-livekit-server'])
Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,128 @@
1-
{{- $envVars := include "meet.common.env" (list . .Values.celeryTranscribe) -}}
2-
{{- $fullName := include "meet.celeryTranscribe.fullname" . -}}
1+
{{- $sharedEnvVars := default (dict) .Values.celeryTranscribe.envVars -}}
32
{{- $component := "celery-transcribe" -}}
3+
4+
{{- range $idx, $instance := .Values.celeryTranscribe.instances }}
5+
{{- $instanceValues := merge $instance $.Values.celeryTranscribe }}
6+
{{- $fullName := printf "%s-%s" (include "meet.celeryTranscribe.fullname" $) $instance.name }}
7+
{{- $extraInstanceEnvVars := default (dict) $instance.extraEnvVars -}}
8+
{{- $mergedInstanceEnvVars := merge $extraInstanceEnvVars $sharedEnvVars -}}
9+
{{- $fakeInstanceObjectForEnvHelper := dict "envVars" $mergedInstanceEnvVars -}}
10+
{{- $envVars := include "meet.common.env" (list . $fakeInstanceObjectForEnvHelper) -}}
411
apiVersion: apps/v1
512
kind: Deployment
613
metadata:
714
name: {{ $fullName }}
815
annotations:
9-
{{- with .Values.celeryTranscribe.dpAnnotations }}
16+
{{- with $instanceValues.dpAnnotations }}
1017
{{- toYaml . | nindent 4 }}
1118
{{- end }}
12-
namespace: {{ .Release.Namespace | quote }}
19+
namespace: {{ $.Release.Namespace | quote }}
1320
labels:
14-
{{- include "meet.common.labels" (list . $component) | nindent 4 }}
21+
{{- include "meet.common.labels" (list $ $component) | nindent 4 }}
22+
instance: {{ $instance.name }}
1523
spec:
16-
replicas: {{ .Values.celeryTranscribe.replicas }}
24+
replicas: {{ $instanceValues.replicas }}
1725
selector:
1826
matchLabels:
19-
{{- include "meet.common.selectorLabels" (list . $component) | nindent 6 }}
27+
{{- include "meet.common.selectorLabels" (list $ $component) | nindent 6 }}
28+
instance: {{ $instance.name }}
2029
template:
2130
metadata:
2231
annotations:
23-
{{- with .Values.celeryTranscribe.podAnnotations }}
32+
{{- with $instanceValues.podAnnotations }}
2433
{{- toYaml . | nindent 8 }}
2534
{{- end }}
2635
labels:
27-
{{- include "meet.common.selectorLabels" (list . $component) | nindent 8 }}
36+
{{- include "meet.common.selectorLabels" (list $ $component) | nindent 8 }}
37+
instance: {{ $instance.name }}
2838
spec:
2939
{{- if $.Values.image.credentials }}
3040
imagePullSecrets:
31-
- name: {{ include "meet.secret.dockerconfigjson.name" (dict "fullname" (include "meet.fullname" .) "imageCredentials" $.Values.image.credentials) }}
41+
- name: {{ include "meet.secret.dockerconfigjson.name" (dict "fullname" (include "meet.fullname" $) "imageCredentials" $.Values.image.credentials) }}
3242
{{- end }}
33-
shareProcessNamespace: {{ .Values.celeryTranscribe.shareProcessNamespace }}
34-
{{- with .Values.celeryTranscribe.podSecurityContext }}
43+
shareProcessNamespace: {{ $instanceValues.shareProcessNamespace }}
44+
{{- with $instanceValues.podSecurityContext }}
3545
securityContext:
3646
{{- toYaml . | nindent 8 }}
3747
{{- end }}
3848
containers:
39-
{{- with .Values.celeryTranscribe.sidecars }}
49+
{{- with $instanceValues.sidecars }}
4050
{{- toYaml . | nindent 8 }}
4151
{{- end }}
42-
- name: {{ .Chart.Name }}
43-
image: "{{ (.Values.celeryTranscribe.image | default dict).repository | default .Values.image.repository }}:{{ (.Values.celeryTranscribe.image | default dict).tag | default .Values.image.tag }}"
44-
imagePullPolicy: {{ (.Values.celeryTranscribe.image | default dict).pullPolicy | default .Values.image.pullPolicy }}
45-
{{- with .Values.celeryTranscribe.command }}
52+
- name: {{ $.Chart.Name }}
53+
image: "{{ ($instanceValues.image | default dict).repository | default $.Values.image.repository }}:{{ ($instanceValues.image | default dict).tag | default $.Values.image.tag }}"
54+
imagePullPolicy: {{ ($instanceValues.image | default dict).pullPolicy | default $.Values.image.pullPolicy }}
55+
{{- with $instanceValues.command }}
4656
command:
4757
{{- toYaml . | nindent 12 }}
4858
{{- end }}
49-
{{- with .Values.celeryTranscribe.args }}
59+
{{- with $instanceValues.args }}
5060
args:
5161
{{- toYaml . | nindent 12 }}
5262
{{- end }}
5363
env:
5464
{{- if $envVars }}
5565
{{- $envVars | indent 12 }}
5666
{{- end }}
57-
{{- with .Values.celeryTranscribe.securityContext }}
67+
{{- with $instanceValues.securityContext }}
5868
securityContext:
5969
{{- toYaml . | nindent 12 }}
6070
{{- end }}
6171
ports:
6272
- name: http
63-
containerPort: {{ .Values.celeryTranscribe.service.targetPort }}
73+
containerPort: {{ $instanceValues.service.targetPort }}
6474
protocol: TCP
65-
{{- if .Values.celeryTranscribe.probes.liveness }}
75+
{{- if $instanceValues.probes.liveness }}
6676
livenessProbe:
67-
{{- include "meet.probes.abstract" (merge .Values.celeryTranscribe.probes.liveness (dict "targetPort" .Values.celeryTranscribe.service.targetPort )) | nindent 12 }}
77+
{{- include "meet.probes.abstract" (merge $instanceValues.probes.liveness (dict "targetPort" $instanceValues.service.targetPort)) | nindent 12 }}
6878
{{- end }}
69-
{{- if .Values.celeryTranscribe.probes.readiness }}
79+
{{- if $instanceValues.probes.readiness }}
7080
readinessProbe:
71-
{{- include "meet.probes.abstract" (merge .Values.celeryTranscribe.probes.readiness (dict "targetPort" .Values.celeryTranscribe.service.targetPort )) | nindent 12 }}
81+
{{- include "meet.probes.abstract" (merge $instanceValues.probes.readiness (dict "targetPort" $instanceValues.service.targetPort)) | nindent 12 }}
7282
{{- end }}
73-
{{- if .Values.celeryTranscribe.probes.startup }}
83+
{{- if $instanceValues.probes.startup }}
7484
startupProbe:
75-
{{- include "meet.probes.abstract" (merge .Values.celeryTranscribe.probes.startup (dict "targetPort" .Values.celeryTranscribe.service.targetPort )) | nindent 12 }}
85+
{{- include "meet.probes.abstract" (merge $instanceValues.probes.startup (dict "targetPort" $instanceValues.service.targetPort)) | nindent 12 }}
7686
{{- end }}
77-
{{- with .Values.celeryTranscribe.resources }}
87+
{{- with $instanceValues.resources }}
7888
resources:
7989
{{- toYaml . | nindent 12 }}
8090
{{- end }}
8191
volumeMounts:
82-
{{- range $index, $value := .Values.mountFiles }}
92+
{{- range $index, $value := $.Values.mountFiles }}
8393
- name: "files-{{ $index }}"
8494
mountPath: {{ $value.path }}
8595
subPath: content
8696
{{- end }}
87-
{{- range $name, $volume := .Values.celeryTranscribe.persistence }}
97+
{{- range $name, $volume := $instanceValues.persistence }}
8898
- name: "{{ $name }}"
8999
mountPath: "{{ $volume.mountPath }}"
90100
{{- end }}
91-
{{- range .Values.celeryTranscribe.extraVolumeMounts }}
101+
{{- range $instanceValues.extraVolumeMounts }}
92102
- name: {{ .name }}
93103
mountPath: {{ .mountPath }}
94104
subPath: {{ .subPath | default "" }}
95105
readOnly: {{ .readOnly }}
96106
{{- end }}
97-
{{- with .Values.celeryTranscribe.nodeSelector }}
107+
{{- with $instanceValues.nodeSelector }}
98108
nodeSelector:
99109
{{- toYaml . | nindent 8 }}
100110
{{- end }}
101-
{{- with .Values.celeryTranscribe.affinity }}
111+
{{- with $instanceValues.affinity }}
102112
affinity:
103113
{{- toYaml . | nindent 8 }}
104114
{{- end }}
105-
{{- with .Values.celeryTranscribe.tolerations }}
115+
{{- with $instanceValues.tolerations }}
106116
tolerations:
107117
{{- toYaml . | nindent 8 }}
108118
{{- end }}
109119
volumes:
110-
{{- range $index, $value := .Values.mountFiles }}
120+
{{- range $index, $value := $.Values.mountFiles }}
111121
- name: "files-{{ $index }}"
112122
configMap:
113123
name: "{{ include "meet.fullname" $ }}-files-{{ $index }}"
114124
{{- end }}
115-
{{- range $name, $volume := .Values.celeryTranscribe.persistence }}
125+
{{- range $name, $volume := $instanceValues.persistence }}
116126
- name: "{{ $name }}"
117127
{{- if eq $volume.type "emptyDir" }}
118128
emptyDir: {}
@@ -121,7 +131,7 @@ spec:
121131
claimName: "{{ $fullName }}-{{ $name }}"
122132
{{- end }}
123133
{{- end }}
124-
{{- range .Values.celeryTranscribe.extraVolumes }}
134+
{{- range $instanceValues.extraVolumes }}
125135
- name: {{ .name }}
126136
{{- if .existingClaim }}
127137
persistentVolumeClaim:
@@ -143,15 +153,18 @@ spec:
143153
{{- end }}
144154
{{- end }}
145155
---
146-
{{ if .Values.celeryTranscribe.pdb.enabled }}
156+
{{ if $instanceValues.pdb.enabled }}
147157
apiVersion: policy/v1
148158
kind: PodDisruptionBudget
149159
metadata:
150160
name: {{ $fullName }}
151-
namespace: {{ .Release.Namespace | quote }}
161+
namespace: {{ $.Release.Namespace | quote }}
152162
spec:
153163
maxUnavailable: 1
154164
selector:
155165
matchLabels:
156-
{{- include "meet.common.selectorLabels" (list . $component) | nindent 6 }}
166+
{{- include "meet.common.selectorLabels" (list $ $component) | nindent 6 }}
167+
instance: {{ $instance.name }}
168+
---
157169
{{ end }}
170+
{{- end }}

src/helm/meet/values.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,21 @@ celeryTranscribe:
848848
pdb:
849849
enabled: false
850850

851+
## @param celeryTranscribe.instances List of celeryTranscribe instances to deploy. Each entry creates a dedicated Deployment. Useful when wanting to use multiple instances of WhisperX (configure each endpoint in the extraEnv value specific to that instance).
852+
## @extra celeryTranscribe.instances[].name Unique name suffix for the instance (used in the Deployment name and pod labels)
853+
## @extra celeryTranscribe.instances[].replicas Override the number of replicas for this specific instance
854+
## @extra celeryTranscribe.instances[].extraEnvVars Additional environment variables for this specific instance (same structure as envVars)
855+
## @extra celeryTranscribe.instances[].command Override the container command for this specific instance
856+
## @extra celeryTranscribe.instances[].args Override the container args for this specific instance
857+
## @extra celeryTranscribe.instances[].resources Override resource requirements for this specific instance
858+
## @extra celeryTranscribe.instances[].nodeSelector Override node selector for this specific instance
859+
## @extra celeryTranscribe.instances[].affinity Override affinity for this specific instance
860+
## @extra celeryTranscribe.instances[].tolerations Override tolerations for this specific instance
861+
## @extra celeryTranscribe.instances[].pdb.enabled Enable pdb for this specific instance
862+
instances:
863+
- name: default
864+
extraEnvVars: {}
865+
851866
## @section celerySummarize
852867

853868
celerySummarize:

0 commit comments

Comments
 (0)