diff --git a/Dockerfile b/Dockerfile index 66a4b43..f838d8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,7 +71,7 @@ RUN groupadd -g 568 apps && useradd -u 568 -g apps -m -s /bin/bash appuser \ WORKDIR /app USER appuser -ENV HF_HOME=/models/huggingface INSIGHTFACE_HOME=/models +ENV HF_HOME=/models/huggingface INSIGHTFACE_HOME=/models/.insightface HEALTHCHECK CMD test -f /app/entrypoint.sh || exit 1 ENTRYPOINT ["tini", "--", "/app/entrypoint.sh"] diff --git a/README.md b/README.md index b41e1fc..3e1f965 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ The first run after a fresh install downloads the embedding models (~1-2 GB). Su | Variable | Default | Description | | :--- | :--- | :--- | | `FORCE_CPU` | `false` | Disable GPU — fall back to CPU for embedding computation | -| `ENABLE_CACHE` | `false` | Cache computed embeddings to disk (speeds up re-runs on the same library) | +| `ENABLE_CACHE` | `true` | Cache computed embeddings to disk (speeds up re-runs on the same library) | | `CACHE_DIR` | `.if_cache` | Path for embedding cache and upload tracker files | | `HF_HOME` | *(system)* | HuggingFace model cache location (SigLIP) | | `INSIGHTFACE_HOME` | *(system)* | InsightFace model cache location (Buffalo_L) | diff --git a/compose.yml b/compose.yml index 36fa757..c7bfada 100644 --- a/compose.yml +++ b/compose.yml @@ -35,7 +35,7 @@ services: # ── Caching & Models ────────────────────────────────────────────────── - FORCE_CPU=false - - ENABLE_CACHE=true + # - ENABLE_CACHE=false # Disable embedding cache (default: true) - CACHE_DIR=/app/.if_cache - HF_HOME=/models/huggingface - INSIGHTFACE_HOME=/models/.insightface @@ -47,10 +47,9 @@ services: # ── Scheduling ──────────────────────────────────────────────────────── # Cron expression (unset = run once and exit) - # Every Sunday at 3 AM: - - CRON_SCHEDULE=0 3 * * 0 - # - CRON_SCHEDULE=0 3 1 * * - # - CRON_SCHEDULE=*/30 * * * * + # - CRON_SCHEDULE=0 3 * * 0 # Every Sunday at 3 AM + # - CRON_SCHEDULE=0 3 1 * * # First of every month + # - CRON_SCHEDULE=*/30 * * * * # Every 30 minutes volumes: # Replace with absolute paths on your host, e.g. /opt/winnow/models - /path/to/winnow/models:/models diff --git a/entrypoint.sh b/entrypoint.sh index 1237f13..464c9d0 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,7 @@ export PYTHONUNBUFFERED=1 # 1. Run the job immediately on startup echo "▶ Running on startup..." -/app/.venv/bin/python -m winnow.cli +/app/.venv/bin/winnow # 2. If a schedule exists, start the scheduler if [ -n "${CRON_SCHEDULE:-}" ]; then diff --git a/tests/test_config.py b/tests/test_config.py index 4e6b9c7..20c28bf 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -25,7 +25,7 @@ def test_config_loads_defaults(monkeypatch): assert cfg.FACE_MARGIN == 0.15 assert cfg.USE_FULL_RESOLUTION is True assert cfg.ENABLE_FACE_ALIGNMENT is True - assert cfg.ENABLE_CACHE is False + assert cfg.ENABLE_CACHE is True _Config.reset() diff --git a/winnow/config.py b/winnow/config.py index bc787ad..481f87f 100644 --- a/winnow/config.py +++ b/winnow/config.py @@ -39,8 +39,7 @@ class _Config: USE_FULL_RESOLUTION: bool = True ENABLE_FACE_ALIGNMENT: bool = True - # Caching (opt-in to avoid unexpected files) - ENABLE_CACHE: bool = False + ENABLE_CACHE: bool = True CACHE_DIR: str = ".if_cache" def __new__(cls) -> "_Config": @@ -64,7 +63,7 @@ class _Config: self.FACE_MARGIN = float(os.getenv("FACE_MARGIN", "0.15")) self.USE_FULL_RESOLUTION = os.getenv("USE_FULL_RESOLUTION", "true").lower() in ("true", "1", "yes") self.ENABLE_FACE_ALIGNMENT = os.getenv("ENABLE_FACE_ALIGNMENT", "true").lower() in ("true", "1", "yes") - self.ENABLE_CACHE = os.getenv("ENABLE_CACHE", "false").lower() in ("true", "1", "yes") + self.ENABLE_CACHE = os.getenv("ENABLE_CACHE", "true").lower() in ("true", "1", "yes") self.CACHE_DIR = os.getenv("CACHE_DIR", ".if_cache") # Fall back to config file for non-sensitive values (API_KEY not stored here)