Skip to content

Commit 2e55abf

Browse files
authored
Merge pull request #5 from stackhpc/feat/azimuth-chart
Add Azimuth components to Helm chart
2 parents ce3a69a + 898a1bb commit 2e55abf

File tree

9 files changed

+250
-9
lines changed

9 files changed

+250
-9
lines changed

.github/workflows/helm-build-push.yml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,56 @@ name: Publish Danswer Helm Chart
22

33
on:
44
push:
5-
branches:
6-
- main
75
workflow_dispatch:
86

97
jobs:
8+
helm_chart_version_check:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
version_changed: ${{ steps.version_check.outputs.chart_version_changed }}
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
# Check if current chart version exists in releases already
19+
- name: Check for Helm chart version bump
20+
id: version_check
21+
run: |
22+
set -xe
23+
chart_version=$(yq .version deployment/helm/Chart.yaml)
24+
if [[ $(curl https://api.github.com/repos/stackhpc/danswer/releases | jq '.[].tag_name' | grep danswer-helm-$chart_version) ]]; then
25+
echo chart_version_changed=false >> $GITHUB_OUTPUT
26+
else
27+
echo chart_version_changed=true >> $GITHUB_OUTPUT
28+
fi
29+
1030
release:
1131
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
1232
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
1333
permissions:
1434
contents: write
1535
runs-on: ubuntu-latest
36+
needs: helm_chart_version_check
37+
if: ${{ needs.helm_chart_version_check.outputs.version_changed == 'true' }}
1638
steps:
1739
- name: Checkout
18-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
1941
with:
2042
fetch-depth: 0
2143

44+
# We mark any builds on main branch as latest GH release
45+
# so make sure we don't accidentally use a pre-release tag.
2246
- name: Fail on semver pre-release chart version
2347
run: yq .version deployment/helm/Chart.yaml | grep -v '[a-zA-Z-]'
24-
if: ${{ github.ref_name == 'main'}}
48+
if: ${{ github.ref_name == 'main' }}
2549

50+
# To reduce resource usage images are built only on tag.
51+
# To build a new set of images after committing and pushing
52+
# new changes to GitHub, use:
53+
# git tag <tag-name>
54+
# git push --tags
2655
- name: Fail if image tags don't exist
2756
run: >-
2857
curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)"

deployment/helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ home: https://www.danswer.ai/
55
sources:
66
- "https://github.com/danswer-ai/danswer"
77
type: application
8-
version: 0.1.0
8+
version: 0.1.0-azimuth.1
99
appVersion: v0.5.10
1010
dependencies:
1111
- name: postgresql
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)