Skip to content

Commit 14757b1

Browse files
committed
refactor(vision): use one shared flags configmap
1 parent 2390b4c commit 14757b1

10 files changed

Lines changed: 12 additions & 46 deletions

File tree

ADR-vision-embedding-rollout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Roll out vision support behind explicit feature flags that default to `false`:
1717
- `VISION_EMBEDDING_ENABLED=false`
1818
- `VISION_IMAGE_RETRIEVER_ENABLED=false`
1919

20-
Flags are exposed via Helm values and config maps for backend, admin-backend, and extractor.
20+
Flags are exposed via Helm values and a shared config map consumed by backend, admin-backend, and extractor.
2121

2222
## Consequences
2323

infrastructure/rag/templates/_admin_backend_and_extractor_helpers.tpl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,10 @@
140140
{{- printf "%s-source-uploader-configmap" .Release.Name | trunc 63 | trimSuffix "-" -}}
141141
{{- end -}}
142142

143-
{{- define "configmap.adminVisionName" -}}
144-
{{- printf "%s-admin-vision-configmap" .Release.Name | trunc 63 | trimSuffix "-" -}}
145-
{{- end -}}
146-
147143
{{- define "configmap.extractorSitemapName" -}}
148144
{{- printf "%s-extractor-sitemap-configmap" .Release.Name | trunc 63 | trimSuffix "-" -}}
149145
{{- end -}}
150146

151-
{{- define "configmap.extractorVisionName" -}}
152-
{{- printf "%s-extractor-vision-configmap" .Release.Name | trunc 63 | trimSuffix "-" -}}
153-
{{- end -}}
154-
155147
# image
156148
{{- define "adminBackend.fullImageName" -}}
157149
{{- $tag := default .Chart.AppVersion .Values.adminBackend.image.tag -}}

infrastructure/rag/templates/_backend_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ basic-auth
103103
{{- printf "%s-retriever-configmap" .Release.Name | trunc 63 | trimSuffix "-" -}}
104104
{{- end -}}
105105

106-
{{- define "configmap.backendVisionName" -}}
107-
{{- printf "%s-backend-vision-configmap" .Release.Name | trunc 63 | trimSuffix "-" -}}
106+
{{- define "configmap.visionName" -}}
107+
{{- printf "%s-vision-configmap" .Release.Name | trunc 63 | trimSuffix "-" -}}
108108
{{- end -}}
109109

110110
{{- define "configmap.langfuseName" -}}

infrastructure/rag/templates/admin-backend/configmap.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,3 @@ data:
4242
{{- range $key, $value := .Values.adminBackend.envs.sourceUploader }}
4343
{{ $key }}: {{ $value | quote }}
4444
{{- end }}
45-
---
46-
apiVersion: v1
47-
kind: ConfigMap
48-
metadata:
49-
name: {{ template "configmap.adminVisionName" . }}
50-
data:
51-
{{- range $key, $value := .Values.adminBackend.envs.vision }}
52-
{{ $key }}: {{ $value | quote }}
53-
{{- end }}

infrastructure/rag/templates/admin-backend/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ spec:
118118
- configMapRef:
119119
name: {{ template "configmap.sourceUploaderName" . }}
120120
- configMapRef:
121-
name: {{ template "configmap.adminVisionName" . }}
121+
name: {{ template "configmap.visionName" . }}
122122
- configMapRef:
123123
name: {{ template "configmap.retryDecoratorName" . }}
124124
- configMapRef:

infrastructure/rag/templates/backend/configmap.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ data:
1919
apiVersion: v1
2020
kind: ConfigMap
2121
metadata:
22-
name: {{ template "configmap.backendVisionName" . }}
22+
name: {{ template "configmap.visionName" . }}
2323
data:
24-
{{- range $key, $value := .Values.backend.envs.vision }}
24+
{{- range $key, $value := .Values.shared.envs.vision }}
2525
{{ $key }}: {{ $value | quote }}
2626
{{- end }}
2727
---

