fix(ocr): route Surya model staging to SSD via TMPDIR + add volume-init service #615

Merged
marcel merged 10 commits from feat/issue-614-tmpdir-persistent-volume into main 2026-05-18 11:32:37 +02:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 6839cf2a33 - Show all commits

View File

@@ -3,8 +3,7 @@ set -euo pipefail
# Ensure TMPDIR exists on the persistent cache volume (created by the volume-init
# container, but guaranteed here for fresh volumes and bare docker-run usage).
# Orphaned fragments from prior docker-kill during model downloads are cleared
# on startup to prevent cross-job ground-truth leakage (Surya staging files).
# Remove stale partial downloads left by a previous docker-kill.
mkdir -p "${TMPDIR:-/tmp}"
find "${TMPDIR:-/tmp}" -mindepth 1 -mtime +1 -delete 2>/dev/null || true

View File

@@ -90,6 +90,7 @@ def test_tmpdir_is_inside_persistent_cache_volume():
Catches accidental reversion to /tmp or any tmpfs-backed path.
Runs only inside the OCR Docker container where TMPDIR=/app/cache/.tmp.
To run manually: docker exec archiv-ocr python -m pytest test_tmpdir.py::test_tmpdir_is_inside_persistent_cache_volume -v
See ADR-021.
"""
tmpdir = os.environ["TMPDIR"]