Skip to content

Commit eb29cf5

Browse files
committed
ci: give hosted sanitizer builds dedicated disk space
Place instrumented build trees, temporary files and compiler caches on the mounted data disk. Free unused preinstalled toolchains and Docker images before verification, and record disk space before and after preparation. Keep the test selection, sanitizer flags and parallelism unchanged.
1 parent 929c213 commit eb29cf5

2 files changed

Lines changed: 280 additions & 1 deletion

File tree

‎.github/workflows/ci-post.yml‎

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ jobs:
570570
env:
571571
ASAN_OPTIONS: detect_leaks=1:halt_on_error=1:abort_on_error=1
572572
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
573+
CCACHE_DIR: /mnt/pineforge-sanitizers/${{ github.run_id }}-${{ matrix.shard }}/.ccache
573574
steps:
574575
- name: Refuse an unauthorised run before anything else
575576
if: ${{ needs.authz.result != 'success' }}
@@ -582,6 +583,143 @@ jobs:
582583
persist-credentials: false
583584
fetch-depth: 0
584585

586+
- name: Measure sanitizer disk space before preparation
587+
if: ${{ needs.authz.result == 'success' }}
588+
run: df -h / /mnt
589+
590+
- name: Prepare sanitizer build storage
591+
if: ${{ needs.authz.result == 'success' }}
592+
shell: bash
593+
run: |
594+
set -euo pipefail
595+
sudo install -d -m 0775 -o "$USER" -g "$(id -gn)" \
596+
"/mnt/pineforge-sanitizers/${{ github.run_id }}-${{ matrix.shard }}/build-asan" \
597+
"/mnt/pineforge-sanitizers/${{ github.run_id }}-${{ matrix.shard }}/tmp" \
598+
"/mnt/pineforge-sanitizers/${{ github.run_id }}-${{ matrix.shard }}/.ccache"
599+
[[ ! -e build-asan && ! -L build-asan ]]
600+
ln -s -- \
601+
"/mnt/pineforge-sanitizers/${{ github.run_id }}-${{ matrix.shard }}/build-asan" \
602+
build-asan
603+
resolved_build="$(readlink -f -- build-asan)"
604+
printf 'sanitizer build tree: %s\n' "$resolved_build"
605+
[[ "$resolved_build" == "/mnt/pineforge-sanitizers/${{ github.run_id }}-${{ matrix.shard }}/build-asan" ]]
606+
stat -c '%A %U:%G %n' -- "$resolved_build" "/mnt/pineforge-sanitizers/${{ github.run_id }}-${{ matrix.shard }}/tmp" "$CCACHE_DIR"
607+
608+
- name: Inventory disposable .NET installation
609+
if: ${{ needs.authz.result == 'success' }}
610+
shell: bash
611+
run: |
612+
set -euo pipefail
613+
if [[ -d /usr/share/dotnet && ! -L /usr/share/dotnet ]]; then
614+
sudo ls -ld -- /usr/share/dotnet
615+
sudo du -sh -- /usr/share/dotnet
616+
elif [[ -e /usr/share/dotnet || -L /usr/share/dotnet ]]; then
617+
sudo ls -ld -- /usr/share/dotnet
618+
echo "::warning::optional preinstall is not a real directory; no removal performed: /usr/share/dotnet"
619+
else
620+
echo "optional preinstall absent: /usr/share/dotnet"
621+
fi
622+
623+
- name: Remove disposable .NET installation
624+
if: ${{ needs.authz.result == 'success' }}
625+
shell: bash
626+
run: |
627+
set -euo pipefail
628+
if [[ -d /usr/share/dotnet && ! -L /usr/share/dotnet ]]; then
629+
sudo rm -rf -- /usr/share/dotnet
630+
else
631+
echo "no directory removal for absent or symlinked optional preinstall: /usr/share/dotnet"
632+
fi
633+
634+
- name: Inventory disposable Android SDK
635+
if: ${{ needs.authz.result == 'success' }}
636+
shell: bash
637+
run: |
638+
set -euo pipefail
639+
if [[ -d /usr/local/lib/android && ! -L /usr/local/lib/android ]]; then
640+
sudo ls -ld -- /usr/local/lib/android
641+
sudo du -sh -- /usr/local/lib/android
642+
elif [[ -e /usr/local/lib/android || -L /usr/local/lib/android ]]; then
643+
sudo ls -ld -- /usr/local/lib/android
644+
echo "::warning::optional preinstall is not a real directory; no removal performed: /usr/local/lib/android"
645+
else
646+
echo "optional preinstall absent: /usr/local/lib/android"
647+
fi
648+
649+
- name: Remove disposable Android SDK
650+
if: ${{ needs.authz.result == 'success' }}
651+
shell: bash
652+
run: |
653+
set -euo pipefail
654+
if [[ -d /usr/local/lib/android && ! -L /usr/local/lib/android ]]; then
655+
sudo rm -rf -- /usr/local/lib/android
656+
else
657+
echo "no directory removal for absent or symlinked optional preinstall: /usr/local/lib/android"
658+
fi
659+
660+
- name: Inventory disposable GHC installation
661+
if: ${{ needs.authz.result == 'success' }}
662+
shell: bash
663+
run: |
664+
set -euo pipefail
665+
if [[ -d /opt/ghc && ! -L /opt/ghc ]]; then
666+
sudo ls -ld -- /opt/ghc
667+
sudo du -sh -- /opt/ghc
668+
elif [[ -e /opt/ghc || -L /opt/ghc ]]; then
669+
sudo ls -ld -- /opt/ghc
670+
echo "::warning::optional preinstall is not a real directory; no removal performed: /opt/ghc"
671+
else
672+
echo "optional preinstall absent: /opt/ghc"
673+
fi
674+
675+
- name: Remove disposable GHC installation
676+
if: ${{ needs.authz.result == 'success' }}
677+
shell: bash
678+
run: |
679+
set -euo pipefail
680+
if [[ -d /opt/ghc && ! -L /opt/ghc ]]; then
681+
sudo rm -rf -- /opt/ghc
682+
else
683+
echo "no directory removal for absent or symlinked optional preinstall: /opt/ghc"
684+
fi
685+
686+
- name: Inventory disposable Boost installation
687+
if: ${{ needs.authz.result == 'success' }}
688+
shell: bash
689+
run: |
690+
set -euo pipefail
691+
if [[ -d /usr/local/share/boost && ! -L /usr/local/share/boost ]]; then
692+
sudo ls -ld -- /usr/local/share/boost
693+
sudo du -sh -- /usr/local/share/boost
694+
elif [[ -e /usr/local/share/boost || -L /usr/local/share/boost ]]; then
695+
sudo ls -ld -- /usr/local/share/boost
696+
echo "::warning::optional preinstall is not a real directory; no removal performed: /usr/local/share/boost"
697+
else
698+
echo "optional preinstall absent: /usr/local/share/boost"
699+
fi
700+
701+
- name: Remove disposable Boost installation
702+
if: ${{ needs.authz.result == 'success' }}
703+
shell: bash
704+
run: |
705+
set -euo pipefail
706+
if [[ -d /usr/local/share/boost && ! -L /usr/local/share/boost ]]; then
707+
sudo rm -rf -- /usr/local/share/boost
708+
else
709+
echo "no directory removal for absent or symlinked optional preinstall: /usr/local/share/boost"
710+
fi
711+
712+
- name: Prune unused Docker images
713+
if: ${{ needs.authz.result == 'success' }}
714+
shell: bash
715+
run: |
716+
set -euo pipefail
717+
docker image prune -af
718+
719+
- name: Measure sanitizer disk space after preparation
720+
if: ${{ always() && needs.authz.result == 'success' }}
721+
run: df -h / /mnt
722+
585723
- name: Set up Python
586724
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
587725
with:
@@ -604,6 +742,8 @@ jobs:
604742
605743
- name: Verify (sanitizers)
606744
if: ${{ needs.authz.result == 'success' }}
745+
env:
746+
TMPDIR: /mnt/pineforge-sanitizers/${{ github.run_id }}-${{ matrix.shard }}/tmp
607747
run: python3 scripts/ci_verify.py sanitizers --build-dir build-asan --jobs "$(getconf _NPROCESSORS_ONLN)" --ccache --ctest-shard ${{ matrix.shard }}/8
608748

