Skip to content

Commit

Permalink
Release 0.5.1 (#76)
Browse files Browse the repository at this point in the history
* Release 0.5.1

This also adds an integration test which actually hits the API and experimental support for unprivileged container images

* Add debug statement

* Add debug statement

* Bump Qdrant to 1.5.1

* Try to fix tests

* Add comment and remove duplicated test
  • Loading branch information
bashofmann authored Sep 13, 2023
1 parent bc06c7b commit 52515f6
Show file tree
Hide file tree
Showing 14 changed files with 269 additions and 129 deletions.
27 changes: 4 additions & 23 deletions .github/workflows/pr-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,21 @@ jobs:
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.1

- uses: actions/setup-python@v4
with:
python-version: '3.9'
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.4.0

- name: Run chart-testing (lint)
run: ct lint --all
- name: Run lint
run: make lint

- uses: actions/setup-go@v4
with:
go-version: '^1.21.0'
cache-dependency-path: go.sum

- name: Run unit tests
run: go test -v ./test

- name: Create kind cluster
uses: helm/kind-action@v1.8.0

- name: Run chart-testing
run: ct install --all --upgrade --target-branch main
run: make test-unit

- name: Setup BATS
uses: mig4/setup-bats@v1
with:
bats-version: 1.10.0

- name: Run integration tests
run: bats test/integration --verbose-run --show-output-of-passing-tests
run: make test-integration
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [qdrant-0.5.1](https://github.com/qdrant/qdrant-helm/tree/qdrant-0.5.1) (2023-09-12)

- Update Qdrant to v1.5.1
- Ensure that the qdrant-init-file-path is on a writable, ephemeral volume [\#74](https://github.com/qdrant/qdrant-helm/issues/74)

## [qdrant-0.5.0](https://github.com/qdrant/qdrant-helm/tree/qdrant-0.5.0) (2023-09-07)

- Update to Qdrant 1.5.0 [\#72](https://github.com/qdrant/qdrant-helm/issues/72)
Expand Down
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@ test-unit:
go test -v ./test

test-integration:
kind create cluster -n qdrant-helm-integration
helm install qdrant ./charts/qdrant --wait
kubectl get pods
helm test qdrant
kind delete cluster -n qdrant-helm-integration
bats test/integration --verbose-run --show-output-of-passing-tests
6 changes: 3 additions & 3 deletions charts/qdrant/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [qdrant-0.5.0](https://github.com/qdrant/qdrant-helm/tree/qdrant-0.5.0) (2023-09-07)
## [qdrant-0.5.1](https://github.com/qdrant/qdrant-helm/tree/qdrant-0.5.1) (2023-09-12)

- Update to Qdrant 1.5.0 [\#72](https://github.com/qdrant/qdrant-helm/issues/72)
- Use new Qdrant readiness and liveness endpoints [\#71](https://github.com/qdrant/qdrant-helm/issues/71)
- Update Qdrant to v1.5.1
- Ensure that the qdrant-init-file-path is on a writable, ephemeral volume [\#74](https://github.com/qdrant/qdrant-helm/issues/74)
15 changes: 6 additions & 9 deletions charts/qdrant/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,15 @@ maintainers:
url: https://github.com/qdrant
icon: https://qdrant.github.io/qdrant-helm/logo_with_text.svg
type: application
version: 0.5.0
appVersion: v1.5.0
version: 0.5.1
appVersion: v1.5.1
annotations:
artifacthub.io/category: database
artifacthub.io/changes: |
- kind: added
description: Update to Qdrant 1.5.0
- kind: fixed
description: Ensure that the qdrant-init-file-path is on a writable, ephemeral volume
links:
- name: Github Issue
url: https://github.com/qdrant/qdrant-helm/issues/72
url: https://github.com/qdrant/qdrant-helm/issues/74
- kind: added
description: Use new Qdrant readiness and liveness endpoints
links:
- name: Github Issue
url: https://github.com/qdrant/qdrant-helm/issues/71
description: Update Qdrant to v1.5.1
2 changes: 1 addition & 1 deletion charts/qdrant/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ spec:
{{- toYaml .Values.sidecarContainers | trim | nindent 8 }}
{{- end}}
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}{{ .Values.image.useUnprivilegedImage | ternary "-unprivileged" "" }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: QDRANT_INIT_FILE_PATH
Expand Down
20 changes: 0 additions & 20 deletions charts/qdrant/templates/tests/test-connection.yaml

This file was deleted.

77 changes: 77 additions & 0 deletions charts/qdrant/templates/tests/test-db-interaction.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{{- $root := . }}
{{- $namespace := .Release.Namespace }}
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "qdrant.fullname" . }}-test-db-interaction"
labels:
{{- include "qdrant.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: test-script
image: registry.suse.com/bci/python:3.11
args: ['bash', '/app/entrypoint.sh']
volumeMounts:
- mountPath: /app
name: test-script
volumes:
- name: test-script
configMap:
name: "{{ include "qdrant.fullname" . }}-test-db-interaction"
restartPolicy: Never
serviceAccountName: {{ include "qdrant.fullname" . }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ include "qdrant.fullname" . }}-test-db-interaction"
labels:
{{- include "qdrant.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
data:
entrypoint.sh: |
#!/bin/bash
set -xe
zypper install -y python311-dbm
pip3 install qdrant-client=={{ .Chart.AppVersion }}
python3 /app/test.py
test.py: |
from qdrant_client import QdrantClient
from qdrant_client.http.models import Distance, VectorParams
from qdrant_client.http.models import PointStruct
{{- range .Values.service.ports }}
{{- if eq .name "http" }}
print("Connecting to {{ include "qdrant.fullname" $root }}.{{ $namespace }}:{{ .port }}")
client = QdrantClient("{{ include "qdrant.fullname" $root }}.{{ $namespace }}", port={{ .port }})
{{- end }}
{{- end }}
client.recreate_collection(
collection_name="test_collection",
vectors_config=VectorParams(size=4, distance=Distance.DOT),
)
operation_info = client.upsert(
collection_name="test_collection",
wait=True,
points=[
PointStruct(id=1, vector=[0.05, 0.61, 0.76, 0.74], payload={"city": "Berlin"}),
PointStruct(id=2, vector=[0.19, 0.81, 0.75, 0.11], payload={"city": "London"}),
PointStruct(id=3, vector=[0.36, 0.55, 0.47, 0.94], payload={"city": "Moscow"}),
PointStruct(id=4, vector=[0.18, 0.01, 0.85, 0.80], payload={"city": "New York"}),
PointStruct(id=5, vector=[0.24, 0.18, 0.22, 0.44], payload={"city": "Beijing"}),
PointStruct(id=6, vector=[0.35, 0.08, 0.11, 0.44], payload={"city": "Mumbai"}),
]
)
print(operation_info)
search_result = client.search(
collection_name="test_collection",
query_vector=[0.2, 0.1, 0.9, 0.7],
limit=3
)
print(search_result)
1 change: 1 addition & 0 deletions charts/qdrant/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ image:
repository: qdrant/qdrant
pullPolicy: IfNotPresent
tag: ""
useUnprivilegedImage: false

imagePullSecrets: []
nameOverride: ""
Expand Down
37 changes: 20 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
module github.com/qdrant/qdrant-helm

go 1.21.0
go 1.21.1

require (
github.com/gruntwork-io/terratest v0.43.12
github.com/ghodss/yaml v1.0.0
github.com/gruntwork-io/terratest v0.43.13
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.67.1
github.com/samber/lo v1.38.1
github.com/stretchr/testify v1.8.4
k8s.io/api v0.28.0
helm.sh/helm/v3 v3.12.3
k8s.io/api v0.28.1
)

require (
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/aws/aws-sdk-go v1.44.122 // indirect
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
Expand All @@ -29,15 +31,15 @@ require (
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gruntwork-io/go-commons v0.8.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.0 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/gruntwork-io/go-commons v0.17.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 // indirect
github.com/mattn/go-zglob v0.0.3 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand All @@ -47,9 +49,10 @@ require (
github.com/pquerna/otp v1.2.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/urfave/cli v1.22.2 // indirect
github.com/urfave/cli/v2 v2.10.3 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect
golang.org/x/exp v0.0.0-20221106115401-f9659909a136 // indirect
golang.org/x/net v0.13.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.10.0 // indirect
Expand All @@ -61,10 +64,10 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apimachinery v0.28.0 // indirect
k8s.io/client-go v0.28.0 // indirect
k8s.io/apimachinery v0.28.1 // indirect
k8s.io/client-go v0.28.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/kube-openapi v0.0.0-20230905202853-d090da108d2f // indirect
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
Expand Down
Loading

0 comments on commit 52515f6

Please sign in to comment.