Difference between revisions of "Software Life Cycle: 4. Updating The Production Servers"
Line 83: | Line 83: | ||
''We use symlinks to point to the most current versions of the website and databases in both production and on the FTP site. These need to be adjusted prior to going live.'' | ''We use symlinks to point to the most current versions of the website and databases in both production and on the FTP site. These need to be adjusted prior to going live.'' | ||
− | wb-dev> website-admin/update/production/ | + | wb-dev> website-admin/update/production/adjust_symlinks.pl WSXXX |
== Restart services == | == Restart services == |
Revision as of 18:05, 13 July 2011
Contents
- 1 Overview
- 2 Steps
- 2.1 Check out code to the staging QA/QC website
- 2.2 Tag the software
- 2.3 Check disk space on local and remote nodes
- 2.4 Put the production site into maintenance mode
- 2.5 Push Acedb to AceDB nodes
- 2.6 Push MySQL databases to MySQL nodes
- 2.7 Push support databases to all nodes
- 2.8 Deploy the web app
- 2.9 Adjust symlinks
- 2.10 Restart services
Overview
This document describes the final stage of the WormBase software release cycle, moving new databases and software into production. New releases of the web app and associated databases are staged on the development server.
- Restore the site to active mode: to do
- Make a blog entry
- Send release email: to do (possibly via blog)
The scripts that mediate production release are maintained in the git website-admin repository.
Steps
Check out code to the staging QA/QC website
wb-dev> cd /usr/local/wormbase/website/staging wb-dev> git pull
Test the site as appropriate (to be described). Develop, test, commit, checkout and repeat as necessary.
Tag the software
For each major WS release, create a corresponding tag on HEAD in the git repository.
wb-dev> cd /usr/local/wormbase/website/staging wb-dev> git pull wb-dev> git tag -a -m "WSXXX" WSXXX HEAD wb-dev> git push --tags
Check disk space on local and remote nodes
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
Put the production site into maintenance mode
TODO
Push Acedb to AceDB nodes
wb-dev> website-admin/update/production/steps/push_acedb.pl WSXXX
Push MySQL databases to MySQL nodes
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
Push support databases to all nodes
wb-dev> website-admin/update/production/steps/push_support_databases.pl WSXXX
Deploy the web app
wb-dev> website-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
Adjust symlinks
We use symlinks to point to the most current versions of the website and databases in both production and on the FTP site. These need to be adjusted prior to going live.
wb-dev> website-admin/update/production/adjust_symlinks.pl WSXXX
Restart services
Starman and AceDB need to be restarted on remote nodes.
wb-dev> website-admin/update/production/steps/restart_services.pl WSXXX