Make sure that all debugging commands run by adding || true #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |