Skip to content

Commit 39e29c1

Browse files
committed
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 <lg@larrygritz.com>
1 parent 3f888e3 commit 39e29c1

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

.github/workflows/build-steps.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
type: string
1919
container:
2020
type: string
21+
container_volumes:
22+
type: string
23+
default: '[]'
2124
cc_compiler:
2225
type: string
2326
cxx_compiler:
@@ -84,7 +87,11 @@ jobs:
8487
runs-on: ${{ inputs.runner }}
8588
container:
8689
image: ${{ inputs.container }}
87-
90+
volumes: ${{ fromJson( inputs.container_volumes ) }}
91+
options: -v /:/host/root ${{ (contains(inputs.runner, 'gpu') && '-e NVIDIA_DRIVER_CAPABILITIES=compute,graphics,utility --gpus all') || '-e A=x' }}
92+
# Extra options:
93+
# - Ensure the GPU runners have OptiX is visible in the container.
94+
# - Mount the native filesystem under /host/root
8895
env:
8996
CXX: ${{inputs.cxx_compiler}}
9097
CC: ${{inputs.cc_compiler}}

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ jobs:
252252
nametag: ${{ matrix.nametag || 'unnamed!' }}
253253
runner: ${{ matrix.runner || 'ubuntu-latest' }}
254254
container: ${{ matrix.container }}
255+
container_volumes: ${{ matrix.container_volumes || '[]' }}
255256
cc_compiler: ${{ matrix.cc_compiler }}
256257
cxx_compiler: ${{ matrix.cxx_compiler }}
257258
cxx_std: ${{ matrix.cxx_std || '17' }}

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
#
@@ -231,7 +238,8 @@ if [[ "$USE_ICC" != "" ]] ; then
231238
export CC=icc
232239
fi
233240

234-
df -h
241+
df -h .
242+
df -h /host/root || true
235243

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

0 commit comments

Comments
 (0)