Skip to content

Commit 22cbf1c

Browse files
committed
✨(summary) add multi-tenant support and v2 tasks / API
Add multitenancy support to Summary sub-app. The V1 routes / tasks behave like before, with the default tenant being "meet". V2 routes / tasks support being called frm any tenant, and don't have meet related logic. V2 tasks are created in separate queues to avoid mix / match,i
1 parent 4f2c4bf commit 22cbf1c

19 files changed

Lines changed: 1087 additions & 91 deletions

bin/Tiltfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ k8s_resource('minio-bucket', resource_deps=['minio'])
101101
k8s_resource('meet-backend', resource_deps=['postgresql', 'minio', 'redis', 'livekit-livekit-server'])
102102
k8s_resource('meet-celery-backend', resource_deps=['redis'])
103103
k8s_resource('meet-celery-summarize', resource_deps=['redis'])
104+
k8s_resource('meet-celery-summary-backend', resource_deps=['redis'])
104105
k8s_resource('meet-celery-transcribe', resource_deps=['redis'])
105106
k8s_resource('meet-backend-migrate', resource_deps=['meet-backend'])
106107
k8s_resource('livekit-livekit-server', resource_deps=['redis'])

src/helm/env.d/dev-keycloak/values.meet.yaml.gotmpl

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ summary:
168168
AWS_S3_ACCESS_KEY_ID: meet
169169
AWS_S3_SECRET_ACCESS_KEY: password
170170
AWS_S3_SECURE_ACCESS: False
171+
AUTHORIZED_TENANTS: '[{"id": "dictaphone", "api_key": "dictaphone_token", "webhook_url": "http://dictaphone-backend.dictaphone.svc.cluster.local/api/v1.0/files/ai-webhook/", "webhook_api_key": "token_summary"}]'
171172
WHISPERX_API_KEY: your-secret-value
172173
WHISPERX_BASE_URL: https://configure-your-url.com
173174
WHISPERX_ASR_MODEL: large-v2
@@ -205,6 +206,7 @@ celeryTranscribe:
205206
AWS_S3_ACCESS_KEY_ID: meet
206207
AWS_S3_SECRET_ACCESS_KEY: password
207208
AWS_S3_SECURE_ACCESS: False
209+
AUTHORIZED_TENANTS: '[{"id": "dictaphone", "api_key": "dictaphone_token", "webhook_url": "http://dictaphone-backend.dictaphone.svc.cluster.local/api/v1.0/files/ai-webhook/", "webhook_api_key": "token_summary"}]'
208210
WHISPERX_API_KEY: your-secret-value
209211
WHISPERX_BASE_URL: https://configure-your-url.com
210212
WHISPERX_ASR_MODEL: large-v2
@@ -231,7 +233,7 @@ celeryTranscribe:
231233
- "--pool=solo"
232234
- "--loglevel=info"
233235
- "-Q"
234-
- "transcribe-queue"
236+
- "transcribe-queue,transcribe-queue-v2"
235237

