From 4df8d8bd3a2dda39cd5c3460e269e9065356ffe3 Mon Sep 17 00:00:00 2001 From: Trayan Azarov Date: Tue, 1 Aug 2023 11:57:13 +0300 Subject: [PATCH] feat: Adding support for multiple chroma versions --- .github/workflows/build-images.yml | 45 +++++++++++++++++++ .../chromadb-chart/templates/statefulset.yaml | 2 +- charts/chromadb-chart/values.yaml | 3 +- image/Dockerfile | 3 +- 4 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build-images.yml diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml new file mode 100644 index 0000000..f0b3c98 --- /dev/null +++ b/.github/workflows/build-images.yml @@ -0,0 +1,45 @@ +name: Release Charts + +on: + push: + branches: + - main +env: + REGISTRY: ghcr.io + IMAGE_NAME: "ghcr.io/amikos-tech/chromadb-chart/chroma" + +jobs: + build-images: + strategy: + matrix: + chroma-version: [ 0.4.3, 0.4.4 ] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + - name: Latest release + run: | + echo "Latest release: ${{ steps.releaser.outputs.chart_version }}" + echo "Changed charts: ${{ steps.releaser.outputs.changed_charts }}" + - name: Log in to the Container registry + uses: docker/login-action@v2.1.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push release Docker image + uses: docker/build-push-action@v3.2.0 + with: + context: . + file: image/Dockerfile + push: true + build-args: | + CHROMA_VERSION=${{ matrix.chroma-version }} + tags: "${{ env.IMAGE_NAME }}:${{ matrix.chroma-version }},${{ env.IMAGE_NAME }}:latest" \ No newline at end of file diff --git a/charts/chromadb-chart/templates/statefulset.yaml b/charts/chromadb-chart/templates/statefulset.yaml index 329b44b..89ea32f 100644 --- a/charts/chromadb-chart/templates/statefulset.yaml +++ b/charts/chromadb-chart/templates/statefulset.yaml @@ -29,7 +29,7 @@ spec: {{- end }} containers: - name: "chromadb" - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.image.repository }}:{{ .Values.chromadb.apiVersion | default .Chart.AppVersion }}" imagePullPolicy: "{{ .Values.image.pullPolicy }}" env: - name: POD_NAME diff --git a/charts/chromadb-chart/values.yaml b/charts/chromadb-chart/values.yaml index 10e66f4..c3ca36d 100644 --- a/charts/chromadb-chart/values.yaml +++ b/charts/chromadb-chart/values.yaml @@ -8,8 +8,6 @@ image: # repository: ghcr.io/chroma-core/chroma repository: ghcr.io/amikos-tech/chromadb-chart/chroma pullPolicy: Always - # Overrides the image tag whose default is the chart appVersion. - tag: "latest" imagePullSecrets: [ ] nameOverride: "" @@ -95,6 +93,7 @@ startupProbe: initialDelaySeconds: 10 chromadb: + apiVersion: "0.4.3" allowReset: false isPersistent: true persistDirectory: /index_data diff --git a/image/Dockerfile b/image/Dockerfile index 95c34e8..da18335 100644 --- a/image/Dockerfile +++ b/image/Dockerfile @@ -1,4 +1,5 @@ -FROM ghcr.io/chroma-core/chroma:0.4.3 +ARG CHROMA_VERSION=0.4.3 +FROM ghcr.io/chroma-core/chroma:${CHROMA_VERSION} as base COPY ./image/docker_entrypoint.sh /docker_entrypoint.sh RUN find /chroma -mindepth 1 -maxdepth 1 ! \( -name 'chromadb' -o -name 'LICENSE' -o -name 'requirements.txt' \) -exec rm -rf {} \; && \