Managing Perl libraries across nodes
Standardizing modules across nodes
To standardize modules across nodes (and avoid the headache of having to update each node separately with new libraries), I am now including required perl modules with the WormBase software. This includes modules for both different versions of Perl and different architectures.
NOTE: Although this general approach works, dynamically modifying @INC (in say perl.startup) to include an architecture specific but private path doesn't work. Perl won't automatically cascade through child directories.
In addition, packlist is still installed in system paths, even when installing using PREFIX and LIB. This means that there can be a disconnect of what Perl things is currently installed if moving from private to public install libraries. e.g.
cpan> CGI cpan> CGI already up-to-date
(even though the system copy may not be)
Contents
Configuring the primary build environment
Brie3 acts as the primary staging environment. At the end of this configuration, we will be left with a new directory at /usr/local/wormbase/extlib containing all necessray Perl modules for a WormBase installation. This directory is automatically mirrored into the staging directory (/usr/local/wormbase-production), and from there distributed to production nodes as necessary.
The intial configuration of the system followed these steps:
Configure CPAN
The first time you launch CPAN, you will be prompted to configure it. Specially, we need to configure CPAN to install modules in our special WormBase directory.
$ perl -MCPAN -e shell (note: we do NOT need to be a privileged user) cpan> o conf init (only necessary if not prompted)
For the Makefile.PL arguments, enter
PREFIX=/usr/local/wormbase/extlib \ LIB=/usr/local/wormbase/extlib/lib \
TH - Note to self: It might be cleaner to just flatten this whole structure into a single directory using something like...
PREFIX=/usr/local/wormbase/extlib \ INSTALLPRIVLIB=... INSTALLSCRIPT=... INSTALLSITELIB=... INSTALLBIN=... INSTALLMAN1DIR=... INSTALLMAN3DIR=...
Or:
PREFIX=/usr/local/wormbase/extlib \ SITEPREFIX=/usr/local/wormbase/extlib\ VENDORPREFIX=/usr/local/wormbase/extlib \ PERLPREFIX=/usr/local/wormbase/extlib]
Initial module list
Some of the following commands may be redundant depending on module dependencies
Note: Some of these modules may be architecture-dependent. For the most part, most of the WormBase servers are i686. If you encounter problems with the included modules and you are working on a non i686 system, try installing these modules first. The site-specific module paths for your Perl will be searched first.
cpan> install Bundle::CPAN cpan> install IO::Compress::Gzip cpan> install LWP cpan> install CGI cpan> install CGI::Session cpan> install CGI::Cache cpan> install Cache::Cache cpan> install Cache::Filecache cpan> install SVG cpan> install GD <------ architecture dependent! cpan> install GD::SVG cpan> install Digest::MD5 cpan> install HTML::Parser cpan> install HTML::TokeParser cpan> install IO::Scalar cpan> install IO::String cpan> install Net::FTP cpan> install SOAP::Lite cpan> install Statistics::OLS cpan> install Storable cpan> install Text::Shellwords cpan> install WeakRef cpan> install MIME::Parser cpan> install XML::SAX cpan> install XML::Parser::Lite cpan> install SVG::Graph cpan> intsall XML::Writer cpan> install XML::Twig cpan> install Test::Pod cpan>install DBI cpan>install DBD::mysql
Install AcePerl
This can probably be done through CPAN but I prefer to install from source.
perl Makefile.PL `cat /usr/local/wormbase/conf/Makefile.params`
Build BioPerl
Install / update BioPerl:
cd /usr/local/wormbase-lib/bioperl-production perl Build.PL --install_base /usr/local/wormbase/extlib --install_path lib=/usr/local/wormbase/extlib ./Build ./Build install // Note: you DO NOT NEED root privileges.
Build GBrowse
Rebuild Gbrowse placing libraries into our extlib/.
perl Makefile.PL LIB=/usr/local/wormbase/extlib/lib/perl5/site_perl/5.8.8 \ CONF=/usr/local/wormbase/conf \ HTDOCS=/usr/local/wormbase/html \ CGIBIN=/usr/local/wormbase/cgi-perl/seq \ DO_XS=1
make make install
Adjust @INC
@INC needs to be adjusted so that wormbase can find the local copies of modules. We want to append the extlib path to our @INC using perl.startup. This allows us to easily override architecture-dependent modules on any of the nodes as necessary.
Preparing Nodes
To prepare individual production nodes:
It shouldn't be necessary to adjust your @INC, but it might be useful. You might also want to append
/usr/local/wormbase/extlib/bin
to your path.
Synchronizing libraries
Library syncrhonization is handled by two scripts.
1. Copy /usr/local/wormbase/extlib
to /usr/local/wormbase-production/extlib
This step is not automated to avoid accidentally pushing libraries to production nodes. Remember, wormbase-production is the rsync target for all of the nodes.
2. New libraries will automatically be synced onto the production nodes during the next update. If you want to push software/libraries onto the nodes before then, see [[Updating_software_on_production_nodes Updating software on production nodes].