Skip to content

Deployment Plan and Infrastructure

mahutt edited this page Mar 6, 2026 · 7 revisions

We plan to follow the following roll-out strategy, adapted for our use case (because this is an internal tool, it won't see consumption by the stakeholder's clients).

  • Release to stakeholder
  • Release to development team's family and friends
  • Release to other users at the stakeholder's company

We follow continuous deployment and trunk-based development, so there are not specific versions for specific users. We will always be collecting feedback based on the latest version.

AWS Deployment

The stakeholder has indicated that they want to deploy to AWS, so we have provided an AWS CDK template which can be used to deploy the project and its dependencies (Postgres, etc.) to AWS in a containerized environment (AWS Elastic Container Service). Pictured below is a flow diagram for the deployment plan under AWS:

VeloSim deployment diagram

⚠️ The CDK code has now been removed from the repository.

CSSE Deployment

In our initial testing, the AWS-deployed version will cost around $66.10/month ($CAD) to operate, so for the version that we host over the life of the project, we are using an Ubuntu box which is provided by CSSE. We use an Ansible playbook to deploy everything required for our app (Docker, nginx, Grafana, Loki, Postgres, Prometheus) and we use GitHub actions to continuously deploy our main branch to this server (including schema changes and new container images).

In the future, this playbook could also be used for a virtual machine running on AWS, which may save on cost compared to using AWS-native technologies (like ECS, AWS WAF).

Production Deployment Stack

The production environment includes the following services deployed via Ansible:

Core Application:

  • Backend (FastAPI) on port 8000
  • Frontend (React) served via nginx on port 3000
  • PostgreSQL 15 database on port 5432
  • OSRM routing server on port 5000

Logging & Monitoring:

  • Grafana (visualization) on port 3001
  • Loki (log aggregation) on port 3100
  • Promtail (log collection) on port 9080
  • Prometheus (metrics) on port 9090

Deployment Process:

  1. GitHub Actions triggers on push to main branch
  2. Docker images built and pushed to registry
  3. Ansible playbook pulls new images and restarts services
  4. Database migrations run automatically via Dockerfile.migration
  5. Health checks ensure services are running before completion

Volume Mounts (Production):

  • postgres_data:/var/lib/postgresql/data - Database persistence
  • grafana_logging:/app/grafana_logging - Log file persistence
  • osrm_data:/data - OSRM routing data

Clone this wiki locally