You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 54 Next »

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.

Test and production environments are deployed separately on the EC2 instances below.

EnvironmentIP addressDomainPortSample URLKey pair file
Mobile (Online) Test54.163.4.203
(previous 3.232.82.82)

mobile-test.diaper.cf

(deprecated: on-test.diaper.cf)

5001https://mobile-test.diaper.cf:5001/api/monitoring

DIAPER-test-key.pem

Dashboard (Offline) Test54.243.201.107dashboard-test.diaper.cf5000https://dashboard-test.diaper.cf:5000/env/





Mobile (Online) Production

35.168.248.57

mobile-prod.diaper.cf

(deprecated: on-prod.diaper.cf)

5001https://mobile-prod.diaper.cf:5001/api/monitoringDIAPER-production-key.pem
Dashboard (Offline) Production3.228.124.129dashboard-prod.diaper.cf5000https://dashboard-prod.diaper.cf:5000/env/

Procedure

The procedure for deploying is the same for all environments. First, download the key pair file corresponding to the instance and run

chmod 400 /path/to/DIAPER-*-key.pem

Then, ssh into the corresponding 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 the folder containing docker-compose files and run the corresponding command as explained below:

// For test environments.
./deploy.sh -n "Your Name" -m "Reason for deployment" test
 
// For production environments.
./deploy.sh -n "Your Name" -m "Reason for deployment" prod

// 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

For test and production environments, your deployment will be logged in deploymentHistory.log under the same directory.

The commands above run your container in detached mode so that your service doesn't block the console. However, once a container is run in detached mode, all of its runtime errors will not be reported to the console. Thus, as the last step of deployment, you need to manually check that no runtime errors occurred during the launching of your service by looking at its log using

sudo docker-compose logs -f

If there are no runtime errors, you will get an output similar to the one below.

Now you can log out and the service will continue running on the EC2 instance.

Some Issues

BioHPC database timeout (Obsolete)

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.




  • No labels