Deployment - digitalepidemiologylab/crowdbreaks-streamer-v1 GitHub Wiki

Deployment to production on AWS EC2 (Ubuntu 18.04)

  1. Update system
sudo apt update && sudo apt upgrade
  1. Create SSL keypair
ssh-keygen -t rsa -b 4096 -C "[email protected]"
  1. Add public key to deploy keys in github repository and clone repo
  2. Set secrets in secrets.list
cp secrets.list.example secrets.list
  1. Install docker and docker-compose
  2. Install certbot, obtain certificates for kibana.crowdbreaks.org and api.crowdbreaks.org and set up automatic renewal
  3. Run deploy script
source build_production.sh

Redis warnings

Redis will issue two warnings on start-up when run on a EC2 machine. Both are config settings to be made on the host machine. After having made those settings Redis needs to be restarted.

# Fix "WARNING overcommit_memory is set to 0! Background save may fail under low memory condition."
sudo sysctl vm.overcommit_memory=1
# Fix "WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis"
sudo sh -c "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
sudo sh -c "echo never > /sys/kernel/mm/transparent_hugepage/defrag"