Dumps/How to deploy
From Wikitech
< Dumps(Difference between revisions)
ArielGlenn (Talk | contribs) (Created page with "Deployment is done from a bastion host (e.g. fenari). Scripts for doing the deployment live in /home/wikipedia/downloadserver/snapshothosts/dumps/scripts and a local anonymous g...") |
m (Category:Dumps) |
||
| Line 43: | Line 43: | ||
TODO: dump test instance in labs, to be used before live testing on a snapshot host | TODO: dump test instance in labs, to be used before live testing on a snapshot host | ||
| + | |||
| + | [[Category:Dumps]] | ||
Latest revision as of 13:40, 28 June 2012
Deployment is done from a bastion host (e.g. fenari).
Scripts for doing the deployment live in /home/wikipedia/downloadserver/snapshothosts/dumps/scripts and a local anonymous git clone of the dumps repo including these scripts is in /home/wikipedia/downloadserver/snapshothosts/git/dumps
To use the scripts, do the following from a bastion host:
[edit] setup
- be root (note that these scripts ssh as root to a pile of hosts so...)
- cd /home/wikipedia/downloadserver/snapshothosts/dumps/scripts
- python prep-dumps-deploy.py
- this creates a copy of the dumps code in a dir with today's date, in the deployment directory
- make your desired changed, copy files in from the aforementioned git repo, etc
[edit] testing
- /bin/bash copy-dir.sh --hosts specific-snap-host
- copy the new code out to the snapshot host of your choice for testing
- /bin/bash set-symlink.sh --hosts specific-snap-host
- on the same host make production use that code. this takes effect *immediately* for new dump runs
- on the snapshot host, force a run of some small wiki, choosing one from near the bottom of this page: [1]:
- attach to screen session on the snapshot host
- open a new screen window
- su - backup
- /bin/bash
- cd /backups/dumps/production
- python worker.py --configfile confs/wikidump.conf --log nameofwikihere
- watch it run, check the output files in /mnt/data/xmldatadumps/public/nameofwikihere/todays-date-here/ against the prev date for sanity (size, # of titles, etc)
- if it looks bad, remove the contents and revert the production push form the snapshot host:
- rm -rf /mnt/data/xmldatadumps/public/nameofwikihere/todays-date-here/
- get out of backup user and close the screen window you opened
- cd /backups/dumps/
- ls -l deploy (take note of the dir with the previous date)
- rm production; ln -s deploy/dir-with-previous-date production
[edit] full deployment after testing
- if the test results look good, make it so on all snaps:
- /bin/bash copy-dir.sh
- /bin/bash set-symlink.sh
You are done.
TODO: dump test instance in labs, to be used before live testing on a snapshot host