Subject: Newstar configuration management at NFRA
Author: Marco de Vos (CMV) and Henk Vosmeyer (HjV)
To: Newstar Support Team (HjV, CMV, JEN, JPH)

Date: 08/11/94

Revision history

Newstar configuration management at NFRA




General concerns

The Newstar package is not a static product. Major and minor changes are often being made to the software. These changes should affect the use of the package in a positive sense only. Therefore we need to guard the integrity of the package at NFRA and define clear procedures for external users on how to upgrade their implementation. This document describes those procedures.

This document is limited to configuration management on the Unix systems. The VAX system will be no longer supported at NFRA from 15/03/94, and can be maintained through the perl-scripts provided by WNB.

Reference to Newstar directories are made through the usual variables $n_src, $n_root etc. Refer to Appendix 2 for the details.

All commands assume one is logged in as the Newstar Master (newstar).



What makes up the Newstar configuration at NFRA

The Newstar configuration at NFRA consists of the following:



Relations between NFRA-Master and Export-Master

The dynamic relations between Master systems (either the NFRA Master or another one) and Export-Master are as follows:
+----------------------------------------------------------------------+
|  Master:                                                             |
|                 $n_src      <--------+                               |
|                   |                  | nup build -U (in $n_import)   |
|                   | nup build -U     |                               |
|                   v                  |                               |
|                 $n_exe, ... <--------+                               |
|                                      |                               |
|                 $n_import -->--------+                               |
|                  | ^   ^^                                            |
|                  | |   ||                                            |
|                  | |   || (NFRA only)                                |
|                  | |   |+--------------------+--<-- nsh in           |
|                  | |   |                     |                       |
+----------------------------------------------------------------------+
|  Export-Master:  | |   |                     |                       |
|                  | |   | nup retrieve ...    | (NFRA and others)     |
|                  | |   |  (NFRA only)        |                       |
|      nup release | |   |                     |                       |
|                  | | nup retrieve            |                       |
|                  v |   |                     |                       |
|                 $n_src |                     |                       |
|                 $n_import <------------------+                       |
|                                                                      |   
+----------------------------------------------------------------------+
Use of the "nup release" command is restricted to the NFRA-Master. Master systems outside NFRA use the "nup retrieve" command to get updated files from the Export-Master. The "nup update" command combines "nup retrieve" and "nup build -U".
The NFRA-Master uses the "nup retrieve -import ..." to get files from the Export-Master's $n_import (files checked in by programmers outside the NFRA).


Definition of revisions and releases

Every modification of files in the Master source tree results in a new revision, even if the modification does not involve changes in the executables. The procedure for merging modifications in the Master source tree is described in the next section.

A release is defined as a revision which involves one or more of the following items:

  1. A change of fileformats, so you will have to use the NVS (New Version) option in some programs
  2. A change in keyword syntax (so you will have to type different things or change batch files in some cases) other than an additional keyword for which the default can be used.
  3. Addition of a new program, or a major rewrite of an existing one.
The issue of a new release has to be decided upon by at least two members of the Newstar Project Team.

The updating of revision numbers is taken care of by the update script. Releases need to be explicitly indicated. The procedure for this is described in a later section.

The version number of the current Newstar configuration is given by the file $n_src/sys/version.idx

A full description of the current Newstar configuration is given by the file $n_src/sys/database.idx after the command "nup check d"

A user-oriented decription of the configuration is given in the file $n_src/doc/nnews.hlp which is shown by the command "nnews"

The version number of the Newstar executables is given by the command
"what $n_exe/*.exe | grep %NST%"



Checking-in modified files

When programmers (in or outside the NFRA) want to make a change in files in their Master source tree they have to use the "nsh in" command. This will ask (among other things) for a list of files to be checked in, for a comment and for the executables to be rebuilt (seprated by blanks).

When programmers check in their modified files, these files are copied into their local $n_import directory, together with a groupfile listing the files and executables. The same files are copied into the $n_import directory of the Export-Master. If the "nsh in" command is issued for (modified) files in a Master tree (presumably outside the NFRA), these files are not copied to the local $n_import. They are copied into the Export-Master. In all cases, a mail message describing the check-in is sent to $n_master (currently newstar@nfra.nl).

Testing should be completed before check-in! At the NFRA, an executable and/or ppd-file supplied by a programmer can at request be copied into $n_tst for testing by a broader user-group.




