From 1051967e92e4d801bfc38e61a8902ffd9bc93cd4 Mon Sep 17 00:00:00 2001 From: Peter Andreas Entschev Date: Thu, 15 Aug 2024 04:34:42 -0700 Subject: [PATCH] Make several attempts to clone Distributed in case of failure --- ci/test_common.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ci/test_common.sh b/ci/test_common.sh index 1480e17f..48592e36 100755 --- a/ci/test_common.sh +++ b/ci/test_common.sh @@ -173,7 +173,23 @@ install_distributed_dev_mode() { # to run non-public API tests in CI. rapids-logger "Install Distributed in developer mode" - git clone https://github.com/dask/distributed /tmp/distributed -b 2024.1.1 + MAX_ATTEMPTS=5 + for attempt in $(seq 1 $MAX_ATTEMPTS); do + rm -rf /tmp/distributed + + if git clone https://github.com/dask/distributed /tmp/distributed -b 2024.1.1; then + break + else + + if [ $attempt -eq $MAX_ATTEMPTS ]; then + rapids-logger "Maximum number of attempts to clone Distributed failed." + exit 1 + fi + + sleep 1 + fi + done + pip install -e /tmp/distributed # `pip install -e` removes files under `distributed` but not the directory, later # causing failures to import modules.