File tree Expand file tree Collapse file tree 3 files changed +36
-27
lines changed
Expand file tree Collapse file tree 3 files changed +36
-27
lines changed Original file line number Diff line number Diff line change @@ -48,3 +48,39 @@ echo "✅ Installed: $(buildkitd --version)"
4848
4949# Cleanup
5050rm -rf " $TMPDIR "
51+
52+ echo " 🔍 Detecting largest non-system volume..."
53+
54+ # Use consistent, POSIX-compatible df output
55+ # Filter out ephemeral/system mounts
56+ mapfile -t lines < <(
57+ df -B1 --output=target,avail,fstype 2> /dev/null | \
58+ tail -n +2 | \
59+ awk ' $3 !~ /(tmpfs|devtmpfs|overlay|squashfs|efivarfs|proc|sysfs|cgroup|debugfs|rpc_pipefs|run)/ {print $0}' | \
60+ sort -k2 -n -r
61+ )
62+
63+ if [ ${# lines[@]} -eq 0 ]; then
64+ echo " ❌ No valid mounted volumes found."
65+ exit 1
66+ fi
67+
68+ read -r mount avail fstype <<< " ${lines[0]}"
69+
70+ avail_h=$( numfmt --to=iec <<< " $avail" 2> /dev/null || echo " $avail bytes" )
71+ echo " 📦 Largest volume: $mount (Free: $avail_h , Type: $fstype )"
72+
73+ # Export variable for use by parent script
74+ echo " BUILD_VOLUME=$mount "
75+
76+ # Identify Buildkit root
77+ if [ " $BUILD_VOLUME " = " /" ]; then
78+ BUILD_ROOT=" /buildkit"
79+ else
80+ BUILD_ROOT=" $BUILD_VOLUME /buildkit"
81+ fi
82+
83+ sudo mkdir -p " $BUILD_ROOT "
84+ sudo chown root:root " $BUILD_ROOT "
85+
86+ echo " 🧱 Using BuildKit root at: $BUILD_ROOT "
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3737 - uses : actions/checkout@v5
3838 - run : .github/scripts/runner_setup.sh
3939 - run : .github/scripts/buildkitd.sh
40- - run : .github/scripts/volume.sh
4140
4241 example-on-g6xl-runner-1 :
4342 needs : [example-on-build-runner]
You can’t perform that action at this time.
0 commit comments