[RLlib] Retry pip installs (after waiting n seconds) in install-dependencies.sh (#8354)

This commit is contained in:
Sven Mika
2020-05-07 17:39:35 +02:00
committed by GitHub
parent dd3c050168
commit 2b0817cbd3
+14 -1
View File
@@ -216,7 +216,20 @@ install_dependencies() {
# These packages aren't Windows-compatible
pip_packages+=(blist) # https://github.com/DanielStutzbach/blist/issues/81#issue-391460716
fi
CC=gcc pip install "${pip_packages[@]}"
# Try n times; we often encounter OpenSSL.SSL.WantReadError (or others)
# that break the entire CI job: Simply retry installation in this case
# after n seconds.
local status="0";
local errmsg="";
for i in {1..3};
do
errmsg=$(CC=gcc pip install "${pip_packages[@]}" 2>&1) && break;
status=$errmsg && echo "'pip install ...' failed, will retry after n seconds!" && sleep 30;
done
if [ "$status" != "0" ]; then
echo "${status}" && return 1
fi
fi
if [ "${LINT-}" = 1 ]; then