Contact info
Tan | ts864@cornell.edu
Overview
Currently, the way services are deployed is basically running their Docker containers on AWS EC2 instances. This means that each service occupies a unique port on the machine. Below is a list of running services and the ports they are using.
Service | Port |
---|---|
Backend online | 5001 |
Test and production environments are deployed separately on the EC2 instances below.
Environment | IP address | Domain | Key pair file |
---|---|---|---|
Online Test | 3.232.82.82 (will move to 54.163.4.203) | mobile-test.diaper.cf (deprecated: on-test.diaper.cf) | |
Offline Test | 54.243.201.107 | ||
Online Production | 35.168.248.57 | mobile-prod.diaper.cf (deprecated: on-prod.diaper.cf) | DIAPER-production-key.pem |
Offline Production | 3.228.124.129 |
Procedure
The procedure for deploying is the same for both EC2 instances. First, download the key pair file corresponding to the instance and run
chmod 400 /path/to/DIAPER-*-key.pem
Then, ssh into the EC2 instance using
ssh -i /path/to/DIAPER-*-key.pem ec2-user@<domain>
Pull your Docker image and other relevant file from GitHub. Once pulled, navigate to your project folder and run the Docker using docker-compose up with the corresponding yml file:
// For test environments. sudo docker-compose -f docker-compose-test.yml up -d --force-recreate // For production environments. sudo docker-compose -f docker-compose-prod.yml up -d --force-recreate // For local development on your laptop. // These two commands are equivalents (i.e. default is docker-compose.yml) sudo docker-compose -f docker-compose.yml up -d --force-recreate sudo docker-compose up -d --force-recreate
We have different yml files because production and test environments use different SSL certificates. To keep your service from blocking the console, you should run your Docker in detached mode using the -d option.
Now you can log out and the service will continue running on the EC2 instance.
Some Issues
BioHPC database timeout
If you are experiencing timeout when connecting to the BioHPC database, it' probably because the EC2 instance isn't connected to Cornell's VPN. Check whether the VPN is connected with
ps -A | grep openconnect
If the output is non-empty, then the VPN is connected. If not, you can connect to the VPN using
sudo openconnect -b cuvpn.cuvpn.cornell.edu --reconnect-timeout 600
and enter necessary information as prompted.