Reduce container startup imports and precompile Python

Keep preparation independent of settings and model imports while preserving
root-password persistence and credential masking. Compile checked-hash
bytecode during image builds and load MCP/A2A adapters on protocol requests.

Reuse the core ASGI builder for desktop routes to preserve socket lifecycle
and middleware. Add startup, access-check, and build regression coverage.

Validation: three matched Docker boots per version reduced median HTTP
readiness from 26.03s to 10.05s. 331 tests and 22 subtests passed, with one
skip and two confirmed baseline failures excluded. Browser, offline
embeddings, and bytecode invalidation checks passed.
This commit is contained in:
Jan Tomášek committed 2026-11-18 21:18:18 +01:00
1 parent d290b037aa
commit ab330a8ae8
21 files changed
+254 -69

No files matched your search

+6
View File
@@ -173,3 +173,9 @@ def test_shared_numpy_and_filelock_bounds_remain_declared():
requirements = _read(REQUIREMENTS)
assert "numpy>=1.26.4,<2" in requirements
assert "filelock>=3.20.3" in requirements
def test_build_precompiles_with_source_validated_hashes():
for script in ("install_A0.sh", "prepare_assets.sh"):
content = _read(PROJECT_ROOT / "docker/run/fs/ins" / script)
assert "/usr/local/bin/python -m compileall -q --invalidation-mode checked-hash" in content