Merging modifications into the NFRA-Master source tree

When mail concerning a check-in is received, the following actions should be taken:

1e. If files originate from outside the NFRA, they should be received in $n_import of the NFRA-Master (more than one groupfile can be handled with a single update command):

  >>> nup retrieve -import updxxx.grp
Any file that has to be ftp'd with binary mode has to be retrieved separately.

2e. Perform some elementary checks:

If psc/pin/pef-files are changed, they should be checked against changes in keywords. If the meaning of existing keywords have been changed, the revision should be treated as a release (see the previous section).

If keywords have been removed from a psc file, it should be checked wether they have been removed from the programs as well. In such cases, special care should be taken that executables are being rebuilt synchroneously with the ppd-files. In general, removal of keywords is discouraged for revisions.

NOTE: The synchronisation of exe/ppd files is not optimal in the present structure for configuration management, but cannot be improved without structural changes in the coupling of exe and ppd files.

3e. Update libraries and executables for all architectures:

  >>>  nup build -Update  updxxx.grp                   (on rzmws0)
  >>>  nup build -Update  updxxx.grp                   (on rzmws5)
Any errors reported by the build command should be reported to and repaired by the programmer.

4e. At successful compilation, merge the files in the source tree:

  >>>  nup build -Update -T:none -Merge updxxx.grp     (on rzmws0)
The revision number will be automatically updated in version.idx.

The subject from the groupfile(s) is copied in the nnews.hlp file, and a message to be sent to local Friends of Newstar is composed (so enter useful information). Both files will be presented in the MicroEmacs editor (change buffers with ^X X command, exit with Esc Z). Comments concerning programmers only should be removed from nnews.hlp, or be prefixed by "System: ". This checking of nnews.hlp is very important since most users rely on this file for their information on changes. The message is kept in $n_import/message.RR.rr where RR is the new Release, rr the new revision of Newstar.

The message is not yet sent, this is done after the Export-Master has been updated.
This is done with the "nup release" command, discussed later. A mail is sent to $n_master to remind you of this revision after three days.



Special procedure in case a groupfile needs to be deleted

If a groupfile needs to be removed from the Master, it should be explicitly deleted using a command like
"rm $n_src/xxx/yyy.grp" followed by a reconstruction of the database with "nup check d".

At remote sides, the groupfile will be deleted automatically after the next update.




Special procedure for new releases

If a modification is to be interpreted as a release, the following special actions need to be taken:
  1. Check out file $n_src/sys/version.idx
  2. Increase the release number by hand, set the revision number to 1
  3. Check in file $n_src/sys/version.idx
  4. Update the resulting groupfile in the master:
  5. The file $n_root/updates.html should be edited to reflect the new release. An example how to do this should be taken from header of the previous release. It should be decided wether the old revision history should still be kept in this file. If not, the revision information should be replaced by the remark
             <EM>Revision history not recorded</EM><P>
    
    The description of previous releases should not be removed. Add a hypertext link to this release at the beginning of the file.


Merging changes into the Export-Master

After the changes have been active in Dwingeloo, they have to be made known to the outside world. This is typically done after three days (to remind you, the above mentioned at-job is scheduled).

The procedure to update the Export-Master is as follows:

  >>>   telnet wsrt00
  >>>   setenv n_remote rzmws0.nfra.nl newstar /newstar/master/src
  >>>   nup update
This will try to update the Westerbork installation from the NFRA-master. Any errors occurring here will almost certainly occur in other installtions as well, so they need to be repaired before the next step. Should you choose to make changes directly in the NFRA-Master, issue the following command at rzmws0 before trying to update wsrt00 again:
  >>>  nup check d
This will make a fresh version of the database. Once installation on wsrt00 is successfull, give the following command at rzmws0:
  >>>  nup release
This will rebuild the documentation, create a fresh database, pack all sources, libraries and executables and send them over to the Export-Master. It also tells the server program that files are waiting to be unpacked. Once this has been done, the message will be sent. In case more than one release has been pending, a fresh message for the most recent revision will be composed, containing all the subjects from previous revisions. The message will be sent to the Friends of Newstar. This relies on an elm alias friends_of_newstar.


Maintenance of server programs for the Export-Master

