Skip to content

Added timeouts to readiness probes #237

Added timeouts to readiness probes

Added timeouts to readiness probes #237

Workflow file for this run

name: E2E Tests
on:
workflow_dispatch: {}
push: {}
jobs:
test:
runs-on:
- banzai-runner
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install kubectl
uses: azure/setup-kubectl@v3
with:
version: "v1.22.17"
- name: Start a Kind cluster
uses: helm/[email protected]
with:
cluster_name: kind
version: "v0.19.0"
node_image: kindest/node:v1.22.17@sha256:9af784f45a584f6b28bce2af84c494d947a05bd709151466489008f80a9ce9d5
wait: "600s"
- name: Build docker image
run: |
docker build -t banzai:test-latest .
- name: Copy docker image to nodes
run: |
kind load docker-image banzai:test-latest
- name: Start banzai
run: |
kubectl create secret generic auth-token-secret --from-literal=auth-token=${{ secrets.ArchiveAuthToken }}
# Deploy banzai stack
kubectl apply -k banzai/tests/k8s
# Wait for banzai to be ready
kubectl wait --for=condition=Ready --timeout=60m pods -l group=banzai-e2e-test
LISTENER_POD=$(kubectl get pods -l app=banzai-listener -o jsonpath='{.items[0].metadata.name}')
echo "LISTENER_POD=${LISTENER_POD}" >> $GITHUB_ENV
WORKERS_POD=$(kubectl get pods -l app=banzai-celery-workers -o jsonpath='{.items[0].metadata.name}')
echo "WORKERS_POD=${WORKERS_POD}" >> $GITHUB_ENV
LARGE_WORKERS_POD=$(kubectl get pods -l app=banzai-large-celery-workers -o jsonpath='{.items[0].metadata.name}')
echo "LARGE_WORKERS_POD=${LARGE_WORKERS_POD}" >> $GITHUB_ENV
- name: Test Super Bias Creation
run: |
set +e
export START=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
kubectl exec ${LISTENER_POD} -c banzai-listener -- pytest -s --pyargs banzai --durations=0 --junitxml=/archive/engineering/pytest-master-bias.xml -m master_bias
EXIT_CODE=$?
# Always print logs even if (especially if?) the reduction fails
kubectl logs ${LISTENER_POD} --since-time=$START --all-containers --prefix=true
kubectl logs ${WORKERS_POD} --since-time=$START --all-containers --prefix=true
kubectl logs ${LARGE_WORKERS_POD} --since-time=$START --all-containers --prefix=true
# Exit with the captured status so the job properly fails or succeeds
exit $EXIT_CODE
- name: Test Super Dark Creation
run: |
set +e
export START=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
kubectl exec ${LISTENER_POD} -c banzai-listener -- pytest -s --pyargs banzai --durations=0 --junitxml=/archive/engineering/pytest-master-dark.xml -m master_dark
EXIT_CODE=$?
# Always print logs even if (especially if?) the reduction fails
kubectl logs ${LISTENER_POD} --since-time=$START --all-containers --prefix=true
kubectl logs ${WORKERS_POD} --since-time=$START --all-containers --prefix=true
kubectl logs ${LARGE_WORKERS_POD} --since-time=$START --all-containers --prefix=true
# Exit with the captured status so the job properly fails or succeeds
exit $EXIT_CODE
- name: Test Super Flat Creation
run: |
set +e
export START=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
kubectl exec ${LISTENER_POD} -c banzai-listener -- pytest -s --pyargs banzai --durations=0 --junitxml=/archive/engineering/pytest-master-flat.xml -m master_flat
EXIT_CODE=$?
# Always print logs even if (especially if?) the reduction fails
kubectl logs ${LISTENER_POD} --since-time=$START --all-containers --prefix=true
kubectl logs ${WORKERS_POD} --since-time=$START --all-containers --prefix=true
kubectl logs ${LARGE_WORKERS_POD} --since-time=$START --all-containers --prefix=true
# Exit with the captured status so the job properly fails or succeeds
exit $EXIT_CODE
- name: Test Science Frame Creation
run: |
set +e
export START=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
kubectl exec ${LISTENER_POD} -c banzai-listener -- pytest -s --pyargs banzai --durations=0 --junitxml=/archive/engineering/pytest-science-files.xml -m science_files
EXIT_CODE=$?
# Always print logs even if (especially if?) the reduction fails
kubectl logs ${LISTENER_POD} --since-time=$START --all-containers --prefix=true
kubectl logs ${WORKERS_POD} --since-time=$START --all-containers --prefix=true
kubectl logs ${LARGE_WORKERS_POD} --since-time=$START --all-containers --prefix=true
# Exit with the captured status so the job properly fails or succeeds
exit $EXIT_CODE
- name: Cleanup
run: |
kubectl delete service --selector=group=banzai-e2e-test
kubectl delete deployment --selector=group=banzai-e2e-test