Commit 913e6ce3 authored by David Oppenheimer's avatar David Oppenheimer

Revert "Kubemark scripts retry failed gcloud commands"

parent ac373b6e
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
source "${KUBE_ROOT}/cluster/kubemark/config-default.sh" source "${KUBE_ROOT}/cluster/kubemark/config-default.sh"
source "${KUBE_ROOT}/cluster/kubemark/util.sh" source "${KUBE_ROOT}/cluster/kubemark/util.sh"
source "${KUBE_ROOT}/cluster/kube-env.sh"
detect-project &> /dev/null detect-project &> /dev/null
export PROJECT export PROJECT
...@@ -24,22 +23,3 @@ export PROJECT ...@@ -24,22 +23,3 @@ export PROJECT
MASTER_NAME="${INSTANCE_PREFIX}-kubemark-master" MASTER_NAME="${INSTANCE_PREFIX}-kubemark-master"
MASTER_TAG="kubemark-master" MASTER_TAG="kubemark-master"
EVENT_STORE_NAME="${INSTANCE_PREFIX}-event-store" EVENT_STORE_NAME="${INSTANCE_PREFIX}-event-store"
RETRIES=3
# Runs gcloud compute command with the given parameters. Up to $RETRIES will be made
# to execute the command.
# arguments:
# $@: all stuff that goes after 'gcloud compute '
function run-gcloud-compute-with-retries {
for attempt in $(seq 1 ${RETRIES}); do
if ! gcloud compute $@; then
echo -e "${color_yellow}Attempt ${attempt} failed to $@. Retrying.${color_norm}" >& 2
sleep $(($attempt * 5))
else
return
fi
done
echo -e "${color_red} Failed to $@.${color_norm}" >& 2
exit 1
}
...@@ -46,12 +46,12 @@ cd $CURR_DIR ...@@ -46,12 +46,12 @@ cd $CURR_DIR
GCLOUD_COMMON_ARGS="--project ${PROJECT} --zone ${ZONE}" GCLOUD_COMMON_ARGS="--project ${PROJECT} --zone ${ZONE}"
run-gcloud-compute-with-retries disks create "${MASTER_NAME}-pd" \ gcloud compute disks create "${MASTER_NAME}-pd" \
${GCLOUD_COMMON_ARGS} \ ${GCLOUD_COMMON_ARGS} \
--type "${MASTER_DISK_TYPE}" \ --type "${MASTER_DISK_TYPE}" \
--size "${MASTER_DISK_SIZE}" --size "${MASTER_DISK_SIZE}"
run-gcloud-compute-with-retries instances create "${MASTER_NAME}" \ gcloud compute instances create "${MASTER_NAME}" \
${GCLOUD_COMMON_ARGS} \ ${GCLOUD_COMMON_ARGS} \
--machine-type "${MASTER_SIZE}" \ --machine-type "${MASTER_SIZE}" \
--image-project="${MASTER_IMAGE_PROJECT}" \ --image-project="${MASTER_IMAGE_PROJECT}" \
...@@ -61,7 +61,7 @@ run-gcloud-compute-with-retries instances create "${MASTER_NAME}" \ ...@@ -61,7 +61,7 @@ run-gcloud-compute-with-retries instances create "${MASTER_NAME}" \
--scopes "storage-ro,compute-rw,logging-write" \ --scopes "storage-ro,compute-rw,logging-write" \
--disk "name=${MASTER_NAME}-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no" --disk "name=${MASTER_NAME}-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no"
run-gcloud-compute-with-retries firewall-rules create "${INSTANCE_PREFIX}-kubemark-master-https" \ gcloud compute firewall-rules create "${INSTANCE_PREFIX}-kubemark-master-https" \
--project "${PROJECT}" \ --project "${PROJECT}" \
--network "${NETWORK}" \ --network "${NETWORK}" \
--source-ranges "0.0.0.0/0" \ --source-ranges "0.0.0.0/0" \
...@@ -73,12 +73,12 @@ MASTER_IP=$(gcloud compute instances describe ${MASTER_NAME} \ ...@@ -73,12 +73,12 @@ MASTER_IP=$(gcloud compute instances describe ${MASTER_NAME} \
if [ "${SEPARATE_EVENT_MACHINE:-false}" == "true" ]; then if [ "${SEPARATE_EVENT_MACHINE:-false}" == "true" ]; then
EVENT_STORE_NAME="${INSTANCE_PREFIX}-event-store" EVENT_STORE_NAME="${INSTANCE_PREFIX}-event-store"
run-gcloud-compute-with-retries disks create "${EVENT_STORE_NAME}-pd" \ gcloud compute disks create "${EVENT_STORE_NAME}-pd" \
${GCLOUD_COMMON_ARGS} \ ${GCLOUD_COMMON_ARGS} \
--type "${MASTER_DISK_TYPE}" \ --type "${MASTER_DISK_TYPE}" \
--size "${MASTER_DISK_SIZE}" --size "${MASTER_DISK_SIZE}"
run-gcloud-compute-with-retries instances create "${EVENT_STORE_NAME}" \ gcloud compute instances create "${EVENT_STORE_NAME}" \
${GCLOUD_COMMON_ARGS} \ ${GCLOUD_COMMON_ARGS} \
--machine-type "${MASTER_SIZE}" \ --machine-type "${MASTER_SIZE}" \
--image-project="${MASTER_IMAGE_PROJECT}" \ --image-project="${MASTER_IMAGE_PROJECT}" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment