Dumps/How to deploy

From Wikitech
< Dumps
Revision as of 10:56, 20 June 2012 by ArielGlenn (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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:

setup

  1. be root (note that these scripts ssh as root to a pile of hosts so...)
  2. cd /home/wikipedia/downloadserver/snapshothosts/dumps/scripts
  3. python prep-dumps-deploy.py
    this creates a copy of the dumps code in a dir with today's date, in the deployment directory
  4. make your desired changed, copy files in from the aforementioned git repo, etc

testing

  1. /bin/bash copy-dir.sh --hosts specific-snap-host
    copy the new code out to the snapshot host of your choice for testing
  2. /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
  3. on the snapshot host, force a run of some small wiki, choosing one from near the bottom of this page: [1]:
    1. attach to screen session on the snapshot host
    2. open a new screen window
    3. su - backup
    4. /bin/bash
    5. cd /backups/dumps/production
    6. python worker.py --configfile confs/wikidump.conf --log nameofwikihere
    7. 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)
  4. if it looks bad, remove the contents and revert the production push form the snapshot host:
    1. rm -rf /mnt/data/xmldatadumps/public/nameofwikihere/todays-date-here/
    2. get out of backup user and close the screen window you opened
    3. cd /backups/dumps/
    4. ls -l deploy (take note of the dir with the previous date)
    5. rm production; ln -s deploy/dir-with-previous-date production

full deployment after testing

  1. if the test results look good, make it so on all snaps:
    1. /bin/bash copy-dir.sh
    2. /bin/bash set-symlink.sh

You are done.

TODO: dump test instance in labs, to be used before live testing on a snapshot host

Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox