You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is **no automated test suite** in this repository — no pytest, unittest, or similar framework is configured. There are no test files. Validation is done manually by running the dashboard or ML training scripts.
77
+
There is no pytest/unittest framework configured, but `tests/test_ml_pipeline.py` exercises the full ML lifecycle (training → upload to MLflow → download → accuracy check). It requires a local MLflow server:
78
+
79
+
```bash
80
+
# Start a local MLflow server
81
+
docker run -p 127.0.0.1:5000:5000 ghcr.io/mlflow/mlflow mlflow server --host 0.0.0.0
82
+
83
+
# Run the test from the repository root
84
+
python tests/test_ml_pipeline.py
85
+
86
+
# Optionally restrict to a specific model type or config
87
+
python tests/test_ml_pipeline.py --model NN --config_file experiments/synapse-bella-ip2
88
+
```
89
+
90
+
Dashboard validation is done manually by running the application.
75
91
76
92
## CI/CD
77
93
@@ -84,31 +100,31 @@ The only CI workflow is **CodeQL Advanced** (`.github/workflows/codeql.yml`), wh
84
100
- Built on [Trame](https://kitware.github.io/trame/) — a Python framework for interactive web applications.
85
101
- Uses the **manager pattern**: each feature area has a dedicated `*_manager.py` class that handles its UI components and business logic.
86
102
-`state_manager.py` manages the global Trame server, state, and controller.
87
-
- Data flows through MongoDB (PyMongo) for experiment and simulation data.
88
-
- Data flows through MLflow for ML models.
103
+
- Data flows through MongoDB (PyMongo) for experiment and simulation data.
104
+
- Data flows through MLflow for ML models.
89
105
- NERSC Superfacility API integration is in `sfapi_manager.py`.
90
106
91
107
### ML Training
92
108
93
109
-`train_model.py` supports three model types: Gaussian Process (GP), Neural Network (NN), and Ensemble.
94
110
- Uses PyTorch, BoTorch, and GPyTorch for model training.
95
111
- CUDA is auto-detected for GPU acceleration.
96
-
- Models are serialized and stored in an MLflow tracking server.
112
+
- Models are serialized and stored in an MLflow tracking server.
97
113
98
114
### Data Storage
99
115
100
-
-**MongoDB** is used for persistent data from experiments and simulations.
101
-
-**MLflow** is used for persistent data from ML models.
116
+
-**MongoDB** is used for persistent data from experiments and simulations.
117
+
-**MLflow** is used for persistent data from ML models.
102
118
- Database access requires SSH tunneling to NERSC when running locally.
- Environment variables: `SF_DB_HOST` (dashboard), `SF_DB_READONLY_PASSWORD` (dashboard and ML training), `AM_SC_API_KEY` (dashboard and ML training, required when MLflow tracking_uri is AmSC).
104
120
105
121
## Common Pitfalls and Workarounds
106
122
107
123
1.**No `pyproject.toml` or `ruff.toml`**: Ruff uses default rules. Do not create these files unless the project explicitly adopts them.
108
124
2.**Conda, not pip**: Dependencies are managed via `conda` and `conda-lock`, not `pip`. Do not add `requirements.txt` or modify `pyproject.toml` for dependencies. Update `environment.yml` in the relevant component directory and regenerate the lock file.
109
125
3.**Separate environments**: The dashboard and ML components have independent Conda environments (`synapse-gui` and `synapse-ml`). Changes to dependencies must be made in the correct `environment.yml`.
110
126
4.**Docker builds from root**: Dockerfiles reference paths relative to the repository root. Always run `docker build` from the repository root directory.
111
-
5.**No test infrastructure**: Since there is no test framework, validate changes by running the linter (`ruff check .`) and verifying logic through code review.
127
+
5.**Limited test infrastructure**: There is no pytest/unittest framework, but `tests/test_ml_pipeline.py` can validate ML changes end-to-end (requires a local MLflow server). Always run the linter (`ruff check .`) and verify logic through code review.
112
128
6.**Experiment configs are external**: The `experiments/` directory contains cloned private repositories. These are not checked into this repository (excluded via `.gitignore`).
113
129
7.**NERSC-specific infrastructure**: Much of the deployment depends on NERSC services (Spin, Superfacility API, Perlmutter). Code changes affecting deployment or data access should be tested against NERSC services when possible.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ To display ML predictions, the application requires the following:
25
25
-**Simulation and experimental data points**: Each data point consists of values for the scalar inputs and outputs defined in the experiment configuration file.
26
26
Data points are stored in a [MongoDB](https://www.mongodb.com/) database, where each experiment is represented by a separate collection.
27
27
Experimental and simulation data points are stored in the same collection and are distinguished by the `experimental_flag` attribute.
28
-
-**ML models**: Machine learning models that interpolate between data points and are stored in a separate MongoDB collection named `models`.
28
+
-**ML models**: Machine learning models that interpolate between data points and are stored in [MLflow](https://mlflow.org/).
29
29
-**Simulation movies** (optional): For certain experiments, users can click on simulation data points to visualize simulation movies.
30
30
The corresponding MP4 files are stored in the Perlmutter shared file system at `/global/cfs/cdirs/m558/superfacility/simulation_data`.
31
31
This directory is mounted on the container image running on Spin.
0 commit comments