609749
- name: Stage and summarize diagnostics

‎.github/workflows/native-live.yml‎

Lines changed: 140 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,150 @@ jobs:
114114
build_dir: build-live-tsan
115115
runner: ubuntu-24.04
116116
env:
117-
CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ matrix.profile }}
117+
CCACHE_DIR: /mnt/pineforge-native-sanitizers/${{ github.run_id }}-${{ matrix.profile }}/.ccache
118118
steps:
119119
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
120120
with:
121121
persist-credentials: false
122122
fetch-depth: 0
123123

124+
- name: Measure sanitizer disk space before preparation
125+
if: ${{ needs.authz.result == 'success' }}
126+
run: df -h / /mnt
127+
128+
- name: Prepare sanitizer build storage
129+
if: ${{ needs.authz.result == 'success' }}
130+
shell: bash
131+
run: |
132+
set -euo pipefail
133+
sudo install -d -m 0775 -o "$USER" -g "$(id -gn)" \
134+
"/mnt/pineforge-native-sanitizers/${{ github.run_id }}-${{ matrix.profile }}/${{ matrix.build_dir }}" \
135+
"/mnt/pineforge-native-sanitizers/${{ github.run_id }}-${{ matrix.profile }}/tmp" \
136+
"/mnt/pineforge-native-sanitizers/${{ github.run_id }}-${{ matrix.profile }}/.ccache"
137+
[[ ! -e ${{ matrix.build_dir }} && ! -L ${{ matrix.build_dir }} ]]
138+
ln -s -- \
139+
"/mnt/pineforge-native-sanitizers/${{ github.run_id }}-${{ matrix.profile }}/${{ matrix.build_dir }}" \
140+
${{ matrix.build_dir }}
141+
resolved_build="$(readlink -f -- ${{ matrix.build_dir }})"
142+
printf 'sanitizer build tree: %s\n' "$resolved_build"
143+
[[ "$resolved_build" == "/mnt/pineforge-native-sanitizers/${{ github.run_id }}-${{ matrix.profile }}/${{ matrix.build_dir }}" ]]
144+
stat -c '%A %U:%G %n' -- "$resolved_build" "/mnt/pineforge-native-sanitizers/${{ github.run_id }}-${{ matrix.profile }}/tmp" "$CCACHE_DIR"
145+
146+
- name: Inventory disposable .NET installation
147+
if: ${{ needs.authz.result == 'success' }}
148+
shell: bash
149+
run: |
150+
set -euo pipefail
151+
if [[ -d /usr/share/dotnet && ! -L /usr/share/dotnet ]]; then
152+
sudo ls -ld -- /usr/share/dotnet
153+
sudo du -sh -- /usr/share/dotnet
154+
elif [[ -e /usr/share/dotnet || -L /usr/share/dotnet ]]; then
155+
sudo ls -ld -- /usr/share/dotnet
156+
echo "::warning::optional preinstall is not a real directory; no removal performed: /usr/share/dotnet"
157+
else
158+
echo "optional preinstall absent: /usr/share/dotnet"
159+
fi
160+
161+
- name: Remove disposable .NET installation
162+
if: ${{ needs.authz.result == 'success' }}
163+
shell: bash
164+
run: |
165+
set -euo pipefail
166+
if [[ -d /usr/share/dotnet && ! -L /usr/share/dotnet ]]; then
167+
sudo rm -rf -- /usr/share/dotnet
168+
else
169+
echo "no directory removal for absent or symlinked optional preinstall: /usr/share/dotnet"
170+
fi
171+
172+
- name: Inventory disposable Android SDK
173+
if: ${{ needs.authz.result == 'success' }}
174+
shell: bash
175+
run: |
176+
set -euo pipefail
177+
if [[ -d /usr/local/lib/android && ! -L /usr/local/lib/android ]]; then
178+
sudo ls -ld -- /usr/local/lib/android
179+
sudo du -sh -- /usr/local/lib/android
180+
elif [[ -e /usr/local/lib/android || -L /usr/local/lib/android ]]; then
181+
sudo ls -ld -- /usr/local/lib/android
182+
echo "::warning::optional preinstall is not a real directory; no removal performed: /usr/local/lib/android"
183+
else
184+
echo "optional preinstall absent: /usr/local/lib/android"
185+
fi
186+
187+
- name: Remove disposable Android SDK
188+
if: ${{ needs.authz.result == 'success' }}
189+
shell: bash
190+
run: |
191+
set -euo pipefail
192+
if [[ -d /usr/local/lib/android && ! -L /usr/local/lib/android ]]; then
193+
sudo rm -rf -- /usr/local/lib/android
194+
else
195+
echo "no directory removal for absent or symlinked optional preinstall: /usr/local/lib/android"
196+
fi
197+
198+
- name: Inventory disposable GHC installation
199+
if: ${{ needs.authz.result == 'success' }}
200+
shell: bash
201+
run: |
202+
set -euo pipefail
203+
if [[ -d /opt/ghc && ! -L /opt/ghc ]]; then
204+
sudo ls -ld -- /opt/ghc
205+
sudo du -sh -- /opt/ghc
206+
elif [[ -e /opt/ghc || -L /opt/ghc ]]; then
207+
sudo ls -ld -- /opt/ghc
208+
echo "::warning::optional preinstall is not a real directory; no removal performed: /opt/ghc"
209+
else
210+
echo "optional preinstall absent: /opt/ghc"
211+
fi
212+
213+
- name: Remove disposable GHC installation
214+
if: ${{ needs.authz.result == 'success' }}
215+
shell: bash
216+
run: |
217+
set -euo pipefail
218+
if [[ -d /opt/ghc && ! -L /opt/ghc ]]; then
219+
sudo rm -rf -- /opt/ghc
220+
else
221+
echo "no directory removal for absent or symlinked optional preinstall: /opt/ghc"
222+
fi
223+
224+
- name: Inventory disposable Boost installation
225+
if: ${{ needs.authz.result == 'success' }}
226+
shell: bash
227+
run: |
228+
set -euo pipefail
229+
if [[ -d /usr/local/share/boost && ! -L /usr/local/share/boost ]]; then
230+
sudo ls -ld -- /usr/local/share/boost
231+
sudo du -sh -- /usr/local/share/boost
232+
elif [[ -e /usr/local/share/boost || -L /usr/local/share/boost ]]; then
233+
sudo ls -ld -- /usr/local/share/boost
234+
echo "::warning::optional preinstall is not a real directory; no removal performed: /usr/local/share/boost"
235+
else
236+
echo "optional preinstall absent: /usr/local/share/boost"
237+
fi
238+
239+
- name: Remove disposable Boost installation
240+
if: ${{ needs.authz.result == 'success' }}
241+
shell: bash
242+
run: |
243+
set -euo pipefail
244+
if [[ -d /usr/local/share/boost && ! -L /usr/local/share/boost ]]; then
245+
sudo rm -rf -- /usr/local/share/boost
246+
else
247+
echo "no directory removal for absent or symlinked optional preinstall: /usr/local/share/boost"
248+
fi
249+
250+
- name: Prune unused Docker images
251+
if: ${{ needs.authz.result == 'success' }}
252+
shell: bash
253+
run: |
254+
set -euo pipefail
255+
docker image prune -af
256+
257+
- name: Measure sanitizer disk space after preparation
258+
if: ${{ always() && needs.authz.result == 'success' }}
259+
run: df -h / /mnt
260+
124261
- name: Set up Python
125262
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
126263
with:
@@ -151,6 +288,8 @@ jobs:
151288
152289
- name: Verify (${{ matrix.profile }})
153290
id: verify
291+
env:
292+
TMPDIR: /mnt/pineforge-native-sanitizers/${{ github.run_id }}-${{ matrix.profile }}/tmp
154293
run: python3 scripts/ci_verify.py ${{ matrix.profile }} --build-dir ${{ matrix.build_dir }} --jobs "$(getconf _NPROCESSORS_ONLN)" --generator Ninja --curl-dir "${{ steps.curl-deps.outputs.curl-dir }}" --ccache
155294

156295
- name: Stage and summarize diagnostics

0 commit comments

Comments
 (0)