Skip to content

Introduce small script improvements #42

Introduce small script improvements

Introduce small script improvements #42

Workflow file for this run

on:
push:
jobs:
run-weaviate-local-k8s-basic:
runs-on: ubuntu-latest
name: Invoke weaviate-local-k8s action with basic parameters
env:
WORKERS: '3'
REPLICAS: '5'
WEAVIATE_VERSION: '1.24.3'
steps:
- id: invoke-local-k8s
uses: weaviate/weaviate-local-k8s@main
with:
workers: ${{ env.WORKERS }}
replicas: ${{ env.REPLICAS }}
weaviate-version: ${{ env.WEAVIATE_VERSION }}
- name: Check the configured values
run: |
replicas=$(kubectl get sts weaviate -n weaviate -o=jsonpath="{.spec.replicas}")
if [[ "$replicas" -ne ${{ env.REPLICAS }} ]]; then
echo "Error: Replicas count is not equal to ${{ env.REPLICAS }}. Found $replicas"
exit 1
fi
workers=$(kubectl get nodes --selector=node-role.kubernetes.io/control-plane!= --no-headers | wc -l)
if [[ "$workers" -ne ${{ env.WORKERS }} ]]; then
echo "Error: Workers count is not equal to ${{ env.WORKERS }}. Found $workers"
exit 1
fi
versions=$(curl -s http://127.0.0.1:8080/v1/nodes | jq '.nodes[] | .version' | tr -d '"')
for version in `echo $versions | tr '\n' ' '`; do
if [[ "$version" != "${{ env.WEAVIATE_VERSION }}" ]]; then
echo "Error: Version is not equal to ${{ env.WEAVIATE_VERSION }}. Found $version"
exit 1
fi
done
run-weaviate-local-k8s-all-params:
runs-on: ubuntu-latest
name: Invoke weaviate-local-k8s action passing all parameters
env:
WORKERS: '3'
REPLICAS: '6'
WEAVIATE_VERSION: 'preview--0952f59'
WEAVIATE_PORT: '8081'
WEAVIATE_GRPC_PORT: '50052'
HELM_BRANCH: 'raft-configuration'
VALUES_OVERRIDE: |
storage:
size: 50Gi
env:
ASYNC_INDEXING: true
steps:
- id: invoke-local-k8s
uses: weaviate/weaviate-local-k8s@main
with:
workers: ${{ env.WORKERS }}
replicas: ${{ env.REPLICAS }}
weaviate-version: ${{ env.WEAVIATE_VERSION }}
weaviate-port: ${{ env.WEAVIATE_PORT }}
weaviate-grpc-port: ${{ env.WEAVIATE_GRPC_PORT }}
helm-branch: ${{ env.HELM_BRANCH }}
values-override: ${{ env.VALUES_OVERRIDE }}
- name: Check the configured values
run: |
replicas=$(kubectl get sts weaviate -n weaviate -o=jsonpath="{.spec.replicas}")
if [[ "$replicas" -ne ${{ env.REPLICAS }} ]]; then
echo "Error: Replicas count is not equal to ${{ env.REPLICAS }}. Found $replicas"
exit 1
fi
workers=$(kubectl get nodes --selector=node-role.kubernetes.io/control-plane!= --no-headers | wc -l)
if [[ "$workers" -ne ${{ env.WORKERS }} ]]; then
echo "Error: Workers count is not equal to ${{ env.WORKERS }}. Found $workers"
exit 1
fi
versions=$(curl -s http://127.0.0.1:${{ env.WEAVIATE_PORT }}/v1/nodes | jq '.nodes[] | .version' | tr -d '"')
for version in `echo $versions | tr '\n' ' '`; do
if [[ "$version" != "1.24.2" ]]; then
echo "Error: Version is not equal to 1.24.2. Found $version"
exit 1
fi
done
run-weaviate-local-k8s-which-fails:
runs-on: ubuntu-latest
name: Create a single-node Weaviate cluster with non existing image.
env:
WORKERS: '1'
REPLICAS: '1'
WEAVIATE_VERSION: 'idontexist_youdidntseeme'
steps:
- id: invoke-local-k8s
uses: weaviate/weaviate-local-k8s@main
with:
workers: ${{ env.WORKERS }}
replicas: ${{ env.REPLICAS }}
weaviate-version: ${{ env.WEAVIATE_VERSION }}
continue-on-error: true
- name: Check that deployment failed
if: steps.invoke-local-k8s.outcome == 'success'
run: |
echo "The previous step should have failed, but it didn't"
exit 1
- name: Check that the deployment failed
run: |
availableReplicas=$(kubectl get sts weaviate -n weaviate -o=jsonpath='{.status.availableReplicas}')
if [[ "$replicas" -ne "0" ]]; then
echo "Error: Replicas count should be 0. Found $replicas"
exit 1
fi
run-weaviate-local-k8s-with-module:
runs-on: ubuntu-latest
name: Invoke weaviate-local-k8s action with text2vec-contextionary module
env:
WORKERS: '2'
REPLICAS: '3'
WEAVIATE_VERSION: '1.24.4'
MODULES: 'text2vec-contextionary'
steps:
- id: invoke-local-k8s
uses: weaviate/weaviate-local-k8s@main
with:
workers: ${{ env.WORKERS }}
replicas: ${{ env.REPLICAS }}
weaviate-version: ${{ env.WEAVIATE_VERSION }}
modules: ${{ env.MODULES }}
- name: Check the configured values
run: |
replicas=$(kubectl get sts weaviate -n weaviate -o=jsonpath="{.status.availableReplicas}")
if [[ "$replicas" -ne ${{ env.REPLICAS }} ]]; then
echo "Error: Replicas count is not equal to ${{ env.REPLICAS }}. Found $replicas"
exit 1
fi
workers=$(kubectl get nodes --selector=node-role.kubernetes.io/control-plane!= --no-headers | wc -l)
if [[ "$workers" -ne ${{ env.WORKERS }} ]]; then
echo "Error: Workers count is not equal to ${{ env.WORKERS }}. Found $workers"
exit 1
fi
versions=$(curl -s http://127.0.0.1:8080}/v1/nodes | jq '.nodes[] | .version' | tr -d '"')
for version in `echo $versions | tr '\n' ' '`; do
if [[ "$version" != "${{ env.WEAVIATE_VERSION }}" ]]; then
echo "Error: Version is not equal to ${{ env.WEAVIATE_VERSION }}. Found $version"
exit 1
fi
done
contextionary=$(kubectl get deployment contextionary -n weaviate -o=jsonpath="{.status.availableReplicas}")
if [[ "$contextionary" -ne "1" ]]; then
echo "Error: Contextionary replicas count is not equal to 1. Found $contextionary"
exit 1
fi
run-weaviate-local-k8s-upgrade:
runs-on: ubuntu-latest
name: Invoke weaviate-local-k8s upgrade to RAFT with basic parameters
env:
WORKERS: '3'
REPLICAS: '5'
WEAVIATE_VERSION: '1.24.6'
steps:
- name: Create ${{ env.WEAVIATE_VERSION }} Weaviate cluster with ${{ env.WORKERS }} workers and ${{ env.REPLICAS }} replicas
id: invoke-local-k8s
uses: weaviate/weaviate-local-k8s@main
with:
workers: ${{ env.WORKERS }}
replicas: ${{ env.REPLICAS }}
weaviate-version: ${{ env.WEAVIATE_VERSION }}
- name: Upgrade cluster to RAFT.
uses: weaviate/weaviate-local-k8s@main
with:
operation: upgrade
workers: ${{ env.WORKERS }}
replicas: ${{ env.REPLICAS }}
helm-branch: 'raft-configuration'
weaviate-version: "preview--21c08df"
- name: Check the configured values
run: |
replicas=$(kubectl get sts weaviate -n weaviate -o=jsonpath="{.spec.replicas}")
if [[ "$replicas" -ne ${{ env.REPLICAS }} ]]; then
echo "Error: Replicas count is not equal to ${{ env.REPLICAS }}. Found $replicas"
exit 1
fi
workers=$(kubectl get nodes --selector=node-role.kubernetes.io/control-plane!= --no-headers | wc -l)
if [[ "$workers" -ne ${{ env.WORKERS }} ]]; then
echo "Error: Workers count is not equal to ${{ env.WORKERS }}. Found $workers"
exit 1
fi
versions=$(curl -s http://127.0.0.1:8080/v1/nodes | jq '.nodes[] | .version' | tr -d '"')
for version in `echo $versions | tr '\n' ' '`; do
if [[ "$version" != "${{ env.WEAVIATE_VERSION }}" ]]; then
echo "Error: Version is not equal to ${{ env.WEAVIATE_VERSION }}. Found $version"
exit 1
fi
done