orma / openroads-vn-analytics

BSD 2-Clause "Simplified" License
0 stars 1 forks source link

Local infrastructure migration #431

Open batpad opened 6 years ago

batpad commented 6 years ago

The Problem

Ideally, we want a solution that will let us continue developing using containers, and not have to deploy a wildly different configuration inside Vietnam. We also want this setup to be simple to maintain.

Proposal

Use two machines / VMs. On one machine, setup a Postgres database. This can be setup via a simple provisioning script, and would just be a fairly normal postgres install, with security configuration so that it is accessible only from the other machine that runs the containers.

On the second machine, use docker-compose to run all the containers required for the ORMA project, passing in credentials to the Postgres host as environment variables. Scheduled tasks can be run as cronjobs that invoke docker run of a specific container.

This keeps the database on standard configuration, and the stateless containers well isolated from each other, and the process to run them being as simple as a docker-compose up.

I think this might keep a good balance between complex provisioning scripts for each application and handling application isolation, etc. and going for a full-blown cluster management system like Kubernetes, which would introduce its own over-head.

If we do feel we need to scale beyond a single node for all the containers, we can consider moving to Kubernetes, and then writing a docker-compose configuration would be a useful first step toward that anyway.

cc @geohacker

geohacker commented 6 years ago

This sounds good to me @batpad! So here are the parts we need to setup to run locally:

geohacker commented 6 years ago

We're pretty close https://github.com/orma/openroads-vn-deploy