Software Life Cycle: 4. Updating The Production Servers
Contents
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.
- Check disk space and local and remote nodes: to do
- Purge old releases from local and remote nodes: to do
- Push new AceDB to AceDB nodes: cron_rsync_acedb.sh
- Push new MySQL databases to MySQL nodes: cron_rsync_mysql_dbs.sh
- Push new support databases: cron_rsync_support_dbs.sh
- Put the site into maintenance mode: to do
- Push updated version of the webapp: deploy_wormbase_webapp.sh VERSION
- Go live script that adjusts database symlinks and restarts services: to do
- Restore the site to active mode: to do
- Make a blog post
- 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 git repository.
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
wb-dev> website-admin/update/production/steps/push_acedb.pl WSXXX
Push out Support Databases
wb-dev> website-admin/update/production/steps/push_support_databases.pl WSXXX
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> website-admin/update/production/steps/push_mysql_databases.pl WSXXX
Tag the software
For each major WS release, create a corresponding tag on HEAD.
> cd /usr/local/wormbase/website/staging > git pull > git tag -a -m "WSXXX" WSXXX HEAD > git push --tags
Deploy the web app
wb-dev:admin/update/production/deploy_webapp.sh WSXXX
Every push to production is
- tied to a version of the database
- tied to a major version of the webapp
- tied to a revision corresponding to the number of commits since the last tag
Date # of commits since WS221 tag | | WS221-2010.12.24-v0.02r0 | | Acedb version Major software version
The deployment script runs the following steps.
- gets the current major version of the webapp from lib/WormBase/Web.pm
- gets the number of commits for the source in wb-dev:website/staging since the last tag
- creates a VERSION.txt in the staging directory
- rsyncs the staging directory to local and remote web cluster nodes using version scheme above
- creates a symlink on remote nodes: /usr/local/wormbase/website/production -> WS221-2010.12.24-v0.02r0
- creates a software release on the FTP site, and symlinks current.tgz to it
- copies the staged code to wb-dev:/usr/local/wormbase/website/production" for easy reference
Restart services
cd /usr/local/wormbase/website/production source wormbase.env bin/starman-production.sh start