Compare commits

..

7 Commits

Author SHA1 Message Date
5ead4543ee tester(ET): auto-commit from tester run_id=494
All checks were successful
CI / test (push) Successful in 33s
CI / test (pull_request) Successful in 29s
2026-06-09 19:55:00 +03:00
247915e3d1 reviewer(ET): auto-commit from reviewer run_id=493 2026-06-09 19:55:00 +03:00
664c2e945a feat(infra): auto-prune docker build cache on mva154 (ORCH-062)
Add src/build_cache_pruner.py — a background daemon thread modelled 1:1 on
src/disk_watchdog.py that periodically runs STRICTLY `docker builder prune -f
--filter until=<until>` (BuildKit GC) on the HOST over ssh. It is the "second
half" of the disk-watchdog (ORCH-063): the watchdog signals, the pruner cleans.
Removes the root cause of the 07.06.2026 incident (build cache ~11GB -> disk
100% -> whole self-hosting pipeline down) automatically, без оператора.

ADR-001 (Variant A): host-over-ssh, same channel as image_freshness/self_deploy
(no docker CLI in the image). Touches ONLY the build cache — no image/system
prune, no image/container removal, never restarts the docker daemon or the prod
container (self-hosting safety). No ssh target -> tick is a no-op.

- src/config.py: ORCH_BUILD_CACHE_PRUNE_* flags + defensive validators
  (interval/timeout >0, until ~ ^\d+[smhdw]?$, notify_min_gb >=0 -> safe default).
- src/main.py: start last (after disk_watchdog) / stop first in lifespan;
  additive read-only build_cache_prune block in GET /queue.
- never-raise on two levels (per-command + per-tick); kill-switch
  ORCH_BUILD_CACHE_PRUNE_ENABLED (false -> daemon does not start, 1:1 as before).
- STAGE_TRANSITIONS / QG_CHECKS / check_* / _parse_* / DB schema UNCHANGED;
  last-run/last-result is in-memory (no migration).
- tests/test_build_cache_pruner.py: TC-01..TC-12 (23 cases, docker fully mocked).
- .env.example + CHANGELOG.md updated; INFRA.md / architecture docs already
  carry the component (architecture stage).

Refs: ORCH-062

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 19:55:00 +03:00
d2604e42cd architect(ET): auto-commit from architect run_id=491 2026-06-09 19:55:00 +03:00
621c1352e1 analyst(ET): auto-commit from analyst run_id=490 2026-06-09 19:55:00 +03:00
e86ea82501 docs: init ORCH-062 business request 2026-06-09 19:55:00 +03:00
1b03f6b3a7 docs(ORCH-062): staging gate log — SUCCESS (8/10, C9a/C9b infra-waived) 2026-06-09 19:54:36 +03:00

Diff Content Not Available