Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VEC-430 configure test and linting for all helm charts #48

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 191 additions & 0 deletions .github/workflows/lint-and-test-charts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
name: Lint and Test Charts

on: pull_request

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

- name: Set up Helm
uses: azure/[email protected]
with:
version: latest

- uses: actions/setup-python@v5
with:
python-version: '3.x'
check-latest: true

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed="$(ct list-changed --chart-dirs . --target-branch ${{ github.event.repository.default_branch }} \
| grep "aerospike-vector-search")"
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Run chart-testing (lint version bump)
if: steps.list-changed.outputs.changed == 'true'
run: |
ct lint --chart-dirs . --target-branch ${{ github.event.repository.default_branch }}

- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: |
cd aerospike-vector-search
ct lint --chart-dirs . --charts . --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]

- name: Setup Prerequisites
if: steps.list-changed.outputs.changed == 'true'
run: |

echo "Deploying AKO"
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.30.0/install.sh \
| bash -s v0.30.0

kubectl create -f https://operatorhub.io/install/aerospike-kubernetes-operator.yaml
echo "Waiting for AKO"
while true; do
if kubectl --namespace operators get deployment/aerospike-operator-controller-manager &> /dev/null; then
kubectl --namespace operators wait \
--for=condition=available --timeout=180s deployment/aerospike-operator-controller-manager
break
fi
done

echo "Grant permissions to the target namespace"
kubectl create namespace aerospike
kubectl --namespace aerospike create serviceaccount aerospike-operator-controller-manager
kubectl create clusterrolebinding aerospike-cluster \
--clusterrole=aerospike-cluster --serviceaccount=aerospike:aerospike-operator-controller-manager

echo "Set Secrets for Aerospike Cluster"
kubectl --namespace aerospike create secret generic aerospike-secret \
--from-literal=features.conf="$(echo "${{ secrets.FEATURES_CONF }}")"

kubectl apply -f - <<-EOF
apiVersion: asdb.aerospike.com/v1
kind: AerospikeCluster
metadata:
name: aerospike-cluster
namespace: aerospike
spec:
size: 1
image: aerospike/aerospike-server-enterprise:7.0.0.5
podSpec:
multiPodPerHost: true
storage:
filesystemVolumePolicy:
cascadeDelete: true
initMethod: deleteFiles
volumes:
- name: workdir
source:
persistentVolume:
storageClass: standard
volumeMode: Filesystem
size: 3Gi
aerospike:
path: /opt/aerospike
- name: nsvol1
aerospike:
path: /mnt/disks/test
source:
persistentVolume:
storageClass: standard
volumeMode: Filesystem
size: 16G
- name: nsvol2
aerospike:
path: /mnt/disks/avs-index
source:
persistentVolume:
storageClass: standard
volumeMode: Filesystem
size: 16G
- name: nsvol3
aerospike:
path: /mnt/disks/avs-data
source:
persistentVolume:
storageClass: standard
volumeMode: Filesystem
size: 16G
- name: nsvol4
aerospike:
path: /mnt/disks/avs-meta
source:
persistentVolume:
storageClass: standard
volumeMode: Filesystem
size: 16G
- name: aerospike-config-secret
source:
secret:
secretName: aerospike-secret
aerospike:
path: /etc/aerospike/secret
aerospikeConfig:
service:
feature-key-file: /etc/aerospike/secret/features.conf
# security: {}
network:
service:
port: 3000
fabric:
port: 3001
heartbeat:
port: 3002
namespaces:
- name: test
replication-factor: 2
storage-engine:
type: device
filesize: 17179869184
files:
- /mnt/disks/test/test.dat
- name: avs-index
replication-factor: 2
storage-engine:
type: device
filesize: 17179869184
files:
- /mnt/disks/avs-index/avs-index.dat
- name: avs-data
replication-factor: 2
storage-engine:
type: device
filesize: 17179869184
files:
- /mnt/disks/avs-data/avs-data.dat
- name: avs-meta
nsup-period: 600
nsup-threads: 2
evict-tenths-pct: 5
replication-factor: 2
storage-engine:
type: device
filesize: 17179869184
files:
- /mnt/disks/avs-meta/avs-meta.dat
EOF

- name: Run chart-testing (install)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am reading this right, it checks if any chart has changed and if so runs lint on vector.

Is this generic? What does test do in this case? Do we need to install ako etc?

if: steps.list-changed.outputs.changed == 'true'
run: |
cd aerospike-vector-search
ct install --namespace aerospike --chart-dirs . \
--target-branch ${{ github.event.repository.default_branch }}
4 changes: 2 additions & 2 deletions aerospike-vector-search/Chart.yaml
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.6.0
version: 0.6.1

# The default version of Aerospike Vector Search
appVersion: "0.11.1"
Loading
Loading