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
- MongoDB Atlas for the 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_nameterraform variable to its value. - Create an SSH keypair and set the public key as the
ssh_public_keyterraform 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_KEYandMONGODB_ATLAS_PRIVATE_KEY. - Set the target MongoDB Atlas organization ID as the
mongodbatlas_org_idterraform variable.
cd packerpacker build worker.pkr.hcl- Use the resulting AMI ID as the
worker_ami_idterraform 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