Skip to content

Commit 1ea34fb

Browse files
authored
Rollup merge of rust-lang#90122 - rusticstuff:ci_curl_max_time, r=Mark-Simulacrum
CI: make docker cache download and `docker load` time out after 10 minutes Might help to prevent timeouts we have been seeing: * https://github.com/rust-lang-ci/rust/runs/3946294286?check_suite_focus=true#step:25:23 * https://github.com/rust-lang-ci/rust/runs/3956799200?check_suite_focus=true#step:25:22 * https://github.com/rust-lang-ci/rust/runs/3962928502?check_suite_focus=true#step:25:23 * https://github.com/rust-lang-ci/rust/runs/3967892291?check_suite_focus=true * https://github.com/rust-lang-ci/rust/runs/3971202204?check_suite_focus=true If the download or loading the images into docker times out the CI will still continue and rebuild the docker image from scratch.
2 parents 270c800 + 3e6a695 commit 1ea34fb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ci/docker/run.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,13 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
7070
echo "Attempting to download $url"
7171
rm -f /tmp/rustci_docker_cache
7272
set +e
73-
retry curl -y 30 -Y 10 --connect-timeout 30 -f -L -C - -o /tmp/rustci_docker_cache "$url"
74-
loaded_images=$(docker load -i /tmp/rustci_docker_cache | sed 's/.* sha/sha/')
73+
retry curl --max-time 600 -y 30 -Y 10 --connect-timeout 30 -f -L -C - \
74+
-o /tmp/rustci_docker_cache "$url"
75+
echo "Loading images into docker"
76+
# docker load sometimes hangs in the CI, so time out after 10 minutes with TERM,
77+
# KILL after 12 minutes
78+
loaded_images=$(/usr/bin/timeout -k 720 600 docker load -i /tmp/rustci_docker_cache \
79+
| sed 's/.* sha/sha/')
7580
set -e
7681
echo "Downloaded containers:\n$loaded_images"
7782
fi

0 commit comments

Comments
 (0)