pub struct Disk {
pub min_free_bytes: u64,
pub auto_fold: bool,
pub fold_grace_secs: u64,
pub cache_limit_bytes: u64,
}Expand description
Disk hygiene: how hard magi is allowed to press on the machine’s free space.
The numbers below come from one incident, not from theory: a machine with
951.8 GB free ran a few competitions and plans and best read 6.7 GB free.
Three multi-gigabyte classes of junk accumulated side by side - per-run
worktrees that end as Merged/Ready/Failed, a shared build cache whose
each verify round and each implementation wave recompiles the derived
section of the project into, and the outputs of runs that were removed but
whose folders nobody deleted.
Fields§
§min_free_bytes: u64Free space, in bytes, below which no new run may start: the daemon and
the magi run gate answer with “the disk is full” instead of letting
the graph fill it the rest of the way. 0 turns the gate off.
Default 8 GiB. The incident ran down to 6.7 GB free of 951.8 GB total before anybody noticed; 8 GiB is enough headroom for the compile a fresh competition triggers and small enough that a 1 TB disk with 100 GB free is nowhere near the threshold.
auto_fold: boolFold finished runs without being asked. Merged, Ready and Failed
runs older than fold_grace_secs have their
worktrees removed. 0 turns the janitor off.
Default true.
fold_grace_secs: u64How old a finished run must be before the janitor folds it, seconds.
Default 6 hours. A run that Ready at 8am is the operator’s answer; a
run that Ready a week ago is worktrees holding a compile each. Six
hours is long enough that nobody loses an answer in the gap between
reading the report and starting from it, and short enough that a backlog
cannot pile up across two nights.
cache_limit_bytes: u64Ceiling for the shared build cache (CARGO_TARGET_DIR in the rendered
verify commands), in bytes. When the janitor runs and the cache is over
it, files are dropped oldest-first until it is not. 0 turns pruning
off - the cache then only ever grows, which is the operator’s call.
Default 10 GiB. This is what the incident measured: 30.61 GB sat in the shared cache on top of ~16 GB in the primary target directory and 6.7- 11.15 GB in each of four per-worktree targets. 10 GiB holds a healthy stack of prebuilt dependencies (cargo’s per-file fingerprinting means pruning only costs the rebuild of the dropped files, not of the world) without letting one addled cache swallow the machine.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Disk
impl<'de> Deserialize<'de> for Disk
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Disk
Auto Trait Implementations§
impl Freeze for Disk
impl RefUnwindSafe for Disk
impl Send for Disk
impl Sync for Disk
impl Unpin for Disk
impl UnsafeUnpin for Disk
impl UnwindSafe for Disk
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more