236238
celerySummarize:
237239
replicas: 1
@@ -243,6 +245,7 @@ celerySummarize:
243245
AWS_S3_ACCESS_KEY_ID: meet
244246
AWS_S3_SECRET_ACCESS_KEY: password
245247
AWS_S3_SECURE_ACCESS: False
248+
AUTHORIZED_TENANTS: '[{"id": "dictaphone", "api_key": "dictaphone_token", "webhook_url": "http://dictaphone-backend.dictaphone.svc.cluster.local/api/v1.0/files/ai-webhook/", "webhook_api_key": "token_summary"}]'
246249
WHISPERX_API_KEY: your-secret-value
247250
WHISPERX_BASE_URL: https://configure-your-url.com
248251
WHISPERX_ASR_MODEL: large-v2
@@ -269,7 +272,46 @@ celerySummarize:
269272
- "--pool=solo"
270273
- "--loglevel=info"
271274
- "-Q"
272-
- "summarize-queue"
275+
- "summarize-queue,summarize-queue-v2"
276+
277+
celerySummaryBackend:
278+
replicas: 1
279+
envVars:
280+
APP_NAME: summary-microservice
281+
APP_API_TOKEN: password
282+
AWS_STORAGE_BUCKET_NAME: meet-media-storage
283+
AWS_S3_ENDPOINT_URL: http://minio.meet.svc.cluster.local:9000/
284+
AWS_S3_ACCESS_KEY_ID: meet
285+
AWS_S3_SECRET_ACCESS_KEY: password
286+
AWS_S3_SECURE_ACCESS: False
287+
AUTHORIZED_TENANTS: '[{"id": "dictaphone", "api_key": "dictaphone_token", "webhook_url": "http://dictaphone-backend.dictaphone.svc.cluster.local/api/v1.0/files/ai-webhook/", "webhook_api_key": "token_summary"}]'
288+
WHISPERX_API_KEY: your-secret-value
289+
WHISPERX_BASE_URL: https://configure-your-url.com
290+
WHISPERX_ASR_MODEL: large-v2
291+
WHISPERX_DEFAULT_LANGUAGE: fr
292+
LLM_BASE_URL: https://configure-your-url.com
293+
LLM_API_KEY: your-secret-value
294+
LLM_MODEL: meta-llama/Llama-3.1-8B-Instruct
295+
WEBHOOK_API_TOKEN: password
296+
WEBHOOK_URL: https://www.mock-impress.com/webhook/
297+
CELERY_BROKER_URL: redis://default:pass@redis-master:6379/1
298+
CELERY_RESULT_BACKEND: redis://default:pass@redis-master:6379/1
299+
TASK_TRACKER_REDIS_URL: redis://default:pass@redis-master:6379/1
300+
301+
image:
302+
repository: localhost:5001/meet-summary
303+
pullPolicy: Always
304+
tag: "latest"
305+
306+
command:
307+
- "celery"
308+
- "-A"
309+
- "summary.core.celery_worker"
310+
- "worker"
311+
- "--pool=solo"
312+
- "--loglevel=info"
313+
- "-Q"
314+
- "call-webhook-queue-v2"
273315

274316
agents:
275317
replicas: 1

src/helm/meet/templates/_helpers.tpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,16 @@ Requires top level scope
202202
{{ include "meet.fullname" . }}-celery-summarize
203203
{{- end }}
204204

