about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-08-27 09:45:17 +0200
committerGitHub <noreply@github.com>2023-08-27 09:45:17 +0200
commit50dec941218d2222f8fe4e95a103be34e9218228 (patch)
treee21c11d052d7f6c6230d7853b75bf92a7468df7b /src
parentbe416b99eddd3e2bbc9459b96555e2d06d681536 (diff)
parent3fb81c7093c07557045c7d08a10b0092afaad912 (diff)
downloadrust-50dec941218d2222f8fe4e95a103be34e9218228.tar.gz
rust-50dec941218d2222f8fe4e95a103be34e9218228.zip
Rollup merge of #114927 - Kobzol:ci-docker-caching-log, r=Mark-Simulacrum
CI: add more debug logging to Docker caching

Seems like the trouble with the Docker update continues, and rustup has some problems with downloading cached Docker layers from S3 (https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/rustup.20CI.20fails.20to.20install.20Docker.20images.20for.20armv7-linux). This PR adds more logging to Docker caching and busts the cache to rebuild all images.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ci/docker/run.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh
index 8bd8beb873b..e9c155b1378 100755
--- a/src/ci/docker/run.sh
+++ b/src/ci/docker/run.sh
@@ -64,9 +64,8 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
 
       docker --version >> $hash_key
 
-      # Include cache version. Currently it is needed to bust Docker
-      # cache key after opting in into the old Docker build backend.
-      echo "1" >> $hash_key
+      # Include cache version. Can be used to manually bust the Docker cache.
+      echo "2" >> $hash_key
 
       cksum=$(sha512sum $hash_key | \
         awk '{print $1}')
@@ -78,6 +77,10 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
       set +e
       retry curl --max-time 600 -y 30 -Y 10 --connect-timeout 30 -f -L -C - \
         -o /tmp/rustci_docker_cache "$url"
+
+      docker_archive_hash=$(sha512sum /tmp/rustci_docker_cache | awk '{print $1}')
+      echo "Downloaded archive hash: ${docker_archive_hash}"
+
       echo "Loading images into docker"
       # docker load sometimes hangs in the CI, so time out after 10 minutes with TERM,
       # KILL after 12 minutes
@@ -115,8 +118,10 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
       digest=$(docker inspect rust-ci --format '{{.Id}}')
       echo "Built container $digest"
       if ! grep -q "$digest" <(echo "$loaded_images"); then
-        echo "Uploading finished image to $url"
+        echo "Uploading finished image $digest to $url"
         set +e
+        # Print image history for easier debugging of layer SHAs
+        docker history rust-ci
         docker history -q rust-ci | \
           grep -v missing | \
           xargs docker save | \
@@ -131,6 +136,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
       mkdir -p "$dist"
       echo "$url" >"$info"
       echo "$digest" >>"$info"
+      cat "$info"
     fi
 elif [ -f "$docker_dir/disabled/$image/Dockerfile" ]; then
     if isCI; then