Skip to content

Commit 2d5e442

Browse files
authored
ci: Address tight disk space on GHA runners (#4974)
- Mount the host's root under /host/root so it's visible in the containers. - Remove stuff we don't need to free lots of disk space. - While we're at it, arrange for the commands (copied from OSL) that allow the containers to see a CPU, when available. This is freeing 20+ GB! --------- Signed-off-by: Larry Gritz <[email protected]>
1 parent 203d669 commit 2d5e442

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/build-steps.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ jobs:
9595
container:
9696
image: ${{ inputs.container }}
9797
volumes: ${{ fromJson( inputs.container_volumes ) }}
98+
options: -v /:/host/root ${{ (contains(inputs.runner, 'gpu') && '-e NVIDIA_DRIVER_CAPABILITIES=compute,graphics,utility --gpus all') || '-e A=x' }}
99+
# Extra options:
100+
# - Ensure the GPU runners have OptiX is visible in the container.
101+
# - Mount the native filesystem under /host/root
98102
env:
99103
CXX: ${{inputs.cxx_compiler}}
100104
CC: ${{inputs.cc_compiler}}

src/build-scripts/gh-installdeps.bash

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@
77

88

99
set -ex
10-
df -h
10+
11+
# Make extra space on the runners
12+
df -h .
13+
time rm -rf /usr/local/lib/android /host/root/usr/local/lib/android &
14+
sleep 3
15+
# rather than block, delete in background, but give it a few secs to start
16+
# clearing things out before moving on.
17+
# Other candidates, if we need it: /usr/share/dotnet /usr/local/.ghcup
1118

1219

1320
#
@@ -219,7 +226,8 @@ if [[ "$USE_ICC" != "" ]] ; then
219226
export CC=icc
220227
fi
221228

222-
df -h
229+
df -h .
230+
df -h /host/root || true
223231

224232
# Save the env for use by other stages
225233
src/build-scripts/save-env.bash

0 commit comments

Comments
 (0)