Arusha Project
Sidai (policy)
Sidai how-to, etc.
 
How to..., etc.
User environment
Disk configuration
OS installs
HPUX11 install
Solaris install
Red Hat Linux install
post OS-install
Pre OS-reinstall
ARK boot
user accounts
Compiling/Linking
Distributing password files
Package proto-hosts
Logfile management
Log analysis
Scripting
Version wrapper
Version wrapper
Backups/archiving
Backups/tapeless: rationale
Backups/tapeless: design
Hostname change
Magic keystrokes
Booting tricks
Dead machine!
Root passwords
Removable media
ClearCase install
ClearCase admin
Logical Volume tricks
HP Mirror/UX
Mailman
VNC
 
Hosted by
SourceForge.net Logo

Sidai team: vwrapper -- `version wrapper' for user applications

The Sidai `vwrapper' allows multiple versions of a particular tool to coexist on the system and allows different users to use different version-sets transparently. This is handy for a number of situations:

  • Testing new versions of software before making them generally available;
  • to `lock' a project on particular versions of particular tools, to prevent nasty effects from the tools changing "under your feet".

So for instance, with coreBulder (from Synopsys' SRT hardware design package), you can do:

sli4523:/home/mholgate: coreBuilder --show-versions
Versions of coreBuilder available:
  2000_10_25
  2001_01_30
and
sli4523:/home/mholgate: coreBuilder --use-version=2000_10_25
and the correct version will be invoked. You might use this in a Makefile to ensure that every developer in a project uses the same set of tools.

You can have a $HOME/.wrapperrc file which specifies default versions of packages to use, which is more use when manually invoking tools:

synopsys-srt=2000_10_25
gcc=2.95.2
coreutils=5.2.1
There is also an equivalent site wide file.

Vwrapper it takes advantage of the fact that the Sidai Way of handling packages is to have a deployment directory with a name containing the version of the package eg:

/our/.-ark-deploy/synopsys-srt--2000_10_25
/our/.-ark-deploy/synopsys-srt--2001_01_30
It generates a wrapper for each executable which simply invokes the correct version of the real tool.

The actual code for the wrapper is in the sidai-vwrapper package, while the ark-vwrapped proto-package is used for packages that wish to use the wrapper. So for GNU `ls' (a silly example!), you might have the following packages:

coreutils--5.0.0
coreutils--5.2.1
which are standard ARK packages, but are only deployed and not revealed.

You would also have a

coreutils-wrapper
package, which would have ark-vwrapper as a prototype and would simply generate a wrapper script for all the binaries in coreutils (including `ls'). (See below). These would be revealed in place of the real binary.

So you would have:

/our/bin/gls (wrapper script from coreutils-wrapper package)
and
/our/.-ark-deploy/coreutils--5.0.0/bin/gls
/our/.-ark-deploy/coreutils--5.2.1/bin/gls
(real binaries from the coreutils--5.0.0 and coreutils--5.2.1 packages).


Sample generated `vwrapper':

#!/usr/bin/env python

# Autogenerated Sidai-style version wrapper for:
#   bin/gls
# in package:
#   coreutils
#

import sys
sys.path.append("/our/lib/sidai-vwrapper")
import wrapper

SYSADMIN = "matt@verilab.com"
DEPLOY_DIR = "/our/.-ark-deploy"
GLOBAL_CONF = "/our/lib/sidai-vwrapper/default-coreutils"
USER_CONF = "~/.wrapperrc"
EXECUTABLE = "bin/ls"
PACKAGE = "coreutils"

try:
    wrapper.wrap( sys.argv, EXECUTABLE, PACKAGE,
                  DEPLOY_DIR, GLOBAL_CONF, USER_CONF )

except wrapper.ExitSuccess, e:
    sys.exit( 0 )

except wrapper.ExitFailure, e:
    sys.stderr.write( '[wrapper]  %s\n' % e )
    sys.stderr.write( 'If you did not expect this error, please contact '
                    + SYSADMIN + '.\n' )
    sys.exit( 99 )


© The Arusha Project, 2000-2003; team: sidai; c/o partain@users.sourceforge.net; revision 1.10, 2004-05-26.