Skip to content

Commit

Permalink
E2E: Add additional check to verify if the components are ready
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
  • Loading branch information
tenzen-y committed Aug 13, 2023
1 parent 888bec3 commit 64851da
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/e2e/v1beta1/scripts/gh-actions/setup-katib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,40 @@ echo "Deploying Katib"
cd ../../../../../ && WITH_DATABASE_TYPE=$WITH_DATABASE_TYPE make deploy && cd -

# Wait until all Katib pods is running.
MAX_RETRY_COUNT=10
COMPONENTS_NUM=3
if "${DEPLOY_KATIB_UI}"; then
COMPONENTS_NUM=4
fi
until [ "$(kubectl get pods -n kubeflow -l "katib.kubeflow.org/component in ($WITH_DATABASE_TYPE,controller,ui,db-manager)" -oname | wc -l)" = "${COMPONENTS_NUM}" ]; do
echo -e "Waiting for katib components to be created\n"
kubectl get pods -n kubeflow || :

sleep 2
MAX_RETRY_COUNT=$((MAX_RETRY_COUNT - 1))
if [ "${MAX_RETRY_COUNT}" = "0" ]; then
echo "Failed to create katib components"
exit 1
fi
done

TIMEOUT=120s
kubectl wait --for=condition=ready --timeout=${TIMEOUT} -l "katib.kubeflow.org/component in ($WITH_DATABASE_TYPE,controller,db-manager,ui)" -n kubeflow pod ||
(kubectl get pods -n kubeflow && kubectl describe pods -n kubeflow && exit 1)

MAX_RETRY_COUNT=10
until [ "$(kubectl get pod -n kubeflow -l katib.kubeflow.org/component=controller -ojson | jq '.items[].status.conditions[] | select(.type=="ContainersReady").status')" = "True" ]; do
echo -e "Waiting for Katib controller to be ready\n"
kubectl get pods -n kubeflow || :

sleep 2
MAX_RETRY_COUNT=$((MAX_RETRY_COUNT - 1))
if [ "${MAX_RETRY_COUNT}" = "0" ]; then
echo "Failed to set up Katib controller"
exit 1
fi
done

echo "All Katib components are running."
echo "Katib deployments"
kubectl -n kubeflow get deploy
Expand Down

0 comments on commit 64851da

Please sign in to comment.