Repository navigation
cleanup: reclaim what a busy fleet grows (app-named sims, idle AVDs, stale updates) - #114
Merged
Merged
Conversation
…stale updates) ultra kept dropping under its 100 GB admission floor while cleanup.sh found almost nothing. Since the 10-17 reclaim, files created under ~/Library/Developer (simulators) and ~/.android/avd were 43 of the ~100 GB that are new, and the script could take none of it: - CI simulators: Jerv's ci/sim.py names its devices "ci-<runner> jerv <platform> <version>", which the kit-shaped regex never matched; nine of them held 19 GB and had never been erased. The match now allows one app word before the platform. - Android AVDs: one per runner (ci-<runner>, Jerv's shots-<runner>), 17 of them, 20 GB, removed by nothing. android-emulator-runner recreates the AVD at the start of every job (force-avd-creation defaults to true), so an idle runner's AVD is pure waste. Removed while its runner is idle, no emulator holds it, and it was not written in the last 30 minutes. - _work/_update: a runner self-update's staging copy (0.45 GB) left behind on nine runners. Removed when older than six hours, idle, unused. All three are per-runner steps, so they run while other runners build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why ultra keeps falling under its 100 GB floor
Measured on ultra on 2026-10-22, read-only:
Trend (hmap
disk_usable_gb): 225 GB usable right after the 10-17 reclaim, down to about 112 GB on 10-22. That is roughly 20 GB a day net. On top of it, free space moves 15–25 GB within an hour while jobs run (cleanup log: 59–84 GB plain and 97–128 GB usable across 10-22 evening ticks).What's new since 10-17 (files created since 10-17 16:00 that still exist, by allocated size): about 100 GB in total.
~/Library/Developer(simulators): 22.4 GB~/.android/avd: 20.5 GBoffsite-outbox: 10.0 GB~/.gradle/caches: 6.1 GB/private/var/folders: 5.3 GB_work: about 5 GBSo CI devices (simulators and AVDs) are the largest thing growing, and cleanup.sh reclaimed almost none of them.
The host-wide "skip while any job runs" steps are not the gap: DerivedData is 3.5 GB and no unavailable simulators were listed. The gap is in the per-runner steps, which do run on a busy fleet but missed these devices.
What this changes (all per-runner, so they run while other runners build)
CI simulators with an app word. Jerv's
ci/sim.pynames its devicesci-<runner> jerv iOS 27.0. The kit-shaped regex never matched that name, so 9 devices holding 19 GB had never been erased (one belonged toultra-jerv-6, a runner that no longer exists). The match now allows one word before the platform.Idle runners' Android AVDs (
ci-<runner>, plus Jerv'sshots-<runner>). Nothing removed them: 17 AVDs, 20 GB.android-emulator-runnerrecreates the AVD at the start of every job (force-avd-creationdefaults totrue), so an AVD sitting between jobs is pure waste. An AVD is removed only when all of these hold:hardware-qemu.ini.lockpid and no-avd <name>process);Night QA's
fleet-explore-*and any other AVD are never touched.Leftover
_work/_update. A runner self-update leaves its 0.45 GB staging copy behind; 9 runners still had one. It is removed when it is older than 6 h, the runner is idle, and no process is running from it.Dry run on ultra just now (not under pressure, busy runners skipped): 11 AVDs (~12 GB),
ci-ultra-jerv-6(2 GB) and one_update(0.4 GB). Under pressure, the 1 GB simulator limit also takes the Jerv devices (2–2.7 GB each).Tests
scripts/test-cleanup.sh: two new cases (app-named sims; AVDs and_updatewith busy, open, fresh and foreign cases). 63 passed.shellcheck --severity=warningclean.Not in this PR
FLEET_ADMIT_MIN_FREE_DISK_GB=100is ultra's untracked fleet.env value. It matches the Homelab Map's host floor, which exists for Dozehound's video nights (about 50 GB of renders a week). Lowering it is the owner's call.bin/externals(~0.45 GB each). Per-runner_toolcaches: 18.8 GB. Both could be shared or cloned. That is a separate change.🤖 Generated with Claude Code