Skip to content

Commit 177c24d

Browse files
authored
Uxrevamp (#316)
1 parent f373a04 commit 177c24d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4206
-1768
lines changed

deploy/docker/docker-compose.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,16 @@ services:
172172
- API_PASSWORD=Admin!123
173173
- OPENAPI_SPEC=/app/resources/crapi-openapi-spec.json
174174
- DEFAULT_MODEL=gpt-4o-mini
175-
- CHROMA_PERSIST_DIRECTORY=/app/vectorstore
175+
- CHROMA_HOST=chromadb
176+
- CHROMA_PORT=8000
176177
# - CHATBOT_OPENAI_API_KEY=
177-
volumes:
178-
- chatbot-vectors:/app/vectorstore
179178
depends_on:
180179
mongodb:
181180
condition: service_healthy
182181
crapi-identity:
183182
condition: service_healthy
183+
chromadb:
184+
condition: service_healthy
184185
# ports:
185186
# - "${LISTEN_IP:-127.0.0.1}:5002:5002"
186187

@@ -262,6 +263,16 @@ services:
262263
cpus: '0.3'
263264
memory: 128M
264265

266+
chromadb:
267+
container_name: chromadb
268+
image: 'chromadb/chroma:latest'
269+
environment:
270+
IS_PERSISTENT: 'TRUE'
271+
volumes:
272+
- chromadb-data:/data
273+
# ports:
274+
# - "${LISTEN_IP:-127.0.0.1}:8000:8000"
275+
265276
mailhog:
266277
user: root
267278
container_name: mailhog
@@ -303,4 +314,4 @@ services:
303314
volumes:
304315
mongodb-data:
305316
postgresql-data:
306-
chatbot-vectors:
317+
chromadb-data:

deploy/helm/templates/chatbot/config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ data:
2222
MONGO_DB_NAME: {{ .Values.mongodb.config.mongoDbName }}
2323
CHATBOT_OPENAI_API_KEY: {{ .Values.openAIApiKey }}
2424
DEFAULT_MODEL: {{ .Values.chatbot.config.defaultModel | quote }}
25-
CHROMA_PERSIST_DIRECTORY: {{ .Values.chatbot.config.chromaPersistDirectory | quote }}
25+
CHROMA_HOST: {{ .Values.chromadb.service.name }}
26+
CHROMA_PORT: {{ .Values.chromadb.port | quote }}
2627
API_USER: {{ .Values.chatbot.config.apiUser | quote }}
2728
API_PASSWORD: {{ .Values.chatbot.config.apiPassword | quote }}
2829
OPENAPI_SPEC: {{ .Values.chatbot.config.openapiSpec | quote }}

deploy/helm/templates/chatbot/deployment.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,3 @@ spec:
5757
port: {{ .Values.chatbot.port }}
5858
initialDelaySeconds: 15
5959
periodSeconds: 10
60-
volumeMounts:
61-
- name: chatbot-vectors
62-
mountPath: {{ .Values.chatbot.config.chromaPersistDirectory | quote }}
63-
volumes:
64-
- name: chatbot-vectors
65-
persistentVolumeClaim:
66-
claimName: {{ .Values.chatbot.storage.pvc.name }}

deploy/helm/templates/chatbot/storage.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ .Values.chromadb.config.name }}
5+
labels:
6+
release: {{ .Release.Name }}
7+
{{- with .Values.chromadb.config.labels }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
10+
data:
11+
IS_PERSISTENT: {{ .Values.chromadb.config.isPersistent | quote }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ .Values.chromadb.service.name }}
5+
labels:
6+
release: {{ .Release.Name }}
7+
{{- with .Values.chromadb.service.labels }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
10+
spec:
11+
ports:
12+
- port: {{ .Values.chromadb.port }}
13+
name: chromadb
14+
selector:
15+
{{- toYaml .Values.chromadb.serviceSelectorLabels | nindent 4 }}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: {{ .Values.chromadb.name }}
5+
labels:
6+
release: {{ .Release.Name }}
7+
{{- with .Values.chromadb.statefulsetLabels }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
10+
spec:
11+
serviceName: {{ .Values.chromadb.service.name }}
12+
replicas: {{ .Values.chromadb.replicaCount }}
13+
selector:
14+
matchLabels:
15+
{{- toYaml .Values.chromadb.statefulsetSelectorMatchLabels | nindent 6 }}
16+
template:
17+
metadata:
18+
labels:
19+
release: {{ .Release.Name }}
20+
{{- toYaml .Values.chromadb.podLabels | nindent 8 }}
21+
spec:
22+
containers:
23+
- name: {{ .Values.chromadb.name }}
24+
image: {{ .Values.chromadb.image }}:{{ .Values.chromadb.version }}
25+
imagePullPolicy: {{ .Values.chromadb.imagePullPolicy }}
26+
ports:
27+
- containerPort: {{ .Values.chromadb.port }}
28+
envFrom:
29+
- configMapRef:
30+
name: {{ .Values.chromadb.config.name }}
31+
volumeMounts:
32+
- mountPath: /data
33+
name: chromadb-data
34+
volumes:
35+
- name: chromadb-data
36+
persistentVolumeClaim:
37+
claimName: {{ .Values.chromadb.storage.pvc.name }}
38+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{{- if eq .Values.chromadb.storage.type "manual" }}
2+
apiVersion: v1
3+
kind: PersistentVolume
4+
metadata:
5+
name: {{ .Values.chromadb.storage.pv.name }}
6+
labels:
7+
release: {{ .Release.Name }}
8+
{{- toYaml .Values.chromadb.storage.pv.labels | nindent 4 }}
9+
spec:
10+
storageClassName: {{ .Values.chromadb.storage.type }}
11+
capacity:
12+
storage: {{ .Values.chromadb.storage.pv.resources.storage }}
13+
accessModes:
14+
- ReadWriteOnce
15+
hostPath:
16+
path: {{ .Values.chromadb.storage.pv.hostPath }}
17+
---
18+
{{- end }}
19+
apiVersion: v1
20+
kind: PersistentVolumeClaim
21+
metadata:
22+
name: {{ .Values.chromadb.storage.pvc.name }}
23+
labels:
24+
release: {{ .Release.Name }}
25+
{{- toYaml .Values.chromadb.storage.pvc.labels | nindent 4 }}
26+
spec:
27+
{{- if ne .Values.chromadb.storage.type "default" }}
28+
storageClassName: {{ .Values.chromadb.storage.type }}
29+
{{- end }}
30+
accessModes:
31+
- ReadWriteOnce
32+
resources:
33+
{{- toYaml .Values.chromadb.storage.pvc.resources | nindent 4 }}
34+

deploy/helm/values.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,45 @@ apiGatewayService:
326326
app: gateway-service
327327
serviceSelectorLabels:
328328
app: gateway-service
329+
330+
331+
chromadb:
332+
name: chromadb
333+
image: chromadb/chroma
334+
version: latest
335+
imagePullPolicy: IfNotPresent
336+
port: 8000
337+
replicaCount: 1
338+
service:
339+
name: chromadb
340+
labels:
341+
app: chromadb
342+
config:
343+
name: chromadb-config
344+
labels:
345+
app: chromadb
346+
storage:
347+
# type: "manual"
348+
# pv:
349+
# name: chromadb-pv
350+
# labels:
351+
# app: chromadb
352+
# resources:
353+
# storage: 1Gi
354+
# hostPath: /mnt/chromadb
355+
type: "default"
356+
pvc:
357+
name: chromadb-pv-claim
358+
labels:
359+
app: chromadb
360+
resources:
361+
requests:
362+
storage: 2Gi
363+
serviceSelectorLabels:
364+
app: chromadb
365+
podLabels:
366+
app: chromadb
367+
statefulsetLabels:
368+
app: chromadb
369+
statefulsetSelectorMatchLabels:
370+
app: chromadb

services/chatbot/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ faiss-cpu==1.11.0
1919
psycopg2-binary
2020
uvicorn==0.35.0
2121
fastmcp==2.10.2
22-
chromadb==1.0.15
22+
chromadb-client==1.0.15

0 commit comments

Comments
 (0)