TNS Internal:NDR/PushToServers
From NSDLWiki
Contents[hide] |
NDR Pushing Code to Servers
The following describes the process for updating repository.war for NDR. You can find more information on Puppet at...
- Systems - Puppet (explains svn layout, how it works and how to disable it)
- Developing with Puppet (tailored to development)
Regular Maintenance Window for Production
Tuesday and Thursday mornings are the official maintenance policy windows. Often, minor changes that shouldn't disrupt anything are made outside of these windows.
Replacing an Existing Version
For both Production and Testing, the process for replacing an existing version of a file is the same. Check in the new war file for the version to the appropriate version location in production puppet. In the following example, version 1.4 exists and the repository.war file for version 1.4 is being updated.
Production: https://svn.nsdl.org/puppet/trunk/production/modules/ndr/files/1.4/repository.war Testing: https://svn.nsdl.org/puppet/trunk/testing/modules/ndr/files/1.4/repository.war
New Version
Create New Directory Structure
Files are stored in puppet in directories representing the version of the file. If you the file being checked in is a new version, you will need to create a new directory to hold the new version. For example, if 1.4 exists and you are creating a new version 1.4.1, you will create the following directories in Production and Test.
Production: https://svn.nsdl.org/puppet/trunk/production/modules/ndr/files/1.4.1 https://svn.nsdl.org/puppet/trunk/production/modules/ndr/templates/1.4.1 Testing: https://svn.nsdl.org/puppet/trunk/testing/modules/ndr/files/1.4.1 https://svn.nsdl.org/puppet/trunk/testing/modules/ndr/templates/1.4.1
Copy Files from Previous Version
There are other files that most likely weren't changed that need to be part of the new version. These directories and files can be copied from the old version to the new version's directory.
Example for testing:
Copy From: https://svn.nsdl.org/puppet/trunk/testing/modules/ndr/files/1.4/* To: https://svn.nsdl.org/puppet/trunk/testing/modules/ndr/files/1.4.1/*
Copy From: https://svn.nsdl.org/puppet/trunk/testing/modules/ndr/templates/1.4/* To: https://svn.nsdl.org/puppet/trunk/testing/modules/ndr/templates/1.4.1/*
Replace Previous Version war File with New Version war File
Copy the new version of the war file into the directory you created in the previous step.
Example:
Copy From: repository/trunk/dist/repository.war To: https://svn.nsdl.org/puppet/trunk/testing/modules/ndr/files/1.4.1/repository.war
Check in New Version of War File
Then you check the new 1.4.1 version into this directory location in puppet...
Production: https://svn.nsdl.org/puppet/trunk/production/modules/ndr/files/1.4.1/repository.war Testing: https://svn.nsdl.org/puppet/trunk/testing/modules/ndr/files/1.4.1/repository.war
Update the Node Manifest
Testing
The node manifests for all servers needs to be updated to deploy the new version.
For testing, see the list of servers at NDR Leader-Follower Status -- Testing. In certain testing scenarios, it is possible that you wouldn't update both nodes, but that is uncommon.
For example, if one of the servers is repo1.nsdlib.org, then the file to update is...
https://svn.nsdl.org/puppet/trunk/manifests/nodes/repo1.nsdlib.org.pp
Assuming a version change from 1.4 to 1.4.1, in the above file, change:
From: ndr { "ndr": owner => fedorad, group => fedorad, version => "1.4", tomcat_version => "6.0.24", } To: ndr { "ndr": owner => fedorad, group => fedorad, version => "1.4.1", tomcat_version => "6.0.24", }
Make the same change to files corresponding to the other test servers.
When you commit a change to the testing tree, Puppet and the test servers will automatically pick up the change and update in 10 minutes or less.
Production
The node manifests for all servers needs to be updated to deploy the new version.
For production, see the list of servers at NDR Leader-Follower Status -- Production.
For example, if one of the servers is repo2.nsdl.org, then the file to update is...
https://svn.nsdl.org/puppet/trunk/manifests/nodes/repo2.nsdlib.org.pp
Assuming a version change from 1.4 to 1.4.1, in the above file, change:
From: ndr { "ndr": owner => fedorad, group => fedorad, version => "1.4", tomcat_version => "6.0.24", } To: ndr { "ndr": owner => fedorad, group => fedorad, version => "1.4.1", tomcat_version => "6.0.24", }
Make the same change to files corresponding to the other production servers. All production servers must be updated to the same war file, so be sure to update all the node manifests for all production servers. You may also want to make sure the test servers are up to date, but be sure you aren't replacing someone else's test war file that is actively being tested.
When you commit a change to the production tree, notify systems staff. The production servers currently have to be updated manually.