Semaphore Developer How To: - conrad-blucher-institute/semaphore GitHub Wiki
This page documents common commands used in Semaphore. The following steps should be implemented after following the instructions in the README.md
.
Run a Model or Multiple Models
docker exec semaphore-core python3 src/semaphoreRunner.py -d ./Surge/North_Jetty/nj_mlp_surge_48h_pred.json ./Surge/North_Jetty/nj_mlp_surge_72h_pred.json
Build Docker Containers (Must re-build containers if you make changes to the code)
- Remove the existing running containers:
docker compose down
- Build the image for the new containers:
docker compose build
- Deploy the new containers:
docker compose up -d
Database Migration
-
Start the docker containers
-
Create database migration and change target version
-
docker exec semaphore-core python3 ./tools/migrate_db.py
-
Check the database to ensure the database version was changed and what you intended to add was added
Unit Tests
We use the library Pytest to create tests for specific sections of Semaphore. Run a command: python -m pytest -s path to file
for example, python -m pytest -s src/tests/IntegrationTests/test_HOHONU.py