Skip to content

Commit 1e46354

Browse files
committed
ci: Address tight disk space on GHA runners
- 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. Signed-off-by: Larry Gritz <[email protected]>
1 parent 203d669 commit 1e46354

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-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: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77

88

99
set -ex
10-
df -h
10+
11+
# Make extra space on the runners
12+
if [[ -e /host/root ]] ; then
13+
df -h .
14+
: ${CRUFT_TO_REMOVE:="/host/root/usr/share/dotnet /host/root/usr/local/lib/android /host/root/usr/local/.ghcup"}
15+
time rm -rf $CRUFT_TO_REMOVE &
16+
sleep 3
17+
# rather than block, delete in background, but give it a few secs to start
18+
# clearing things out before moving on.
19+
fi
1120

1221

1322
#
@@ -219,7 +228,7 @@ if [[ "$USE_ICC" != "" ]] ; then
219228
export CC=icc
220229
fi
221230

222-
df -h
231+
df -h .
223232

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

0 commit comments

Comments
 (0)