Skip to content

Commit 82f01bf

Browse files
authored
Cleanup check after disk layout understood for arm64 (#60079)
1 parent e3345fd commit 82f01bf

File tree

3 files changed

+32
-23
lines changed

3 files changed

+32
-23
lines changed

.github/workflows/ci-image-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,5 @@ jobs:
206206
if-no-files-found: 'error'
207207
retention-days: 2
208208
if: inputs.upload-mount-cache-artifact == 'true'
209+
- name: "Check disk space after build"
210+
run: df -H

scripts/ci/make_mnt_writeable.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,10 @@ function make_mnt_writeable {
2020
echo "Investigating node disks"
2121
lsblk
2222
sudo blkid
23-
echo "Check that we have expected /mnt to be a separate mount"
24-
if ! lsblk | grep -q /mnt; then
25-
echo "!!!! /mnt is missing as a separate mount, runner misconfigured!"
26-
echo "Creating /mnt drive hoping that it will be enough space to use in /"
27-
sudo mkdir -p /mnt/
28-
fi
2923
echo "Checking free space!"
3024
df -H
3125
echo "Cleaning /mnt just in case it is not empty"
26+
sudo mkdir -p /mnt
3227
sudo rm -rf /mnt/*
3328
echo "Checking free space!"
3429
df -H

scripts/ci/move_docker_to_mnt.sh

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,37 @@
1717
# under the License.
1818
function cleanup_runner {
1919
set -x
20-
local target_docker_volume_location="/mnt/var-lib-docker"
21-
echo "Checking free space!"
22-
df -H
23-
# This is faster than docker prune
24-
echo "Stopping docker"
25-
sudo systemctl stop docker
26-
echo "Checking free space!"
27-
df -H
28-
echo "Cleaning docker"
29-
sudo rm -rf /var/lib/docker
30-
echo "Checking free space!"
31-
df -H
32-
echo "Mounting ${target_docker_volume_location} to /var/lib/docker"
33-
sudo mkdir -p "${target_docker_volume_location}" /var/lib/docker
34-
sudo mount --bind "${target_docker_volume_location}" /var/lib/docker
35-
sudo chown -R 0:0 "${target_docker_volume_location}"
36-
sudo systemctl start docker
3720
echo "Checking free space!"
3821
df -H
22+
# Note:
23+
# Disk layout on x86_64 (2026-01):
24+
# - root (/) on /dev/sdb1 (75G)
25+
# - an additional mount as /mnt with 75G on /dev/sda1
26+
# It seems that arm64 runners have
27+
# - root (/) on /dev/sda1 (75G)
28+
# - An un-used nvme with 220G
29+
# Hence we only move docker to /mnt on x86_64 where we have a separate /mnt mount
30+
# If we get short on disk space on arm64 as well we need to revisit this logic
31+
# and make the idle nvme being used as well.
32+
if uname -i|grep -q x86_64; then
33+
local target_docker_volume_location="/mnt/var-lib-docker"
34+
# This is faster than docker prune
35+
echo "Stopping docker"
36+
sudo systemctl stop docker
37+
echo "Checking free space!"
38+
df -H
39+
echo "Cleaning docker"
40+
sudo rm -rf /var/lib/docker
41+
echo "Checking free space!"
42+
df -H
43+
echo "Mounting ${target_docker_volume_location} to /var/lib/docker"
44+
sudo mkdir -p "${target_docker_volume_location}" /var/lib/docker
45+
sudo mount --bind "${target_docker_volume_location}" /var/lib/docker
46+
sudo chown -R 0:0 "${target_docker_volume_location}"
47+
sudo systemctl start docker
48+
echo "Checking free space!"
49+
df -H
50+
fi
3951
}
4052

4153
cleanup_runner

0 commit comments

Comments
 (0)