test(deploy): assert Dockerfile seeds EEG fixture, runs all pipelines, drops MLflow kill-switch (RED)
Browse files
tests/deploy/test_dockerfile_hf.py
CHANGED
|
@@ -30,8 +30,10 @@ class TestDockerfileHF:
|
|
| 30 |
"""The HF Dockerfile must:
|
| 31 |
- Start FROM a Python base
|
| 32 |
- Install requirements.txt
|
|
|
|
| 33 |
- Build the BBB model artifact at build time
|
| 34 |
-
-
|
|
|
|
| 35 |
- Expose port 7860 (HF Spaces convention)
|
| 36 |
- Launch via supervisord
|
| 37 |
"""
|
|
@@ -41,10 +43,33 @@ class TestDockerfileHF:
|
|
| 41 |
assert "src.models.bbb_model" in dockerfile_text, (
|
| 42 |
"must build the BBB model artifact at image-build time"
|
| 43 |
)
|
| 44 |
-
assert "
|
| 45 |
-
"must
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
)
|
| 47 |
assert "7860" in text, "must expose port 7860 (HF Spaces convention)"
|
| 48 |
assert "supervisord" in text, (
|
| 49 |
"must launch FastAPI + Streamlit via supervisord"
|
| 50 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
"""The HF Dockerfile must:
|
| 31 |
- Start FROM a Python base
|
| 32 |
- Install requirements.txt
|
| 33 |
+
- Seed data/raw/bbbp.csv AND data/raw/eeg.fif from fixtures
|
| 34 |
- Build the BBB model artifact at build time
|
| 35 |
+
- Run all three pipelines (BBB / EEG / MRI) so mlruns/ has one
|
| 36 |
+
run per modality available to /experiments/runs at startup
|
| 37 |
- Expose port 7860 (HF Spaces convention)
|
| 38 |
- Launch via supervisord
|
| 39 |
"""
|
|
|
|
| 43 |
assert "src.models.bbb_model" in dockerfile_text, (
|
| 44 |
"must build the BBB model artifact at image-build time"
|
| 45 |
)
|
| 46 |
+
assert "src.pipelines.bbb_pipeline" in dockerfile_text, (
|
| 47 |
+
"must run BBB pipeline at build so mlruns/ has a BBB run"
|
| 48 |
+
)
|
| 49 |
+
assert "src.pipelines.eeg_pipeline" in dockerfile_text, (
|
| 50 |
+
"must run EEG pipeline at build so mlruns/ has an EEG run"
|
| 51 |
+
)
|
| 52 |
+
assert "src.pipelines.mri_pipeline" in dockerfile_text, (
|
| 53 |
+
"must run MRI pipeline at build so mlruns/ has an MRI run"
|
| 54 |
+
)
|
| 55 |
+
assert "tests/fixtures/eeg_sample.fif" in dockerfile_text, (
|
| 56 |
+
"must seed data/raw/eeg.fif from the bundled fixture so the "
|
| 57 |
+
"Signal tab works without user file upload"
|
| 58 |
)
|
| 59 |
assert "7860" in text, "must expose port 7860 (HF Spaces convention)"
|
| 60 |
assert "supervisord" in text, (
|
| 61 |
"must launch FastAPI + Streamlit via supervisord"
|
| 62 |
)
|
| 63 |
+
|
| 64 |
+
def test_dockerfile_does_not_disable_mlflow(self, dockerfile_text):
|
| 65 |
+
"""The kill-switch was removed in 2026-04-30 — file-store mlruns/
|
| 66 |
+
is built into the image and is safe to expose on the read-only
|
| 67 |
+
demo. Re-introducing the kill-switch would silently kill the
|
| 68 |
+
Experiments tab and the BBB provenance strip."""
|
| 69 |
+
text = dockerfile_text.lower()
|
| 70 |
+
assert "neurobridge_disable_mlflow=1" not in text, (
|
| 71 |
+
"Dockerfile must NOT disable MLflow — that empties the "
|
| 72 |
+
"Experiments tab and blanks the BBB provenance strip. "
|
| 73 |
+
"If you need to disable MLflow at runtime, set the env "
|
| 74 |
+
"manually on the Space, do not bake it into the image."
|
| 75 |
+
)
|