Skip to content

Commit

Permalink
Merge pull request kubernetes#5883 from zmerlynn/retry_packaging
Browse files Browse the repository at this point in the history
Retry apt operations to death
  • Loading branch information
a-robinson committed Mar 24, 2015
2 parents f1872d3 + ed56773 commit 10e2e9a
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions cluster/gce/configure-vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,27 @@ download-or-bust() {
# Install salt from GCS. See README.md for instructions on how to update these
# debs.
install-salt() {
apt-get update
echo "== Refreshing package database =="
until apt-get update; do
echo "== apt-get update failed, retrying =="
echo sleep 5
done

mkdir -p /var/cache/salt-install
cd /var/cache/salt-install

TARS=(
DEBS=(
libzmq3_3.2.3+dfsg-1~bpo70~dst+1_amd64.deb
python-zmq_13.1.0-1~bpo70~dst+1_amd64.deb
salt-common_2014.1.13+ds-1~bpo70+1_all.deb
salt-minion_2014.1.13+ds-1~bpo70+1_all.deb
)
URL_BASE="https://storage.googleapis.com/kubernetes-release/salt"

for deb in "${DEBS[@]}"; do
download-or-bust "${URL_BASE}/${deb}"
done

# Based on
# https://major.io/2014/06/26/install-debian-packages-without-starting-daemons/
# We do this to prevent Salt from starting the salt-minion
Expand All @@ -141,13 +149,17 @@ exit 101
EOF
chmod 0755 /usr/sbin/policy-rc.d

for tar in "${TARS[@]}"; do
download-or-bust "${URL_BASE}/${tar}"
dpkg -i "${tar}" || true
for deb in "${DEBS[@]}"; do
echo "== Installing ${deb}, ignore dependency complaints (will fix later) =="
dpkg --force-depends -i "${deb}"
done

# This will install any of the unmet dependencies from above.
apt-get install -f -y
echo "== Installing unmet dependencies =="
until apt-get install -f -y; do
echo "== apt-get install failed, retrying =="
echo sleep 5
done

rm /usr/sbin/policy-rc.d
}
Expand Down

0 comments on commit 10e2e9a

Please sign in to comment.