The server programs for the Export-Master are maintained outside the normal Newstar routine. All sources (programs, scripts and text-files) have to be in /users/newstar/src/. They have to be compiled or put in their proper place by executing the "make" command in that directory. A "make" should be done after any change in files in /users/newstar/src. Refer to file /users/newstar/src/Makefile for details about requirements for server programs.


Maintenance of the locking database

The locking database is there mainly for administrative purposes. It warns users who check out a locked file, but still makes a copy for them. However, it will prohibit checking in locked files. Since users sometimes just delete files without unlocking them, the lock-file will get polluted. Therefore the weekly routine includes cleaning up of this file.



Weekly routines for the Newstar Master copy at NFRA

Backups are made each Thursday afternoon or Friday morning. The procedure for backups is:
  >>>   nup check d  
This will build a fresh version of file database.idx The database will be updated for any direct changes in the Master (that is: without proper checkin through $n_import).
  >>>   nup save
This will make a backup of the entire master tree (all files below $n_root). Three DAT tapes are used for the backups (cyclic use of Newstar_A, Newstar_B and Newstar_C). The save command will run in the background and notify by mail when it is ready.

The two most recent backups are stored at the Bank of Dwingeloo. Backups of the Export-Master are made as part of the Scissor backup routine.

After the backup, the following command should be entered:

  >>>   rm $n_exe/*.old $n_tst/*.old
This will throw away old versions, which can be restored from the backup tape if necessary.
  >>>   nup clear -Confirm
This will remove any obsolete files from the Master copy. See above for the deletion of obsolete groupfiles. Removing a file from a groupfile will cause a prompt for deletion here. In such cases, check wether the file has become really obsolete (e.g. by using a grep on the subroutine name). If the file has been accidentally removed from a groupfile, check out the groupfile, re-insert the file, check-in the groupfile and make a maintenance revision.
  >>>   nup check  l        (on rzmws0)
  >>>   nup check  l        (on rzmws5)
This will check the current libraries. If faults are reported, the libraries should be updated through the groupfile produced by the check command (instructions are given by the command). The name of the groupfile will be libyymmdd${n_arch}.grp.



Appendix 1: Terminology

Site:
on or more computers that share a (Network) File System
Master-systeem:
the officially installed Newstar version on a site
NFRA-Master:
the master system at the Unix network of the NFRA,
Export-Master:
the (sources-only) master system at the Unix network of the NFRA, distribution is done from this master.
User-systeem:
a (partial) version of Newstar that is made by a user/ programmer based on the Master-system. When starting an executable, a version in the user-system has priority over the Master.
Binary-tree:
a directory tree in a Master or User system containing the executable files needed to run Newstar (NB: you also need the startup scripts in $n_src/sys).
Source-tree:
a directory tree in a Master or User system containing only all files needed to install a binary tree (excluding the operating system and compilers...).
Library-tree:
a directory tree in a Master or User system with libraries and (for a User system) object files; one directory in the library tree contains include files and system independent pre-processed files, all derived from the source tree.
Work-directory:
a directory for temporary files, for listingss and for files needed for the debugger.

The Master system has two binary trees:

Executable files are looked for in the current directory first, then in $n_uexe (if it exists) and finally in $n_exe.

A user may decide to do "setenv n_uexe $n_tst" to get access to test versions, and programmers will set $n_uexe to the binary tree of their user system.



Appendix 2: Directory trees

Master (NFRA or elsewhere):
---------------------------

$n_root -+-- src           = $n_src       Source tree 
         |
         +-- lib -+-- inc  = $n_inc       Precompiled files 
         |        +-- sun  = $n_lib       Object libraries
         |        +-- hp
         |
         +-- exe -+-- sun  = $n_exe       Executables and ppd-files 
         |        +-- hp
         |        |
         |        +-- html = $n_hlp       Hypertext help files (elsewhere)
         |
         +-- hlp           = $n_hlp       Hypertext help files (at NFRA)
         |
         +-- tst -+-- sun  = $n_tst       Test versions
         |        +-- hp
         |
         +-- work -+-- sun = $n_work      Intermediate files, files
         |         +-- hp                 necessary for debugging
         |
         +-- import        = $n_import    Import area for uploading of
                                          revisions and programmers files.

Sites outside NFRA can have other architectures in $n_lib and $n_exe. 
At most sites outside NFRA $n_hlp is a subdirectory of $n_root/exe.

This structure can be split over various filesystems. The tree can than
be realised through symbolic links. Since all system commands use the
environment variables this is not strictly necessary.
		    
Additional directories at NFRA only:          

         |
         +-- mongo                        Installation of mongo
         +-- perl                         Executables for perl
         +-- rmtd                         Sources for rmtd (VAX)

Possible files in $n_root:  backups.txt  Log of backups
                            updates.log  Log of update-commands
                            updates.html Revision history (NFRA only)

Source tree:

   $n_src  -+-- sys                       Maintenance system
            |
            +-- doc -+- ...               Documents
            |
            +-- wng                       Precompiler, files, I/O etc.
            +-- dwarf                     Parameter interface
            +-- n*                        The various programs
            | 
            +-- data                      Calibrator models
            | 
            +-- batch                     Standard batch procedures

Possible files in $n_src:  upd*.log      Compilation logs


User system:
------------

~programmer +... $n_uroot -+-- lib -+-- inc = $n_uinc
            :              |        +-- sun = $n_ulib
            :              |
                           +-- exe -+-- sun = $n_uexe
                           |
                           +-- work         = $n_work
                           |
                   [       +-- src          = $n_usrc  ]
            :
            +...                     Arbitrary directories with files
                                          modified by the programmer.


Logging in as the owner of $n_root (Newstar manager) causes $n_u... 
to point to $n_..., $n_work will point to $n_root/work/$n_arch. 
If the Newstar manager uses the -NUpdate switch for update, $n_uexe
will be set to $n_tst, else it will be at $n_exe.

It is confusing that there is no $n_uwork, this departure from the 
general practice may be removed in future.


Export Master (NFRA only, at ftp.nfra.nl):
------------------------------------------

/users/ftp/newstar          = $n_root     Newstar ftp area
/users/www/newstar          = $n_www      Newstar www area
/users/newstar                            Newstar server programs

$n_root -+-- src            = $n_src      Source tree 
         |
         +-- import         = $n_import   Import area for uploading of
                                           revisions and programmers files
                                           (also from non-NFRA sites).

Files in $n_root: 
   nstar_src.tar.Z                        Archive with sources
   nstar_src_??.tar                       Archive with additional sources
                                          for various architectures
   nstar_hlp.tar.Z                        Archive with documentation
   nstar_exe_??.tar.Z                     Archive with executables for
                                          various architectures
   nstar_lib_??.tar.Z                     Archive with libraries for
                                          various architectures
   nstar_lib_inc.tar.Z                    Archive with include files
   


$n_www  -+-- hlp                          Documentation (from nstar_hlp.tar)
         |
         +-- bug                          User Feedback System
         |
         +-- bin            = $n_cgi      httpd scripts for Newstar
         |                                  (sources in /users/newstar/src)
         |
         +-- mail                         Link to Newstar mail area for HjV

Files in $n_www:
   homepage.html                          Homepage for the server area,
                                          different from hlp/homepage.html
   index.html                             Link to homepage.html, you get this
                                          for http://www.nfra.nl/newstar/
   example.*                              Some sample images
   updates.html                           Revision history (from NFRA master)


/users/newstar -+-- src                   Server programs (sources)
                +-- bin     = $n_bin      Server programs (executables)



Appendix 3: Other programs and procedures related to Newstar

Mails concerning Newstar

A copy of all E-mail correspondention between the different members of the Newstar group should always be send to HjV (hjvosmeijer@nfra.nl). He will extract those documents and put them in his Newstar mail directory (~hjv/public_html/newstar/mail). A printed version of the documents will be put in a special binder which will be kept in HjV's room.
Every working-day at 07.00 AM a script will create an updated HTML file (mail.html) which gives everyone the possibility to read the mails and search for keywords using Mosaic.

Newstar use

On every site where Newstar is installed, the programs will write an entry (with username, programname, date a.s.o.) in the file $n_import/newstar.use. During an update of a site, this file is ftp'ed to NFRA (/users/ftp/pub/incoming) and a new (empty) version is created on the updating site.
At NFRA every working-day at 07.00 AM a script will take care for moving those new files to ~hjv/newstar/use, compressing the files and merge them with the already existing files per site, create quarterly and monthly reports. The script will also update an HTML file (use.html) which which gives everyone the possibility to view those reports by using Mosaic.