Software Life Cycle: 4. Updating The Production Servers

From WormBaseWiki
Jump to navigationJump to search

Overview

New releases of the web app and associated databases are staged on the development server. After testing, they are pushed into production. Here is a summary of the main steps.

  1. Check disk space and local and remote nodes: to do
  2. Purge old releases from local and remote nodes: to do
  3. Push new AceDB to AceDB nodes: cron_rsync_acedb.sh
  4. Push new MySQL databases to MySQL nodes: cron_rsync_mysql_dbs.sh
  5. Push new support databases: cron_rsync_support_dbs.sh
  6. Put the site into maintenance mode: to do
  7. Push updated version of the webapp: deploy_wormbase_webapp.sh VERSION
  8. Go live script that adjusts database symlinks and restarts services: to do
  9. Restore the site to active mode: to do
  10. Make a blog post
  11. Send release email: to do (possibly via blog)


These steps -- and the scripts that mediate them -- are described in more detail below.

Releasing a new build

New builds of the database are staged on wb-dev. Appropriate scripts are in the private wormbase-admin mercurial module.

Purge old builds

Purge a specific release from production nodes. This need to be run every release but is useful to periodically clear out old builds.

Remove build WSXXX, including acedb, mysql, and support DBs

wb-dev> admin/update/production/purge_old_releases.sh WSXXX

Remove build WSXXX from localhost (ie the dev server), including acedb, mysql, and support DBs

wb-dev> admin/update/production/purge_old_releases.sh WSXXX local

Push out Acedb

The Acedb data directory is kept in sync by cron:

wb-dev> cron_rsync_acedb.sh

Push out MySQL

Originally intended to be run as a cron job, it's less error prone to push databases out when they are ready to go.

wb-dev> cron_rsync_mysql_dbs.sh WSXXX

Deploy software

Major Releases

Deployment is handled automatically by a script in the wormbase-admin module:

wb-dev:admin/update/production/deploy_wormbase_app.sh WSXXX
  • Reads the current version of the code in the staging/ directory.
  • Rsyncs that directory to each web node in cluster:/usr/local/wormbase/website/$VERSION
  • Updates the symlink on cluster:/usr/local/wormbase/website/production -> $VERSION
  • Creates a release of the software (should it branch/tag, too?) to the releases directory and the FTP site.
wb-dev:/usr/local/wormbase/website/releases/YYYY-MM-DD-$WORMBASEVERSION-$VERSION-YYYY-MM-DD
  • Creates a reference version of the production site for easy access on the dev server at:
wb-dev:/usr/local/wormbase/website/production

Minor Revisions

Pass a flag to the update script if this is just a minor revision. In this case, the staging directory will be synced to webserver nodes but no other steps will be executed:

wb-dev:admin/update/production/deploy_wormbase_app.sh WSXXX 1

Restart services