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

Add chia-healthcheck and chia-exporter to smoke test full_node #188

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
46 changes: 46 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,34 @@ jobs:
exit 1
fi

- name: Wait for Ready ChiaNode
run: |
found=0
timeout=600
endtime=$((SECONDS+timeout))
while [ $SECONDS -lt $endtime ]; do
ready_status=$(kubectl get pod chianode-test-node-0 -o=jsonpath='{.status.containerStatuses[*].ready}' || true)
if [ "$ready_status" != "" ]; then
statuses_grep_false=$(echo "$ready_status" | grep false)
if [ "$statuses_grep_false" = "" ]; then
echo "All containers in Pod are ready: $ready_status"
found=1
break
else
echo "Container ready states: $ready_status. Waiting... ${SECONDS}/${endtime}"
fi
else
echo "kubectl command failed this iteration, sleeping until next iteration... ${SECONDS}/${endtime}"
fi
sleep 5
done
if [ "$found" -eq 0 ]; then
echo "Timeout reached waiting for ChiaNode containers to enter Ready status."
echo "Getting Kubernetes Pods from the default namespace:"
kubectl get pods
exit 1
fi

- name: Check to make sure ChiaNode peer Service has one endpoint
run: |
service_endpoints_number=$(kubectl get endpoints chianode-test-node -o json | jq '.subsets[].addresses | length')
Expand Down Expand Up @@ -138,3 +166,21 @@ jobs:
exit 1
fi
echo "Expected 1 endpoint, found $service_endpoints_number"

- name: Check to make sure ChiaNode exporter Service has one endpoint
run: |
service_endpoints_number=$(kubectl get endpoints chianode-test-node-metrics -o json | jq '.subsets[].addresses | length')
if [ "$service_endpoints_number" -ne 1 ]; then
echo "ChiaNode exporter Service was found to have $service_endpoints_number endpoints, expected 1"
exit 1
fi
echo "Expected 1 endpoint, found $service_endpoints_number"

- name: Check to make sure ChiaNode healthcheck Service has one endpoint
run: |
service_endpoints_number=$(kubectl get endpoints chianode-test-node-healthcheck -o json | jq '.subsets[].addresses | length')
if [ "$service_endpoints_number" -ne 1 ]; then
echo "ChiaNode healthcheck Service was found to have $service_endpoints_number endpoints, expected 1"
exit 1
fi
echo "Expected 1 endpoint, found $service_endpoints_number"
6 changes: 6 additions & 0 deletions tests/chianode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ spec:
testnet: true
timezone: "UTC"
logLevel: "INFO"
chiaExporter:
enabled: true
chiaHealthcheck:
enabled: true
service:
enabled: true
storage:
chiaRoot:
persistentVolumeClaim:
Expand Down
Loading