From 86913758403c87eb0cfe99215be41a0a103173e3 Mon Sep 17 00:00:00 2001 From: Yuki Iwai Date: Sun, 13 Aug 2023 21:39:17 +0900 Subject: [PATCH] E2E: Add additional check to verify if the components are ready Signed-off-by: Yuki Iwai --- .../v1beta1/components/webhook/webhooks.yaml | 3 --- .../v1beta1/scripts/gh-actions/setup-katib.sh | 21 ++++++++++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/manifests/v1beta1/components/webhook/webhooks.yaml b/manifests/v1beta1/components/webhook/webhooks.yaml index 3ffff36bd3f..b8f5cd8e0bb 100644 --- a/manifests/v1beta1/components/webhook/webhooks.yaml +++ b/manifests/v1beta1/components/webhook/webhooks.yaml @@ -9,7 +9,6 @@ webhooks: admissionReviewVersions: - v1 clientConfig: - caBundle: Cg== service: name: katib-controller namespace: kubeflow @@ -35,7 +34,6 @@ webhooks: admissionReviewVersions: - v1 clientConfig: - caBundle: Cg== service: name: katib-controller namespace: kubeflow @@ -55,7 +53,6 @@ webhooks: admissionReviewVersions: - v1 clientConfig: - caBundle: Cg== service: name: katib-controller namespace: kubeflow diff --git a/test/e2e/v1beta1/scripts/gh-actions/setup-katib.sh b/test/e2e/v1beta1/scripts/gh-actions/setup-katib.sh index 97c322b3db9..9eb9472027b 100755 --- a/test/e2e/v1beta1/scripts/gh-actions/setup-katib.sh +++ b/test/e2e/v1beta1/scripts/gh-actions/setup-katib.sh @@ -65,8 +65,27 @@ echo "Deploying Katib" cd ../../../../../ && WITH_DATABASE_TYPE=$WITH_DATABASE_TYPE make deploy && cd - # Wait until all Katib pods is running. +MAX_RETRY_COUNT=24 +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 | tr -d ' ')" = "${COMPONENTS_NUM}" ]; do + echo -e "\nWaiting for katib components to be created" + kubectl get pods -n kubeflow || : + kubectl describe replicasets -n kubeflow || : + + sleep 5 + 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 wait --for=condition=ContainersReady=True --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) echo "All Katib components are running."