Skip to content

Bump GKE provisioning timeout #995

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

Merged
merged 1 commit into from
Oct 31, 2022
Merged
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
4 changes: 3 additions & 1 deletion .openshift-ci/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def teardown(self):


class GKECluster:
PROVISION_TIMEOUT = 20 * 60
# Provisioning timeout is tightly coupled to the time it may take gke.sh to
# create a cluster.
PROVISION_TIMEOUT = 90 * 60
WAIT_TIMEOUT = 20 * 60
TEARDOWN_TIMEOUT = 5 * 60
PROVISION_PATH = "scripts/ci/gke.sh"
Expand Down
19 changes: 11 additions & 8 deletions scripts/ci/gke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,32 +142,35 @@ create_cluster() {
success=1
break
elif [[ "${status}" == 124 ]]; then
echo >&2 "gcloud command timed out. Checking to see if cluster is still creating"
info "gcloud command timed out. Checking to see if cluster is still creating"
if ! gcloud container clusters describe "${CLUSTER_NAME}" >/dev/null; then
echo >&2 "Create cluster did not create the cluster in Google. Trying a different zone..."
info "Create cluster did not create the cluster in Google. Trying a different zone..."
else
for i in {1..60}; do
if [[ "$(gcloud container clusters describe "${CLUSTER_NAME}" --format json | jq -r .status)" == "RUNNING" ]]; then
success=1
break
fi
sleep 20
echo "Currently have waited $((i * 5)) for cluster ${CLUSTER_NAME} in ${zone} to move to running state"
info "Waiting for cluster ${CLUSTER_NAME} in ${zone} to move to running state (wait $i of 60)"
done
fi

if [[ "${success}" == 1 ]]; then
echo "Successfully launched cluster ${CLUSTER_NAME}"
info "Successfully launched cluster ${CLUSTER_NAME}"
break
fi
echo >&2 "Timed out after 10 more minutes. Trying another zone..."
echo >&2 "Deleting the cluster"
gcloud container clusters delete "${CLUSTER_NAME}" --async
warn "Timed out"
warn "Attempting to delete the cluster before trying another zone"
gcloud container clusters delete "${CLUSTER_NAME}" || {
error "An error occurred deleting the cluster: $?"
true
}
fi
done

if [[ "${success}" == "0" ]]; then
echo "Cluster creation failed"
error "Cluster creation failed"
return 1
fi
}
Expand Down