205+
{{/*
206+
Full name for the Celery Summary Backend
207+
208+
Requires top level scope
209+
*/}}
210+
{{- define "meet.celerySummaryBackend.fullname" -}}
211+
{{ include "meet.fullname" . }}-celery-summary-backend
212+
{{- end }}
213+
214+
205215
{{/*
206216
Full name for the agents
207217
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
{{- $envVars := include "meet.common.env" (list . .Values.celerySummaryBackend) -}}
2+
{{- $fullName := include "meet.celerySummaryBackend.fullname" . -}}
3+
{{- $component := "celery-summary-backend" -}}
4+
apiVersion: apps/v1
5+
kind: Deployment
6+
metadata:
7+
name: {{ $fullName }}
8+
annotations:
9+
{{- with .Values.celerySummaryBackend.dpAnnotations }}
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
namespace: {{ .Release.Namespace | quote }}
13+
labels:
14+
{{- include "meet.common.labels" (list . $component) | nindent 4 }}
15+
spec:
16+
replicas: {{ .Values.celerySummaryBackend.replicas }}
17+
selector:
18+
matchLabels:
19+
{{- include "meet.common.selectorLabels" (list . $component) | nindent 6 }}
20+
template:
21+
metadata:
22+
annotations:
23+
{{- with .Values.celerySummaryBackend.podAnnotations }}
24+
{{- toYaml . | nindent 8 }}
25+
{{- end }}
26+
labels:
27+
{{- include "meet.common.selectorLabels" (list . $component) | nindent 8 }}
28+
spec:
29+
{{- if $.Values.image.credentials }}
30+
imagePullSecrets:
31+
- name: {{ include "meet.secret.dockerconfigjson.name" (dict "fullname" (include "meet.fullname" .) "imageCredentials" $.Values.image.credentials) }}
32+
{{- end }}
33+
shareProcessNamespace: {{ .Values.celerySummaryBackend.shareProcessNamespace }}
34+
containers:
35+
{{- with .Values.celerySummaryBackend.sidecars }}
36+
{{- toYaml . | nindent 8 }}
37+
{{- end }}
38+
- name: {{ .Chart.Name }}
39+
image: "{{ (.Values.celerySummaryBackend.image | default dict).repository | default .Values.image.repository }}:{{ (.Values.celerySummaryBackend.image | default dict).tag | default .Values.image.tag }}"
40+
imagePullPolicy: {{ (.Values.celerySummaryBackend.image | default dict).pullPolicy | default .Values.image.pullPolicy }}
41+
{{- with .Values.celerySummaryBackend.command }}
42+
command:
43+
{{- toYaml . | nindent 12 }}
44+
{{- end }}
45+
{{- with .Values.celerySummaryBackend.args }}
46+
args:
47+
{{- toYaml . | nindent 12 }}
48+
{{- end }}
49+
env:
50+
{{- if $envVars }}
51+
{{- $envVars | indent 12 }}
52+
{{- end }}
53+
{{- with .Values.celerySummaryBackend.securityContext }}
54+
securityContext:
55+
{{- toYaml . | nindent 12 }}
56+
{{- end }}
57+
ports:
58+
- name: http
59+
containerPort: {{ .Values.celerySummaryBackend.service.targetPort }}
60+
protocol: TCP
61+
{{- if .Values.celerySummaryBackend.probes.liveness }}
62+
livenessProbe:
63+
{{- include "meet.probes.abstract" (merge .Values.celerySummaryBackend.probes.liveness (dict "targetPort" .Values.celerySummaryBackend.service.targetPort )) | nindent 12 }}
64+
{{- end }}
65+
{{- if .Values.celerySummaryBackend.probes.readiness }}
66+
readinessProbe:
67+
{{- include "meet.probes.abstract" (merge .Values.celerySummaryBackend.probes.readiness (dict "targetPort" .Values.celerySummaryBackend.service.targetPort )) | nindent 12 }}
68+
{{- end }}
69+
{{- if .Values.celerySummaryBackend.probes.startup }}
70+
startupProbe:
71+
{{- include "meet.probes.abstract" (merge .Values.celerySummaryBackend.probes.startup (dict "targetPort" .Values.celerySummaryBackend.service.targetPort )) | nindent 12 }}
72+
{{- end }}
73+
{{- with .Values.celerySummaryBackend.resources }}
74+
resources:
75+
{{- toYaml . | nindent 12 }}
76+
{{- end }}
77+
volumeMounts:
78+
{{- range $index, $value := .Values.mountFiles }}
79+
- name: "files-{{ $index }}"
80+
mountPath: {{ $value.path }}
81+
subPath: content
82+
{{- end }}
83+
{{- range $name, $volume := .Values.celerySummaryBackend.persistence }}
84+
- name: "{{ $name }}"
85+
mountPath: "{{ $volume.mountPath }}"
86+
{{- end }}
87+
{{- range .Values.celerySummaryBackend.extraVolumeMounts }}
88+
- name: {{ .name }}
89+
mountPath: {{ .mountPath }}
90+
subPath: {{ .subPath | default "" }}
91+
readOnly: {{ .readOnly }}
92+
{{- end }}
93+
{{- with .Values.celerySummaryBackend.nodeSelector }}
94+
nodeSelector:
95+
{{- toYaml . | nindent 8 }}
96+
{{- end }}
97+
{{- with .Values.celerySummaryBackend.affinity }}
98+
affinity:
99+
{{- toYaml . | nindent 8 }}
100+
{{- end }}
101+
{{- with .Values.celerySummaryBackend.tolerations }}
102+
tolerations:
103+
{{- toYaml . | nindent 8 }}
104+
{{- end }}
105+
volumes:
106+
{{- range $index, $value := .Values.mountFiles }}
107+
- name: "files-{{ $index }}"
108+
configMap:
109+
name: "{{ include "meet.fullname" $ }}-files-{{ $index }}"
110+
{{- end }}
111+
{{- range $name, $volume := .Values.celerySummaryBackend.persistence }}
112+
- name: "{{ $name }}"
113+
{{- if eq $volume.type "emptyDir" }}
114+
emptyDir: {}
115+
{{- else }}
116+
persistentVolumeClaim:
117+
claimName: "{{ $fullName }}-{{ $name }}"
118+
{{- end }}
119+
{{- end }}
120+
{{- range .Values.celerySummaryBackend.extraVolumes }}
121+
- name: {{ .name }}
122+
{{- if .existingClaim }}
123+
persistentVolumeClaim:
124+
claimName: {{ .existingClaim }}
125+
{{- else if .hostPath }}
126+
hostPath:
127+
{{ toYaml .hostPath | nindent 12 }}
128+
{{- else if .csi }}
129+
csi:
130+
{{- toYaml .csi | nindent 12 }}
131+
{{- else if .configMap }}
132+
configMap:
133+
{{- toYaml .configMap | nindent 12 }}
134+
{{- else if .emptyDir }}
135+
emptyDir:
136+
{{- toYaml .emptyDir | nindent 12 }}
137+
{{- else }}
138+
emptyDir: {}
139+
{{- end }}
140+
{{- end }}
141+
---
142+
{{ if .Values.celerySummaryBackend.pdb.enabled }}
143+
apiVersion: policy/v1
144+
kind: PodDisruptionBudget
145+
metadata:
146+
name: {{ $fullName }}
147+
namespace: {{ .Release.Namespace | quote }}
148+
spec:
149+
maxUnavailable: 1
150+
selector:
151+
matchLabels:
152+
{{- include "meet.common.selectorLabels" (list . $component) | nindent 6 }}
153+
{{ end }}

src/helm/meet/values.yaml

Lines changed: 112 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ celeryTranscribe:
738738
- "--pool=solo"
739739
- "--loglevel=info"
740740
- "-Q"
741-
- "transcribe-queue"
741+
- "transcribe-queue,transcribe-queue-v2"
742742

743743
## @param celeryTranscribe.args Override the celeryTranscribe container args
744744
args: []
@@ -847,7 +847,7 @@ celerySummarize:
847847
- "--pool=solo"
848848
- "--loglevel=info"
849849
- "-Q"
850-
- "summarize-queue"
850+
- "summarize-queue,summarize-queue-v2"
851851

852852
## @param celerySummarize.args Override the celerySummarize container args
853853
args: []
@@ -933,6 +933,116 @@ celerySummarize:
933933
pdb:
934934
enabled: false
935935

936+
## @section celerySummyBackend
937+
938+
celerySummaryBackend:
939+
## @param celerySummyBackend.image.repository Repository to use to pull meet's celerySummyBackend container image
940+
## @param celerySummyBackend.image.tag meet's celerySummyBackend container tag
941+
## @param celerySummyBackend.image.pullPolicy celerySummyBackend container image pull policy
942+
image:
943+
repository: lasuite/meet-summary
944+
pullPolicy: IfNotPresent
945+
tag: "latest"
946+
947+
## @param celerySummyBackend.dpAnnotations Annotations to add to the celerySummyBackend Deployment
948+
dpAnnotations: {}
949+
950+
## @param celerySummyBackend.command Override the celerySummyBackend container command
951+
command:
952+
- "celery"
953+
- "-A"
954+
- "summary.core.celery_worker"
955+
- "worker"
956+
- "--pool=solo"
957+
- "--loglevel=info"
958+
- "-Q"
959+
- "call-webhook-queue-v2"
960+
961+
## @param celerySummyBackend.args Override the celerySummyBackend container args
962+
args: []
963+
964+
## @param celerySummyBackend.replicas Amount of celerySummyBackend replicas
965+
replicas: 1
966+
967+
## @param celerySummyBackend.shareProcessNamespace Enable share process namespace between containers
968+
shareProcessNamespace: false
969+
970+
## @param celerySummyBackend.sidecars Add sidecars containers to celerySummyBackend deployment
971+
sidecars: []
972+
973+
## @param celerySummyBackend.migrateJobAnnotations Annotations for the migrate job
974+
migrateJobAnnotations: {}
975+
976+
## @param celerySummyBackend.securityContext Configure celerySummyBackend Pod security context
977+
securityContext: null
978+
979+
## @param celerySummyBackend.envVars Configure celerySummyBackend container environment variables
980+
## @extra celerySummyBackend.envVars.BY_VALUE Example environment variable by setting value directly
981+
## @extra celerySummyBackend.envVars.FROM_CONFIGMAP.configMapKeyRef.name Name of a ConfigMap when configuring env vars from a ConfigMap
982+
## @extra celerySummyBackend.envVars.FROM_CONFIGMAP.configMapKeyRef.key Key within a ConfigMap when configuring env vars from a ConfigMap
983+
## @extra celerySummyBackend.envVars.FROM_SECRET.secretKeyRef.name Name of a Secret when configuring env vars from a Secret
984+
## @extra celerySummyBackend.envVars.FROM_SECRET.secretKeyRef.key Key within a Secret when configuring env vars from a Secret
985+
## @skip celerySummyBackend.envVars
986+
envVars:
987+
<<: *commonEnvVars
988+
989+
## @param celerySummyBackend.podAnnotations Annotations to add to the celerySummyBackend Pod
990+
podAnnotations: {}
991+
992+
## @param celerySummyBackend.service.type celerySummyBackend Service type
993+
## @param celerySummyBackend.service.port celerySummyBackend Service listening port
994+
## @param celerySummyBackend.service.targetPort celerySummyBackend container listening port
995+
## @param celerySummyBackend.service.annotations Annotations to add to the celerySummyBackend Service
996+
service:
997+
type: ClusterIP
998+
port: 80
999+
targetPort: 8000
1000+
annotations: {}
1001+
1002+
## @param celerySummyBackend.probes Configure celerySummyBackend probes
1003+
## @param celerySummyBackend.probes.liveness.path [nullable] Configure path for celerySummyBackend HTTP liveness probe
1004+
## @param celerySummyBackend.probes.liveness.targetPort [nullable] Configure port for celerySummyBackend HTTP liveness probe
1005+
## @param celerySummyBackend.probes.liveness.initialDelaySeconds [nullable] Configure initial delay for celerySummyBackend liveness probe
1006+
## @param celerySummyBackend.probes.liveness.initialDelaySeconds [nullable] Configure timeout for celerySummyBackend liveness probe
1007+
## @param celerySummyBackend.probes.startup.path [nullable] Configure path for celerySummyBackend HTTP startup probe
1008+
## @param celerySummyBackend.probes.startup.targetPort [nullable] Configure port for celerySummyBackend HTTP startup probe
1009+
## @param celerySummyBackend.probes.startup.initialDelaySeconds [nullable] Configure initial delay for celerySummyBackend startup probe
1010+
## @param celerySummyBackend.probes.startup.initialDelaySeconds [nullable] Configure timeout for celerySummyBackend startup probe
1011+
## @param celerySummyBackend.probes.readiness.path [nullable] Configure path for celerySummyBackend HTTP readiness probe
1012+
## @param celerySummyBackend.probes.readiness.targetPort [nullable] Configure port for celerySummyBackend HTTP readiness probe
1013+
## @param celerySummyBackend.probes.readiness.initialDelaySeconds [nullable] Configure initial delay for celerySummyBackend readiness probe
1014+
## @param celerySummyBackend.probes.readiness.initialDelaySeconds [nullable] Configure timeout for celerySummyBackend readiness probe
1015+
probes: {}
1016+
1017+
## @param celerySummyBackend.resources Resource requirements for the celerySummyBackend container
1018+
resources: {}
1019+
1020+
## @param celerySummyBackend.nodeSelector Node selector for the celerySummyBackend Pod
1021+
nodeSelector: {}
1022+
1023+
## @param celerySummyBackend.tolerations Tolerations for the celerySummyBackend Pod
1024+
tolerations: []
1025+
1026+
## @param celerySummyBackend.affinity Affinity for the celerySummyBackend Pod
1027+
affinity: {}
1028+
1029+
## @param celerySummyBackend.persistence Additional volumes to create and mount on the celerySummyBackend. Used for debugging purposes
1030+
## @extra celerySummyBackend.persistence.volume-name.size Size of the additional volume
1031+
## @extra celerySummyBackend.persistence.volume-name.type Type of the additional volume, persistentVolumeClaim or emptyDir
1032+
## @extra celerySummyBackend.persistence.volume-name.mountPath Path where the volume should be mounted to
1033+
persistence: {}
1034+
1035+
## @param celerySummyBackend.extraVolumeMounts Additional volumes to mount on the celerySummyBackend.
1036+
extraVolumeMounts: []
1037+
1038+
## @param celerySummyBackend.extraVolumes Additional volumes to mount on the celerySummyBackend.
1039+
extraVolumes: []
1040+
1041+
## @param celerySummyBackend.pdb.enabled Enable pdb on celerySummyBackend
1042+
pdb:
1043+
enabled: false
1044+
1045+
9361046
## @section agents
9371047

9381048
agents:

0 commit comments

Comments
 (0)