fix(worker): pin the runtime versions and refuse to boot when install_runtime swaps an imported package (SIENTIAPDE-2214)

Replaces the re-exec. requirements.txt now pins the union of the basic and xgboost
runtime libraries, so install_runtime has nothing to change in the packages the worker
already imported. If a runtime pin changes and requirements.txt is not updated, the
worker logs which packages changed and exits before starting the workers.

test_main_entrypoint assigned worker.main = AsyncMock() without restoring it, so every
later test of main() ran the mock; it now uses patch.object.
This commit is contained in:
PedroHMCosme
2026-10-22 11:34:04 -03:00
parent 993c7d7662
commit 0f5e4a5cef
5 changed files with 127 additions and 193 deletions

View File

@@ -9,3 +9,14 @@ prometheus-client==0.23.1
beautifulsoup4==4.12.3
evidently==0.6.7
jsonschema==4.26.0
# Same versions as the plugin runtimes (model-plugin-factory runtime/basic.yaml and xgboost.yaml).
# The worker imports these before install_runtime; if the runtime installed a different version,
# the old code would stay in memory, so the worker refuses to boot (SIENTIAPDE-2214).
# Changing a runtime pin means changing it here too.
mlflow==3.8.1
pathspec==1.0.4
pandas==2.3.3
cloudpickle==3.1.2
scikit-learn==1.8.0
joblib==1.5.3
rich==14.3.2