Skip to content

Commit

Permalink
VEC-430: linting and test (#2)
Browse files Browse the repository at this point in the history
* refactor GitHub Actions workflow for JFrog Helm chart build and deployment
* Add linting, codeql and fix linting errors.
  • Loading branch information
arrowplum authored Jan 7, 2025
1 parent 66b3653 commit e69349c
Show file tree
Hide file tree
Showing 17 changed files with 128 additions and 61 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-chart-jfrog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ jobs:
JF_PROJECT: ${{ env.JF_PROJECT }}

- name: Set Helm Chart Version
uses: mikefarah/yq@v4.44.6
uses: mikefarah/yq@4839dbbf80445070a31c7a9c1055da527db2d5ee
with:
cmd: yq e -i '.version = "${{ env.CHART_VERSION }}"' chart/$CHART_NAME/Chart.yaml
cmd: yq e -i '.version = "${{ env.CHART_VERSION }}"' charts/$CHART_NAME/Chart.yaml
- name: "Deploy sign and deploy helm to JFrog"
env:
GPG_TTY: no-tty
GPG_PASSPHRASE: ${{ secrets.GPG_PASS }}
run: |
cd chart
cd charts
gpg --export --no-tty --passphrase "$GPG_PASSPHRASE" > ~/.gnupg/pubring.gpg
gpg --export-secret-keys --no-tty --passphrase "$GPG_PASSPHRASE">~/.gnupg/secring.gpg
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Lint
permissions:
contents: read
pull-requests: write
on: pull_request

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814
with:
version: latest

- uses: actions/[email protected]
with:
python-version: '3.x'
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992



- name: Run chart-testing (lint)
run: |
cd charts/aerospike-vector-search
ct lint --chart-dirs . --charts .
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: aerospike-vector-search
name: aerospike-vector-search
description: A Helm chart for Aerospike Vector Search
type: application
icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4
Expand All @@ -11,7 +11,7 @@ maintainers:
email: [email protected]

# The helm chart version
version: 0.7.0
version: 0.7.2

# The default version of Aerospike Vector Search
appVersion: "1.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ deployed AVS pods.

## Adding the helm chart repository

Add the `aerospike-io` helm repository if not already done. (Note: The repository has moved to artifact.aerospike.io. If you are still pointing to aerospike.github.io, please update the repository URL)
Add the `aerospike-helm` helm repository if not already done. (Note: The repository has moved to artifact.aerospike.io. If you are still pointing to aerospike.github.io, please update the repository URL)




```shell
Expand Down Expand Up @@ -52,15 +54,15 @@ helm repo add aerospike-io https://artifact.aerospike.io/artifactory/api/helm/ae
## Deploy the AVS Cluster

We recommend creating a new `.yaml` for providing configuration values to the helm chart for deployment.
See the [examples](examples) folder for examples.
See the [Aerospike Vector](https://github.com/aerospike/aerospike-vector) repository for examples and deployment scripts.

A sample values yaml file is shown below:

```yaml
replicaCount: 1

image:
tag: "0.11.1"
tag: "1.0.0"

aerospikeVectorSearchConfig:
aerospike:
Expand All @@ -72,31 +74,28 @@ aerospikeVectorSearchConfig:
Here `replicaCount` is the count of AVS pods that are deployed.
The AVS configuration is provided as yaml under the key `aerospikeVectorSearchConfig`.
[comment]: <> (Link to AVS docs should be added)
See [Aerospike Vector Search configuration]() for details.

We recommend naming the file with the name of the AVS cluster. For example if you want to name your AVS cluster as
`avs`, create a file `avs-values.yaml`.
Once you have created this custom values file, deploy the avs cluster, using the following command.
See [Aerospike Vector Search](https://aerospike.com/docs/vector/operate/configuration) configuration documentation for more details on AVS configuration.


### Create a new namespace
We recommend using `aerospike` namespace for the AVS cluster. If the namespace does not exist run the following command:
We recommend using a namespace for the AVS cluster. If the namespace does not exist run the following command:
```shell
kubectl create namespace aerospike
kubectl create namespace avs
```

### Create secrets
Create the secret for aerospike using your Aerospike licence file
Create the secret for avs using your Aerospike licence file
```shell
# kubectl --namespace <target namespace> create secret generic avs-secret--from-file=features.conf=<path to features conf file>
kubectl --namespace aerospike create secret generic aerospike-secret --from-file=features.conf=features.conf
kubectl --namespace avs create secret generic aerospike-secret --from-file=features.conf=features.conf
```

### Deploy the AVS cluster

```shell
# helm install --namespace <target namespace> <helm release name/cluster name> -f <path to custom values yaml> aerospike/aerospike-vector-search
helm install --namespace aerospike avs -f avs-values.yaml aerospike/aerospike-vector-search --version 0.6.0
helm install avs-chart --namespace avs -f avs-values.yaml aerospike/aerospike-vector-search
```

Here `avs` is the release name for the AVS cluster and also its cluster name.
Expand All @@ -106,7 +105,7 @@ On successful deployment you should see output similar to below:
```shell
NAME: avs
LAST DEPLOYED: Tue May 21 15:55:39 2024
NAMESPACE: aerospike
NAMESPACE: avs
STATUS: deployed
REVISION: 1
TEST SUITE: None
Expand Down Expand Up @@ -153,7 +152,7 @@ Upgrade the AVS deployment using the following command.

```shell
#helm upgrade --namespace <target namespace> <helm release name> -f <path to custom values yaml file> aerospike/aerospike-vector-search
helm upgrade --namespace aerospike avs -f avs-values.yaml aerospike/aerospike-vector-search
helm upgrade --namespace avs avs-chart -f avs-values.yaml aerospike/aerospike-vector-search
```

On successful execution of the command the AVS pods will undergo a rolling restart and come up with the new configuration.
Expand All @@ -170,7 +169,7 @@ Edit the `replicaCount` to the desired AVS instance count and upgrade the AVS de

```shell
#helm upgrade --namespace <target namespace> <helm release name> -f <path to custom values yaml file> aerospike/aerospike-vector-search
helm upgrade --namespace aerospike avs-f avs-values.yaml aerospike/aerospike-vector-search
helm upgrade --namespace avs avs-chart -f avs-values.yaml aerospike/aerospike-vector-search
```

Verify that the AVS cluster have been scaled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app: {{ include "aerospike-vector-search.fullname" . }}
app: {{ include "aerospike-vector-search.fullname" . }}
{{- include "aerospike-vector-search.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
Expand All @@ -45,22 +45,45 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if and .Values.aerospikeVectorSearchConfig.service (not (empty .Values.aerospikeVectorSearchConfig.service.ports)) }}
ports:
{{- range $k := .Values.aerospikeVectorSearchConfig.service.ports | keys }}
- name: {{ printf "svc-%s" $k }}
containerPort: {{ $k }}
protocol: TCP
{{- end -}}
{{- range $k := .Values.aerospikeVectorSearchConfig.manage.ports | keys }}
- name: {{ printf "manage-%s" $k }}
containerPort: {{ $k }}
protocol: TCP
{{- end -}}
{{- range $k := .Values.aerospikeVectorSearchConfig.interconnect.ports | keys }}
- name: {{ printf "interc-%s" $k }}
containerPort: {{ $k }}
protocol: TCP
{{- $svcPortCounter := 0 }}
{{- range $port, $config := .Values.aerospikeVectorSearchConfig.service.ports }}
- name: {{ printf "svc-%s" (default (printf "%d" $svcPortCounter) $config.name) }}
{{- $svcPortCounter = add $svcPortCounter 1 }}
containerPort: {{ $port }}
protocol: {{ default "TCP" $config.protocol }}
{{- if $config.addresses }}
addresses: {{ $config.addresses }}
{{- end }}
{{- end }}
{{- end }}
{{- if and .Values.aerospikeVectorSearchConfig.manage (not (empty .Values.aerospikeVectorSearchConfig.manage.ports)) }}
ports:
{{- $managePortCounter := 0 }}
{{- range $port, $config := .Values.aerospikeVectorSearchConfig.manage.ports }}
- name: {{ printf "manage-%s" (default (printf "%d" $managePortCounter) $config.name) }}
{{- $managePortCounter = add $managePortCounter 1 }}
containerPort: {{ $port }}
protocol: {{ default "TCP" $config.protocol }}
{{- if $config.addresses }}
addresses: {{ $config.addresses }}
{{- end }}
{{- end }}
{{- end }}
{{- if and .Values.aerospikeVectorSearchConfig.interconnect (not (empty .Values.aerospikeVectorSearchConfig.interconnect.ports)) }}
ports:
{{- $interconnectPortCounter := 0 }}
{{- range $port, $config := .Values.aerospikeVectorSearchConfig.interconnect.ports }}
- name: {{ printf "interc-%s" (default (printf "%d" $interconnectPortCounter) $config.name) }}
{{- $interconnectPortCounter = add $interconnectPortCounter 1 }}
containerPort: {{ $port }}
protocol: {{ default "TCP" $config.protocol }}
{{- if $config.addresses }}
addresses: {{ $config.addresses }}
{{- end }}
{{- end }}
{{- end }}
volumeMounts:
- name: aerospike-vector-search-configmap
mountPath: /etc/aerospike-vector-search/aerospike-vector-search.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,31 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

aerospikeVectorSearchConfig: {}
#cluster:
aerospikeVectorSearchConfig:
# Optional: service ports configuration
service:
ports: {}
# Optional: manage ports configuration
manage:
ports: {}
# Optional: interconnect ports configuration
interconnect:
ports: {}

# cluster:
# # Unique identifier for this cluster.
# cluster-name: aerospike-vector-search
#
# # Custom node-id as 8 byte long in Hexadecimal format.
# # It will be auto-generated if not specified.
# node-id: a1
#
# node-roles:
# - INDEX_QUERY
# - INDEX_UPDATE
## If TLS is desired, TLS configuration ids used
## and associated TLS configurations.
#tls:
# # node-roles:
# # - INDEX_QUERY
# # - INDEX_UPDATE
# ## If TLS is desired, TLS configuration ids used
# ## and associated TLS configurations.
# tls:
# service-tls:
# trust-store:
# store-file: tls/ca.aerospike.com.truststore.jks
Expand Down Expand Up @@ -58,8 +68,8 @@ aerospikeVectorSearchConfig: {}
# key-password-file: tls/keypass
# override-tls-hostname: asd.aerospike.com
#
## The AVS service listening ports, TLS and network interface.
#service:
# # The AVS service listening ports, TLS and network interface.
# service:
# ports:
# # Clear text service port.
# 5000:
Expand Down Expand Up @@ -91,8 +101,8 @@ aerospikeVectorSearchConfig: {}
# - address: 10.0.0.1
# port: 5443
#
## Management API listening ports, TLS and network interface.
#manage:
# # Management API listening ports, TLS and network interface.
# manage:
# ports:
# # Clear text port
# 5040:
Expand All @@ -108,8 +118,8 @@ aerospikeVectorSearchConfig: {}
# localhost
# tls-id: service-tls
#
## Intra cluster interconnect listening ports, TLS and network interface.
#interconnect:
# # Intra cluster interconnect listening ports, TLS and network interface.
# interconnect:
# # Interconnect client side TLS configuration
# # when TLS is enabled for interconnect
# client-tls-id: interconnect-tls
Expand All @@ -128,7 +138,7 @@ aerospikeVectorSearchConfig: {}
# localhost
# tls-id: interconnect-tls
#
#heartbeat:
# heartbeat:
# # Seed nodes to discover and form a cluster.
# seeds:
# # Clear text seed
Expand All @@ -138,15 +148,15 @@ aerospikeVectorSearchConfig: {}
# - address: 192.168.1.5
# port: 5001
#
## To enable client authentication
#security:
# # To enable client authentication
# security:
# auth-token:
# private-key: samples/auth/private_key.pem
# public-key: samples/auth/public_key.pem
# token-expiry: 300_000
#
## Aerospike DB storage configuration
#storage:
# # Aerospike DB storage configuration
# storage:
# seeds:
# - localhost:
# port: 3000
Expand All @@ -163,8 +173,8 @@ aerospikeVectorSearchConfig: {}
# username: admin
# password-file: aerospike-password.txt
#
## HNSW index configuration defaults
#hnsw:
# # HNSW index configuration defaults
# hnsw:
# healer:
# # Schedule healer runs using Quartz cron expressions.
# # See https://www.freeformatter.com/cron-expression-generator-quartz.html
Expand All @@ -174,8 +184,8 @@ aerospikeVectorSearchConfig: {}
# # Disable vector integrity check.
# enable-vector-integrity-check: false
#
## The logging properties.
#logging:
# # The logging properties.
# logging:
# file: /var/log/aerospike-vector-search/aerospike-vector-search.log
# enable-console-logging: true
# levels:
Expand Down
2 changes: 2 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
chart-dirs:
- chart

0 comments on commit e69349c

Please sign in to comment.