diff --git a/evergreen/prelude_db_contrib_tool.sh b/evergreen/prelude_db_contrib_tool.sh index 5c761302c8f..e111ea2e6bb 100644 --- a/evergreen/prelude_db_contrib_tool.sh +++ b/evergreen/prelude_db_contrib_tool.sh @@ -5,9 +5,35 @@ function setup_db_contrib_tool { export PIPX_BIN_DIR="${workdir}/pipx/bin" export PATH="$PATH:$PIPX_BIN_DIR" - python -m pip --disable-pip-version-check install "pip==21.0.1" "wheel==0.37.0" || exit 1 - # We force reinstall here because when we download the previous venv the shebang - # in pipx still points to the old machines python location. - python -m pip --disable-pip-version-check install --force-reinstall --no-deps "pipx==1.6.0" || exit 1 - pipx install "db-contrib-tool==0.8.5" --pip-args="--no-cache-dir" || exit 1 + for i in {1..5}; do + python -m pip --disable-pip-version-check install "pip==21.0.1" "wheel==0.37.0" && RET=0 && break || RET=$? && sleep 1 + echo "Failed to install pip and wheel, retrying..." + done + + if [ $RET -ne 0 ]; then + echo "Failed to install pip and wheel" + exit $RET + fi + + for i in {1..5}; do + # We force reinstall here because when we download the previous venv the shebang + # in pipx still points to the old machines python location. + python -m pip --disable-pip-version-check install --force-reinstall --no-deps "pipx==1.6.0" && RET=0 && break || RET=$? && sleep 1 + echo "Failed to install pipx, retrying..." + done + + if [ $RET -ne 0 ]; then + echo "Failed to install pipx" + exit $RET + fi + + for i in {1..5}; do + pipx install --force "db-contrib-tool==0.8.5" --pip-args="--no-cache-dir" && RET=0 && break || RET=$? && sleep 1 + echo "Failed to install db-contrib-tool, retrying..." + done + + if [ $RET -ne 0 ]; then + echo "Failed to install db-contrib-tool" + exit $RET + fi }