Skip to content

Commit

Permalink
Merge pull request #4 from stackhpc/fix/helm-versioning
Browse files Browse the repository at this point in the history
Fix helm versioning
  • Loading branch information
sd109 authored Sep 2, 2024
2 parents 5deba93 + 6f1c45a commit ce3a69a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/helm-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,21 @@ jobs:
with:
fetch-depth: 0

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

# Stable 'release' image tags should be of the form "v<upstream-semver>-stackhpc.X"
- name: Fail on dev image version
run: yq .appVersion deployment/helm/Chart.yaml | grep "^v[0-9]" | grep "\-stackhpc.[0-9]\+$"
if: ${{ github.ref_name == 'main'}}
- name: Fail if image tags don't exist
run: >-
curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)"
https://ghcr.io/v2/stackhpc/danswer/danswer-backend/tags/list
| jq .tags
| grep $( yq .appVersion deployment/helm/Chart.yaml )-$( yq .tagSuffix deployment/helm/values.yaml )
&&
curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)"
https://ghcr.io/v2/stackhpc/danswer/danswer-web-server/tags/list
| jq .tags
| grep $( yq .appVersion deployment/helm/Chart.yaml )-$( yq .tagSuffix deployment/helm/values.yaml )
- name: Configure Git
run: |
Expand Down
14 changes: 2 additions & 12 deletions deployment/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,8 @@ home: https://www.danswer.ai/
sources:
- "https://github.com/danswer-ai/danswer"
type: application
version: 0.5.10-stackhpc.1
appVersion: v0.5.10-stackhpc.1
annotations:
category: Productivity
licenses: MIT
images: |
- name: webserver
image: docker.io/danswer/danswer-web-server:latest
- name: background
image: docker.io/danswer/danswer-backend:latest
- name: vespa
image: vespaengine/vespa:8.277.17
version: 0.1.0
appVersion: v0.5.10
dependencies:
- name: postgresql
version: 14.3.1
Expand Down
2 changes: 1 addition & 1 deletion deployment/helm/templates/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
- name: api-server
securityContext:
{{- toYaml .Values.api.securityContext | nindent 12 }}
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}"
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}-{{ .Values.tagSuffix }}"
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
command:
- "/bin/sh"
Expand Down
2 changes: 1 addition & 1 deletion deployment/helm/templates/webserver-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
- name: web-server
securityContext:
{{- toYaml .Values.webserver.securityContext | nindent 12 }}
image: "{{ .Values.webserver.image.repository }}:{{ .Values.webserver.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}"
image: "{{ .Values.webserver.image.repository }}:{{ .Values.webserver.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}-{{ .Values.tagSuffix }}"
imagePullPolicy: {{ .Values.webserver.image.pullPolicy }}
ports:
- name: http
Expand Down
6 changes: 6 additions & 0 deletions deployment/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ nameOverride: ""
fullnameOverride: ""
appVersionOverride: # e.g "v0.3.93"

# The suffix to add to the backend and web-server image
# tags to refer to downstream image modifications.
# The full image ref will be:
# {{ image-name }}:{{ image-tag or appVersion }}-{{ tagSuffix }}
tagSuffix: stackhpc.1

inferenceCapability:
service:
name: inference-model-server-service
Expand Down

0 comments on commit ce3a69a

Please sign in to comment.