This document explains how to run and ship ProSeqGO across local development, CI, and production-like environments.
| Environment | Compose files | Typical use |
|---|---|---|
| Local dev (CPU) | docker-compose.yml |
PCs without NVIDIA GPU |
| Local dev (GPU) | docker-compose.yml + docker-compose.gpu.yml |
make up auto-detects NVIDIA |
| CI / CPU smoke | docker-compose.yml + docker-compose.ci.yml |
make ci-up |
| Full stack | base + GPU + training + monitoring profiles |
Integration testing, demos |
Differences:
- CI overlay: forces
CAFA_DEVICE=cpu, CPU PyTorch wheels, skipspostgres-backup/backup-offload - GPU overlay: adds
gpus: allto embedding/training workers - Training profile: starts
trainer-apiandtrainer-worker - Monitoring profile: starts Prometheus, Grafana,
redis-exporter
| Requirement | Notes |
|---|---|
| Docker + Docker Compose v2 | Required for all deployment modes |
| NVIDIA Container Toolkit | Optional; for GPU overlay |
make, bash, curl |
Convenience targets and smoke tests |
| Kaggle credentials | Only for downloading training data (not for serving) |
| Python 3.10+ | For CLI training outside containers |
make ci-env # copies .env.example → .env if missing
# Edit .env: Postgres, MinIO, GATEWAY_* passwords
make gateway-auth # writes nginx/.htpasswd-admin and .htpasswd-userNever commit .env or htpasswd files with real credentials.
make upStarts: nginx, embedding-api, embedding-worker, go-prediction-api, streamlit-ui, mlflow, postgres, redis, minio, backup sidecars (non-CI).
Equivalent manual command:
docker compose up -d --build
# GPU host:
docker compose -f docker-compose.yml -f docker-compose.gpu.yml up -d --buildmake monitoring-up # Prometheus + Grafana
make training-up # Training API + worker
make all-up # default + monitoring + training| Endpoint | URL |
|---|---|
| Gateway / UI | http://localhost/ (public Streamlit; /ui/ redirects here) |
| MLflow | http://localhost/mlflow/ |
| Prometheus | http://localhost:9090 (monitoring profile) |
| Grafana | http://localhost:3000 (monitoring profile) |
Public production UI: https://proseqgo.com. Keep TLS, DNS, and firewall details in a private ops runbook—not in this repository.
Health checks (local):
curl -sk -u user:PASSWORD http://localhost/api/v1/health
curl -sk -u user:PASSWORD http://localhost/api/predict/healthSee .env.example for the full list. Key groups:
| Group | Variables |
|---|---|
| Gateway auth | GATEWAY_ADMIN_USER, GATEWAY_ADMIN_PASSWORD, GATEWAY_USER, GATEWAY_USER_PASSWORD |
| Postgres | POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB |
| MinIO / S3 | MINIO_ROOT_USER, MINIO_ROOT_PASSWORD, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY |
| MLflow | MLFLOW_S3_ENDPOINT_URL, MLFLOW_ARTIFACT_ROOT |
| Model registry | REGISTERED_MODEL_NAME, PROMOTION_THRESHOLD |
| Job queues | REDIS_URL, JOBS_DATABASE_URL, EMBEDDING_JOB_TIMEOUT_SEC, TRAINING_JOB_TIMEOUT_SEC |
Set in docker-compose.yml or overlays; do not duplicate secrets in multiple files.
| Service | Notable env |
|---|---|
go-prediction-api |
MODEL_URI=models:/${REGISTERED_MODEL_NAME}@champion |
embedding-api |
GO_PREDICTION_API_URL=http://go-prediction-api:8000 |
streamlit-ui |
GATEWAY_BASE_URL=http://nginx |
NGINX is the application ingress inside Compose. Terminate TLS and restrict ports at the host or edge proxy.
| Gateway path | Upstream | Notes |
|---|---|---|
/ |
streamlit-ui |
Public UI |
/ui/ |
redirect → / |
Compatibility |
/api/v1/* |
embedding-api:8000 |
Auth required (admin for most routes; user for sync predict-go) |
/api/predict/* |
go-prediction-api:8000 |
Auth required |
/api/train/* |
trainer-api:8000 |
Training profile only |
/mlflow/ |
mlflow:5000 |
Admin auth |
Auth tiers:
- Admin: most
/api/v1/*job/admin routes,/api/train*,/mlflow/ - User:
/api/predict/*,/api/v1/predict-go-from-sequences,/api/v1/predict-go-from-fasta - Public:
/(Streamlit UI)
See nginx/README.md for rate limits and body size caps.
Single host, local volumes, all services in Compose. Best for development and reproducible demos.
- Strong unique
GATEWAY_*, Postgres, and MinIO secrets; rotate when staff changes - Distinct admin vs user gateway accounts
- TLS certificates and DNS managed outside this repo
- Modal (or other) cloud credentials only in host env / secret store
- Health-check UI and predict APIs after each deploy
- Training pipeline on GPU node or batch scheduler
- Push model versions to shared MLflow registry
- Serving stack consumes only
@championalias
Enable monitoring profile by default; add Alertmanager and external notifications for production.
Documented in .github/CI.md.
| Trigger | Actions |
|---|---|
| PR | Lint, unit tests, image builds (no push) |
Push to main |
Lint, unit tests, build + push to GHCR |
Registry: ghcr.io/behroooz/proseqgo-{embedding-api,go-prediction-api,streamlit-ui,trainer-api,mlflow}
Tags: main, sha-<fullsha>
make pull-images # pull :main
GHCR_TAG=sha-<commit> make pull-imagesLocal build:
make build-images # CUDA index by default (cu132)
TORCH_INDEX_URL=https://download.pytorch.org/whl/cpu make build-images # CPU wheelsmake ci-up
make smoke
make ci-downSmoke runs tests/smoke/smoke_embedding_api.sh. Does not start training profile or GPU jobs.
- Merge to
main→ CI publishes images to GHCR - Tag release in git if using versioned deploys
- Pull images on target host:
GHCR_TAG=sha-<commit> make pull-images - Update
.envif config/secrets changed docker compose pull && docker compose up -d- Run smoke/health checks
- Confirm Grafana dashboards and MLflow registry
GHCR_TAG=sha-<previous-commit> make pull-images
docker compose up -dSet champion alias to previous version in MLflow (see training.md), then restart go-prediction-api.
Restore from ./backups/postgres/ or MinIO bucket mlflow-db-backups. Test restore procedure in staging before production need.
| Component | Scaling approach |
|---|---|
embedding-worker |
Add worker replicas (same Redis queue) |
go-prediction-api |
Horizontal replicas behind NGINX (shared model cache volume or pull from MLflow) |
trainer-worker |
Single worker recommended per GPU; scale via dedicated training nodes |
| Postgres / MinIO / Redis | Use managed services or clustered setups for production |
Current Compose file targets single-host deployment; multi-host requires external orchestration (Kubernetes, etc.).
| Asset | Mechanism | Location |
|---|---|---|
| Postgres (MLflow + jobs) | postgres-backup sidecar |
./backups/postgres/ |
| Offsite DB dumps | backup-offload hourly |
MinIO mlflow-db-backups |
| MLflow artifacts | MinIO volume | minio_data volume |
| Local outputs | Bind mount | ./outputs/ |
Existing Postgres volume without proseqgo_jobs DB:
docker compose exec postgres psql -U "$POSTGRES_USER" -c 'CREATE DATABASE proseqgo_jobs;'Or recreate volume so docker/postgres/init-proseqgo-jobs.sh runs on first init.
make up / make down
make ci-up / make ci-down
make training-up / make training-down
make monitoring-up / make monitoring-down
make lint / make test
make build-images / make pull-images
make smoke
make gateway-auth- architecture.md — service topology
- monitoring.md — observability setup
- troubleshooting.md — common deployment failures
- data.md — training data setup (not required for serving-only deploy)