feat(ops): expose MinerU runtime readiness separately from liveness - #503
feat(ops): expose MinerU runtime readiness separately from liveness#503seonghobae wants to merge 9 commits into
Conversation
pip-audit against the runtime lock (uv export --no-dev) flagged real advisories in the exact PDF/image parsing path this service depends on. Re-locked with targeted upgrades (all within the existing pyproject.toml version ranges): - pillow 12.2.0 -> 12.3.0 (PYSEC-2026-3451/3452/3453/3454/3493/3494/3495/3496: eight image-decoder advisories). - pypdf 6.13.3 -> 6.14.2 (CVE-2026-59935/59936/59937/59938: PDF parsing). - click 8.3.2 -> 8.4.2 (PYSEC-2026-2132). - setuptools 81.0.0 -> 83.0.0 (CVE-2026-59890, build tool). Verification: `uv export --frozen --no-emit-project --no-dev | pip-audit` -> No known vulnerabilities found. Lock diff is confined to these four packages and their hashes. Residual (documented, not fixable in place): pymdown-extensions 10.21.3 CVE-2026-61632 requires a major bump to 11.0.0, but mkdocs-material 9.6.x caps pymdown-extensions to <11. It is a docs-build-only dependency (mkdocs), not on the runtime/API surface, so it does not affect the shipped image or the `/parse` path; clearing it needs a coordinated docs-toolchain upgrade. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Msz8Dni5zRaqPatNCmZJZ8
…fting mkdocs-material to 9.7.x The org Security Scan `trivy-fs` job fails on this repo (base branch and every open PR) with: [MEDIUM (security-severity=5.3)] CVE-2026-61632 uv.lock - pymdown-extensions pymdown-extensions 10.21.3 is vulnerable; the fix is 11.0.0+. It could not be upgraded because mkdocs-material 9.6.x pins `pymdown-extensions~=10.2` (i.e. <11). The docs toolchain deliberately held `mkdocs-material<9.7` to avoid the 9.7 "MkDocs 2.0" warning banner (encoded in pyproject, two tests, and CONTRIBUTING.md). That caution-hold now blocks a real security fix and fails required CI, so it is lifted to the minimum extent needed: bump only the theme to `mkdocs-material>=9.7,<9.8` (which relaxes its pymdown-extensions cap to `>=10.2`). The MkDocs *core* stays on the 1.x line (`mkdocs>=1.6,<2.0` unchanged) — the 9.7 theme still builds on MkDocs 1.x. Resulting lock: pymdown-extensions 10.21.3 -> 11.0.1, mkdocs-material 9.6.23 -> 9.7.7 (plus the runtime pillow/pypdf/click and setuptools bumps from the previous commit). Governance re-documented coherently: - CONTRIBUTING.md: explains the theme now tracks 9.7.x for the CVE fix while the MkDocs core stays 1.x; the 9.7 banner is informational and non-fatal under --strict. - tests/test_project_metadata.py: assertions updated to the new pin and the CONTRIBUTING rationale (CVE-2026-61632). Verification: - `uv run --frozen --extra docs mkdocs build --strict` -> builds cleanly (informational MkDocs 2.0 banner only, exit 0). - `uv export --frozen --no-emit-project --all-extras | pip-audit --no-deps` -> No known vulnerabilities found (runtime and full sets). - `PYTHONWARNINGS=error uv run --frozen --all-extras pytest` -> 430 passed. - No src/ change, so the 100% branch-coverage gate is unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Msz8Dni5zRaqPatNCmZJZ8
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
Parking this reviewed product slice until security baseline PR #467 is merged. The branch is preserved. Reopen after |
Summary
Add an unauthenticated
GET /readyendpoint that returns200only when the MinerU executable required by/parseis discoverable, while preservingGET /healthas a process-liveness endpoint.Buyer-visible gap
The API-only container can currently report a green
/healtheven when MinerU is absent and every real parse request returns503. Deployment platforms therefore cannot distinguish a live process from a traffic-ready parser instance. This change supplies that missing operational contract.Changes
NEWSDOM_MINERU_BINon every probe, falling back tomineruonPATH.503 Service Unavailablewhen MinerU is unavailable./healthand/readyunauthenticated even when bearer protection is enabled for/parse.CHANGELOG.md.Verification
Standards basis
The contract follows Kubernetes probe semantics: liveness controls restart decisions, while readiness controls whether an instance receives service traffic. The endpoint is intentionally low-cost and returns a minimal response.
Residual risk
This is a shallow readiness check: it proves that an executable can be resolved, not that a particular PDF, model download, GPU backend, or external cache will succeed. Deep parser execution belongs in startup validation, diagnostics, or synthetic monitoring rather than a frequently invoked readiness probe.
Stacked dependency
This draft is intentionally stacked on security PR #467. Until #467 is merged, the comparison against
developalso contains its dependency-remediation commits. After #467 lands, the diff contracts to the readiness change alone and this PR must be revalidated on the resulting current head before it is marked ready.Git Flow target
feat/*→develop.