-
Notifications
You must be signed in to change notification settings - Fork 1
Production Deployment
Jessica Van Brummelen edited this page Jul 25, 2020
·
3 revisions
AppInventor has provided a server for Convo at userstudy.appinventor.mit.edu where the system can be deployed.
By default, the pages served by the UI connect via WebSockets to local servers, instead of explicitly connecting to the ones at userstudy.appinventor.mit.edu. To have the UI explicitly connect to the production servers, you have to comment and uncomment a couple of lines in a couple of the JS files.
- In
frontend/public/js/experiment.js:- Uncomment line 2 (
const server = 'https://userstudy.appinventor.mit.edu/api';) - Comment out line 4 (
const server = 'http://localhost:5000';)
- Uncomment line 2 (
- In frontend/public/js/socket.js:
- Uncomment lines 2-3 (
const socket = io.connect("https://... and const socketApi = io.connect("https:...) - Comment out lines 5-6 (
const socket = io.connect('http://localhost:8080'); and const socketApi = io.connect('http://localhost:5000');)
- Uncomment lines 2-3 (
To deploy the production system on the server, run
# Backs up the logs and deploys the production system
# Recommended
./deploy_prod.sh
# OR
# Just deploys the production system
docker-compose -f docker-compose.prod.yml up --buildIf you are simply testing the system and want to deploy, use
# Backs up the logs and deploys the development system
# Recommended
./deploy.sh
# OR
# Just deploys the development system
docker-compose -f docker-compose.yml up --buildThere are three scripts that can be used to help streamline and automate tasks involving retrieving logs and deploying the production server.
-
get_logs.shmoves all Docker logs from the default location mentioned above to alogsdirectory in the project directory. More specifically, a directory with its name being the time when the script was invoked will be created and all logs will be copied to that directory. For example, if time in milliseconds was382382328, all logs at that moment will be copied tologs/382382328. This way, logs are backed up and not accidentally removed. -
deploy_prod.shanddeploy.shboth retrieve the logs (by callingget_logs.sh) before deploying the respective Docker containers in case containers are overwritten or logs get lost