Skip to content
Sef Kloninger edited this page Jul 23, 2013 · 9 revisions

These are some of the steps and commands that we use to operate our instance of edX here at Stanford.

End-To-End Test

cd playbooks/edx-west
ANSIBLE_EC2_INI=./ec2.ini ansible-playbook  -c ssh -vvv -i ./ec2.py edxapp_prod.yml --list-hosts

playbook: edxapp_prod.yml

Should this playbook run database migrations? (Type 'yes' to run, anything else to skip migrations):

Normal Update -- run all plays

cd playbook/edx-west
ANSIBLE_EC2_INI=./ec2.ini ansible-playbook  -c ssh -vvv -i ./ec2.py edxapp_prod.yml

Deploy Only -- run only the "deploy" play

doesn't change any of the *.json files, ie. the configuration steps, so only want to do this when we're sure we just want new software.

Specify the branch here, variable is lms_version: configuration-secure/ansible/vars/edxapp_prod_vars.yml

and then run this:

cd playbook/edx-west
ANSIBLE_EC2_INI=./ec2.ini ansible-playbook  -c ssh -vvv -i ./ec2.py edxapp_prod.yml

Restarts

cd configuration
fab -u ubuntu tags:environment=prod,function=webserver -- 'sudo stop edxapp && sudo start edxapp'

Install

cd configuration
fab -u ubuntu tags:environment=prod,function=webserver cache.from_strings:edx-platform=81c567723088ac1d5a409ee942dae8ee3b69380e git.deploy

Useful line to detect connections piling up:

cd playbooks/edx-west
ANSIBLE_EC2_INI=./ec2.ini ansible '~tag_Name_app(10|20|11|21)_prod' -s -c ssh -i ./ec2.py -m shell -a "lsof -i |grep TCP | wc -l"