Skip to content

Commit ce3a69a

Browse files
authored
Merge pull request #4 from stackhpc/fix/helm-versioning
Fix helm versioning
2 parents 5deba93 + 6f1c45a commit ce3a69a

File tree

5 files changed

+23
-22
lines changed

5 files changed

+23
-22
lines changed

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,21 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121

22-
# We publish our 'release' Semver tags as X.Y.Z-stackhpc.[1-9]+
23-
# so if main branch chart version doesn't match this then abort
24-
- name: Fail on dev chart version
25-
run: yq .version deployment/helm/Chart.yaml | grep "\-stackhpc.[0-9]\+$"
22+
- name: Fail on semver pre-release chart version
23+
run: yq .version deployment/helm/Chart.yaml | grep -v '[a-zA-Z-]'
2624
if: ${{ github.ref_name == 'main'}}
2725

28-
# Stable 'release' image tags should be of the form "v<upstream-semver>-stackhpc.X"
29-
- name: Fail on dev image version
30-
run: yq .appVersion deployment/helm/Chart.yaml | grep "^v[0-9]" | grep "\-stackhpc.[0-9]\+$"
31-
if: ${{ github.ref_name == 'main'}}
26+
- name: Fail if image tags don't exist
27+
run: >-
28+
curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)"
29+
https://ghcr.io/v2/stackhpc/danswer/danswer-backend/tags/list
30+
| jq .tags
31+
| grep $( yq .appVersion deployment/helm/Chart.yaml )-$( yq .tagSuffix deployment/helm/values.yaml )
32+
&&
33+
curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)"
34+
https://ghcr.io/v2/stackhpc/danswer/danswer-web-server/tags/list
35+
| jq .tags
36+
| grep $( yq .appVersion deployment/helm/Chart.yaml )-$( yq .tagSuffix deployment/helm/values.yaml )
3237
3338
- name: Configure Git
3439
run: |

deployment/helm/Chart.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,8 @@ home: https://www.danswer.ai/
55
sources:
66
- "https://github.com/danswer-ai/danswer"
77
type: application
8-
version: 0.5.10-stackhpc.1
9-
appVersion: v0.5.10-stackhpc.1
10-
annotations:
11-
category: Productivity
12-
licenses: MIT
13-
images: |
14-
- name: webserver
15-
image: docker.io/danswer/danswer-web-server:latest
16-
- name: background
17-
image: docker.io/danswer/danswer-backend:latest
18-
- name: vespa
19-
image: vespaengine/vespa:8.277.17
8+
version: 0.1.0
9+
appVersion: v0.5.10
2010
dependencies:
2111
- name: postgresql
2212
version: 14.3.1

deployment/helm/templates/api-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ spec:
3737
- name: api-server
3838
securityContext:
3939
{{- toYaml .Values.api.securityContext | nindent 12 }}
40-
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}"
40+
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}-{{ .Values.tagSuffix }}"
4141
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
4242
command:
4343
- "/bin/sh"

deployment/helm/templates/webserver-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ spec:
3737
- name: web-server
3838
securityContext:
3939
{{- toYaml .Values.webserver.securityContext | nindent 12 }}
40-
image: "{{ .Values.webserver.image.repository }}:{{ .Values.webserver.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}"
40+
image: "{{ .Values.webserver.image.repository }}:{{ .Values.webserver.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}-{{ .Values.tagSuffix }}"
4141
imagePullPolicy: {{ .Values.webserver.image.pullPolicy }}
4242
ports:
4343
- name: http

deployment/helm/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ nameOverride: ""
77
fullnameOverride: ""
88
appVersionOverride: # e.g "v0.3.93"
99

10+
# The suffix to add to the backend and web-server image
11+
# tags to refer to downstream image modifications.
12+
# The full image ref will be:
13+
# {{ image-name }}:{{ image-tag or appVersion }}-{{ tagSuffix }}
14+
tagSuffix: stackhpc.1
15+
1016
inferenceCapability:
1117
service:
1218
name: inference-model-server-service

0 commit comments

Comments
 (0)