Skip to content

Commit 3fb81c7

Browse files
committed
CI: add more debug logging to Docker caching
1 parent d4a881e commit 3fb81c7

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/ci/docker/run.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
6464

6565
docker --version >> $hash_key
6666

67-
# Include cache version. Currently it is needed to bust Docker
68-
# cache key after opting in into the old Docker build backend.
69-
echo "1" >> $hash_key
67+
# Include cache version. Can be used to manually bust the Docker cache.
68+
echo "2" >> $hash_key
7069

7170
cksum=$(sha512sum $hash_key | \
7271
awk '{print $1}')
@@ -78,6 +77,10 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
7877
set +e
7978
retry curl --max-time 600 -y 30 -Y 10 --connect-timeout 30 -f -L -C - \
8079
-o /tmp/rustci_docker_cache "$url"
80+
81+
docker_archive_hash=$(sha512sum /tmp/rustci_docker_cache | awk '{print $1}')
82+
echo "Downloaded archive hash: ${docker_archive_hash}"
83+
8184
echo "Loading images into docker"
8285
# docker load sometimes hangs in the CI, so time out after 10 minutes with TERM,
8386
# KILL after 12 minutes
@@ -115,8 +118,10 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
115118
digest=$(docker inspect rust-ci --format '{{.Id}}')
116119
echo "Built container $digest"
117120
if ! grep -q "$digest" <(echo "$loaded_images"); then
118-
echo "Uploading finished image to $url"
121+
echo "Uploading finished image $digest to $url"
119122
set +e
123+
# Print image history for easier debugging of layer SHAs
124+
docker history rust-ci
120125
docker history -q rust-ci | \
121126
grep -v missing | \
122127
xargs docker save | \
@@ -131,6 +136,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
131136
mkdir -p "$dist"
132137
echo "$url" >"$info"
133138
echo "$digest" >>"$info"
139+
cat "$info"
134140
fi
135141
elif [ -f "$docker_dir/disabled/$image/Dockerfile" ]; then
136142
if isCI; then

0 commit comments

Comments
 (0)