infrastructure/rag/templates/backend/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ spec:
110110
- configMapRef:
111111
name: {{ template "configmap.retrieverName" . }}
112112
- configMapRef:
113-
name: {{ template "configmap.backendVisionName" . }}
113+
name: {{ template "configmap.visionName" . }}
114114
- configMapRef:
115115
name: {{ template "configmap.rerankerName" . }}
116116
- configMapRef:

infrastructure/rag/templates/extractor/configmap.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,3 @@ data:
66
{{- range $key, $value := .Values.extractor.envs.sitemap }}
77
{{ $key }}: {{ $value | quote }}
88
{{- end }}
9-
---
10-
apiVersion: v1
11-
kind: ConfigMap
12-
metadata:
13-
name: {{ template "configmap.extractorVisionName" . }}
14-
data:
15-
{{- range $key, $value := .Values.extractor.envs.vision }}
16-
{{ $key }}: {{ $value | quote }}
17-
{{- end }}

infrastructure/rag/templates/extractor/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ spec:
113113
- configMapRef:
114114
name: {{ template "configmap.extractorSitemapName" . }}
115115
- configMapRef:
116-
name: {{ template "configmap.extractorVisionName" . }}
116+
name: {{ template "configmap.visionName" . }}
117117
- secretRef:
118118
name: {{ template "secret.s3RefName" . }}
119119
{{- $hfCacheDir := include "extractor.huggingfaceCacheDir" . }}

infrastructure/rag/values.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,6 @@ backend:
196196
RETRIEVER_TABLE_K_DOCUMENTS: 10
197197
RETRIEVER_IMAGE_THRESHOLD: 0.7
198198
RETRIEVER_IMAGE_K_DOCUMENTS: 10
199-
vision:
200-
VISION_IMAGE_LANE_ENABLED: false
201-
VISION_EMBEDDING_ENABLED: false
202-
VISION_IMAGE_RETRIEVER_ENABLED: false
203199
errorMessages:
204200
ERROR_MESSAGES_NO_DOCUMENTS_MESSAGE: "I'm sorry, my responses are limited. You must ask the right questions."
205201
ERROR_MESSAGES_NO_OR_EMPTY_COLLECTION: "No documents were provided for searching."
@@ -394,10 +390,6 @@ adminBackend:
394390
sourceUploader:
395391
# Large sitemap ingestions (per-page summaries) can take > 1 hour.
396392
SOURCE_UPLOADER_TIMEOUT: 3600
397-
vision:
398-
VISION_IMAGE_LANE_ENABLED: false
399-
VISION_EMBEDDING_ENABLED: false
400-
VISION_IMAGE_RETRIEVER_ENABLED: false
401393

402394
extractor:
403395
replicaCount: 1
@@ -456,10 +448,6 @@ extractor:
456448
# Options: "docusaurus" (default), "astro", "generic"
457449
# Note: https://docs.stackit.cloud is built with Astro/Starlight -> use "astro".
458450
SITEMAP_PARSER: docusaurus
459-
vision:
460-
VISION_IMAGE_LANE_ENABLED: false
461-
VISION_EMBEDDING_ENABLED: false
462-
VISION_IMAGE_RETRIEVER_ENABLED: false
463451

464452
adminFrontend:
465453
name: admin-frontend
@@ -551,6 +539,10 @@ shared:
551539
s3:
552540
S3_ENDPOINT: http://rag-minio:9000
553541
S3_BUCKET: documents
542+
vision:
543+
VISION_IMAGE_LANE_ENABLED: false
544+
VISION_EMBEDDING_ENABLED: false
545+
VISION_IMAGE_RETRIEVER_ENABLED: false
554546
retryDecorator:
555547
RETRY_DECORATOR_MAX_RETRIES: "5"
556548
RETRY_DECORATOR_RETRY_BASE_DELAY: "0.5"

0 commit comments

Comments
 (0)