Skip to content

Commit bc17f1a

Browse files
committed
Consolidate Danswer and Azimuth-Danswer Helm charts
1 parent ce3a69a commit bc17f1a

File tree

7 files changed

+216
-4
lines changed

7 files changed

+216
-4
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
controls: {}
2+

deployment/helm/templates/NOTES.txt

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: zenith.stackhpc.com/v1alpha1
2+
kind: Client
3+
metadata:
4+
name: {{ include "danswer-stack.fullname" . }}
5+
labels: {{ include "danswer-stack.labels" . | nindent 4 }}
6+
spec:
7+
reservationName: {{ include "danswer-stack.fullname" . }}
8+
upstream:
9+
serviceName: {{ .Release.Name }}-nginx
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
name: {{ .Release.Name }}-danswer-fixup
6+
namespace: {{ .Release.Name }}
7+
annotations:
8+
# Need to keep around for post-delete hooks
9+
helm.sh/resource-policy: keep
10+
rules:
11+
- apiGroups:
12+
- ""
13+
resources:
14+
- persistentvolumeclaims
15+
verbs:
16+
- get
17+
- list
18+
- delete
19+
- apiGroups:
20+
- apps
21+
resources:
22+
- statefulsets
23+
- deployments
24+
verbs:
25+
- get
26+
- patch
27+
- apiGroups:
28+
- ""
29+
resources:
30+
- pods
31+
verbs:
32+
- get
33+
- list
34+
- watch
35+
---
36+
apiVersion: rbac.authorization.k8s.io/v1
37+
kind: RoleBinding
38+
metadata:
39+
name: {{ .Release.Name }}-danswer-fixup
40+
namespace: {{ .Release.Name }}
41+
annotations:
42+
# Need to keep around for post-delete hooks
43+
helm.sh/resource-policy: keep
44+
roleRef:
45+
apiGroup: rbac.authorization.k8s.io
46+
kind: Role
47+
name: {{ .Release.Name }}-danswer-fixup
48+
subjects:
49+
# Namespace is unique to Azimuth app so using default
50+
# service account is fine.
51+
- kind: ServiceAccount
52+
name: default
53+
namespace: {{ .Release.Name }}
54+
---
55+
# Delete stateful set PVCs since upstream Helm chart doesn't expose this config option
56+
apiVersion: batch/v1
57+
kind: Job
58+
metadata:
59+
name: pvc-cleanup
60+
namespace: {{ .Release.Name }}
61+
annotations:
62+
helm.sh/hook: post-delete
63+
helm.sh/hook-weight: "0"
64+
helm.sh/hook-delete-policy: hook-succeeded
65+
spec:
66+
template:
67+
spec:
68+
containers:
69+
- name: pvc-deleter
70+
image: gcr.io/google_containers/hyperkube:v1.18.0
71+
command:
72+
- kubectl
73+
- delete
74+
- -n
75+
- {{ .Release.Name }}
76+
- pvc
77+
- --all
78+
restartPolicy: Never
79+
serviceAccountName: default
80+
---
81+
# Until https://github.com/unoplat/vespa-helm-charts/pull/23
82+
# is merged, we need to patch vespa stateful set after deployment
83+
# so that service label selectors match correctly.
84+
# Since Danswer API pod gives up on Vespa application package
85+
# init request after just 5 retries we also need to restart the API
86+
# deployment to trigger a retry on the Vespa setup by the API pod
87+
# after labels are corrected.
88+
# Use three separate hooks with different hook-weights to control ordering.
89+
apiVersion: batch/v1
90+
kind: Job
91+
metadata:
92+
name: vespa-label-updater
93+
namespace: {{ .Release.Name }}
94+
annotations:
95+
helm.sh/hook: post-install,post-upgrade,post-rollback
96+
helm.sh/hook-weight: "1"
97+
helm.sh/hook-delete-policy: hook-succeeded
98+
spec:
99+
template:
100+
spec:
101+
containers:
102+
- name: label-updater
103+
image: gcr.io/google_containers/hyperkube:v1.18.0
104+
command:
105+
- kubectl
106+
- patch
107+
- -n
108+
- {{ .Release.Name }}
109+
- statefulset/vespa
110+
- -p
111+
- {{ printf "{'spec':{'template':{'metadata':{'labels':{'app.kubernetes.io/instance':'%s'}}}}}" .Release.Name | replace "'" "\"" | squote }}
112+
restartPolicy: Never
113+
serviceAccountName: default
114+
---
115+
apiVersion: batch/v1
116+
kind: Job
117+
metadata:
118+
name: vespa-waiter
119+
namespace: {{ .Release.Name }}
120+
annotations:
121+
helm.sh/hook: post-install,post-upgrade,post-rollback
122+
helm.sh/hook-weight: "2"
123+
helm.sh/hook-delete-policy: hook-succeeded
124+
spec:
125+
template:
126+
spec:
127+
containers:
128+
- name: waiter
129+
image: gcr.io/google_containers/hyperkube:v1.18.0
130+
command:
131+
- kubectl
132+
- wait
133+
- -n
134+
- {{ .Release.Name }}
135+
- --for=condition=Ready
136+
- pod/vespa-0
137+
restartPolicy: Never
138+
serviceAccountName: default
139+
---
140+
apiVersion: batch/v1
141+
kind: Job
142+
metadata:
143+
name: danswer-api-restarter
144+
namespace: {{ .Release.Name }}
145+
annotations:
146+
helm.sh/hook: post-install,post-upgrade,post-rollback
147+
helm.sh/hook-weight: "3"
148+
helm.sh/hook-delete-policy: hook-succeeded
149+
spec:
150+
template:
151+
spec:
152+
containers:
153+
- name: restarter
154+
image: gcr.io/google_containers/hyperkube:v1.18.0
155+
command:
156+
- kubectl
157+
- rollout
158+
- restart
159+
- -n
160+
- {{ .Release.Name }}
161+
- {{ printf "deployment/%s-danswer-stack-api-deployment" .Release.Name }}
162+
restartPolicy: Never
163+
serviceAccountName: default
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: zenith.stackhpc.com/v1alpha1
2+
kind: Reservation
3+
metadata:
4+
name: {{ include "danswer-stack.fullname" . }}
5+
labels: {{ include "danswer-stack.labels" . | nindent 4 }}
6+
annotations:
7+
azimuth.stackhpc.com/service-label: {{ quote .Values.zenithClient.label }}
8+
azimuth.stackhpc.com/service-icon-url: {{ .Values.zenithClient.iconUrl }}
9+
{{- with .Values.zenithClient.description }}
10+
azimuth.stackhpc.com/service-description: {{ quote . }}
11+
{{- end }}
12+
spec:
13+
credentialSecretName: {{ include "danswer-stack.fullname" . }}-credential

