Difference between revisions of "Software Life Cycle: 4. Updating The Production Servers"

From WormBaseWiki
Jump to navigationJump to search
Line 6: Line 6:
  
 
# Check out and test code on staging.wormbase.org
 
# Check out and test code on staging.wormbase.org
# Check disk space and local and remote nodes: '''to do'''
+
# Check disk space on local and remote nodes: '''to do'''
 
# Push AceDB to AceDB nodes
 
# Push AceDB to AceDB nodes
 
# Push MySQL databases to MySQL nodes
 
# Push MySQL databases to MySQL nodes
Line 17: Line 17:
 
# Send release email: '''to do (possibly via blog)'''
 
# Send release email: '''to do (possibly via blog)'''
  
These steps -- and the scripts that mediate them -- are described in more detail below.
+
These steps are described in more detail below.  The scripts that mediate them are found in the [https://github.com/WormBase/website-admin git website-admin] repository.
  
 
= Check out code to the staging QA/QC website =
 
= Check out code to the staging QA/QC website =
Line 35: Line 35:
 
  wb-dev> git push --tags
 
  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
  
  
  
 +
= Push Acedb to AceDB nodes =
  
''New builds of the database are staged on wb-dev. Appropriate scripts are in the private wormbase-admin git repository.''
+
wb-dev> website-admin/update/production/steps/push_acedb.pl WSXXX
  
== Purge old builds ==
+
= Push MySQL databases to MySQL 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
+
''New builds of the database are staged on wb-dev.  
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 ==
 
== Push out Support Databases ==

Revision as of 17:50, 13 July 2011

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. The main steps of the production stage are:

  1. Check out and test code on staging.wormbase.org
  2. Check disk space on local and remote nodes: to do
  3. Push AceDB to AceDB nodes
  4. Push MySQL databases to MySQL nodes
  5. Push support databases to all nodes
  6. Put the site into maintenance mode: to do
  7. Push the staged app to production: deploy_webapp.sh VERSION
  8. Go live (adjust symlinks, restart services)
  9. Restore the site to active mode: to do
  10. Make a blog entry
  11. Send release email: to do (possibly via blog)

These steps are described in more detail below. The scripts that mediate them are found in the git website-admin repository.

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


Push Acedb to AceDB nodes

wb-dev> website-admin/update/production/steps/push_acedb.pl WSXXX

Push MySQL databases to MySQL nodes

New builds of the database are staged on wb-dev.



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


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.

  1. gets the current major version of the webapp from lib/WormBase/Web.pm
  2. gets the number of commits for the source in wb-dev:website/staging since the last tag
  3. creates a VERSION.txt in the staging directory
  4. rsyncs the staging directory to local and remote web cluster nodes using version scheme above
  5. creates a symlink on remote nodes: /usr/local/wormbase/website/production -> WS221-2010.12.24-v0.02r0
  6. creates a software release on the FTP site, and symlinks current.tgz to it
  7. 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