This repository contains infrastructure-as-code for reproducible Histomics deployments on AWS using highly managed, scalable services, including
- Elastic Container Service for the web application
- EC2 instances for celery worker nodes
- DocumentDB as the mongo-compatible database
- Amazon MQ as the celery queue
- CloudWatch for log persistence
- Sentry integration (optional)
- Obtain a domain name via AWS Route53, and set the
domain_name
terraform variable to its value. - Create an SSH keypair and set the public key as the
ssh_public_key
terraform variable. This is the key that will be authorized on the worker EC2 instance(s). - Set AWS credentials in your shell environment.
- In your target MongoDB Atlas organization, create a new API key and set the public and private
key in your local environment in the variables
MONGODB_ATLAS_PUBLIC_KEY
andMONGODB_ATLAS_PRIVATE_KEY
. - Set the target MongoDB Atlas organization ID as the
mongodbatlas_org_id
terraform variable.
cd packer
packer build worker.pkr.hcl
- Use the resulting AMI ID as the
worker_ami_id
terraform variable.
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker build -t zachmullen/histomics-load-test -f histomicsui.Dockerfile .
docker push zachmullen/histomics-load-test
- Copy the SHA from the docker push command and paste it into
main.tf
- From the terraform directory, run
terraform apply -var-file=.tfvars