deployment/helm/values.schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "http://json-schema.org/schema#",
3+
"type": "object",
4+
"properties": {}
5+
}

deployment/helm/values.yaml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@ fullnameOverride: ""
88
appVersionOverride: # e.g "v0.3.93"
99

1010
# The suffix to add to the backend and web-server image
11-
# tags to refer to downstream image modifications.
11+
# tags to refer to downstream StackHPC-modified images.
1212
# The full image ref will be:
1313
# {{ image-name }}:{{ image-tag or appVersion }}-{{ tagSuffix }}
1414
tagSuffix: stackhpc.1
1515

16+
zenithClient:
17+
iconUrl: https://raw.githubusercontent.com/danswer-ai/danswer/1fabd9372d66cd54238847197c33f091a724803b/Danswer.png
18+
description:
19+
label: "Danswer"
20+
1621
inferenceCapability:
1722
service:
1823
name: inference-model-server-service
@@ -118,6 +123,9 @@ nginx:
118123
- name: DOMAIN
119124
value: localhost
120125
service:
126+
# Don't need external service since service
127+
# will be exposed via Zenith tunnel
128+
type: ClusterIP
121129
ports:
122130
http: 80
123131
danswer: 3000
@@ -354,6 +362,18 @@ vespa:
354362
tolerations: []
355363
affinity: {}
356364

365+
service:
366+
type: ClusterIP
367+
volumeClaimTemplates:
368+
- metadata:
369+
name: vespa-storage
370+
spec:
371+
accessModes:
372+
- ReadWriteOnce
373+
resources:
374+
requests:
375+
storage: 10Gi
376+
357377

358378
#ingress:
359379
# enabled: false
@@ -408,7 +428,7 @@ auth:
408428
danswer_bot_slack_bot_token: ""
409429

410430
configMap:
411-
AUTH_TYPE: "disabled" # Change this for production uses unless Danswer is only accessible behind VPN
431+
AUTH_TYPE: "basic" # Basic auth required for x-remote-user header integration
412432
SESSION_EXPIRE_TIME_SECONDS: "86400" # 1 Day Default
413433
VALID_EMAIL_DOMAINS: "" # Can be something like danswer.ai, as an extra double-check
414434
SMTP_SERVER: "" # For sending verification emails, if unspecified then defaults to 'smtp.gmail.com'
@@ -428,7 +448,7 @@ configMap:
428448
QA_TIMEOUT: "60"
429449
MAX_CHUNKS_FED_TO_CHAT: ""
430450
DISABLE_LLM_DOC_RELEVANCE: ""
431-
DISABLE_LLM_CHOOSE_SEARCH: ""
451+
DISABLE_LLM_CHOOSE_SEARCH: true
432452
DISABLE_LLM_QUERY_REPHRASE: ""
433453
# Query Options
434454
DOC_TIME_DECAY: ""
@@ -469,7 +489,7 @@ configMap:
469489
# Logging
470490
# Optional Telemetry, please keep it on (nothing sensitive is collected)? <3
471491
# https://docs.danswer.dev/more/telemetry
472-
DISABLE_TELEMETRY: ""
492+
DISABLE_TELEMETRY: true
473493
LOG_LEVEL: ""
474494
LOG_ALL_MODEL_INTERACTIONS: ""
475495
LOG_DANSWER_MODEL_INTERACTIONS: ""

0 commit comments

Comments
 (0)