SEE-GRID ESM Software Installation Guide
From EGEE-see WIki
This page is OBSOLETE! Please go to Software Installation Management Guide!
--Bmarovic 19:06, 7 Sep 2005 (EEST)
Contents |
Site Configuration
Make sure that your site has valid SEEGRID VO certificates and uses SEEGRID VOMS with user certificates. Also check
SG Using file replicas and RFIO: UI configuration, rfiod, usage in apps, limitations and workarounds.
Setting up shared application software filesystem
It is agreed that all SEEGRID sites should set up a file system shared among all WNs of the same cluster. The jobs that want to use the installed software just need to use the VO_SEEGRID_SW_DIR environment variable in order to access it.
To create a shared directory on your do the following, preferably on your storage element:
mkdir /opt/exp_soft/seegrid chown seegridsgm.seegrid /opt/exp_soft/seegrid chmod 755 /opt/exp_soft/seegrid
add a line to /etc/exports:
/opt/exp_soft/seegrid *.<YourDomain>(rw,no_root_squash)
Execute
$ exportfs -rv
on all WNs a line to /etc/fstab:
<YourStorageElement>:/opt/exp_soft/seegrid /opt/exp_soft/seegrid nfs hard,intr,nodev,nosuid 0 0
Create the mountpoint for /opt/exp_soft/seegrid, and mount new filesystem:
mkdir /opt/exp_soft/seegrid chown seegridsgm.seegrid /opt/exp_soft/seegrid mount -av
Finally, set VO_SEEGRID_SW_DIR to /opt/exp_soft/seegrid in site-info.def and reconfigure all WNs. This will update /etc/profile.d/lcgenv.csh and /etc/profile.d/lcgenv.sh.
Publishing of software tags
The tags of published software are managed using lcg-ManageVOTag. Tags published on your site can be checked using
lcg-ManageVOTag -host <Target-CE-machine> -vo seegrid --list
It a good idea to check and, if needed, set permissions of seegrid.list on your CE. Its initial content may be left empty.
$ ls -ld /opt/edg/var/info/seegrid/ /opt/edg/var/info/seegrid/seegrid.list drwxr-xr-x 2 seegridsgm seegrid 4096 Apr 12 2005 /opt/edg/var/info/seegrid/ -rw-r--r-- 1 seegridsgm seegrid 24 Jan 13 13:55 /opt/edg/var/info/seegrid/seegrid.list
Software Installation Management
First of all, read
https://edms.cern.ch/file/454439/2/LCG-2-UserGuide.html#SECTION000144000000000000000 http://goc.grid.sinica.edu.tw/gocwiki/Experiments_Software_Installation
Request /seegrid/sgmadmin role from SEEGRID VOMS administrator.
Prepare your JDL and shell scripts for installation, validation, and uninstallation. Prepare and publish installation tarball(s). You may choose to submit only a script with the job, especially if the installation tarball is large, and then use wget or lcg-cp. To do so, you need to publish your tarball on the web or to place on a SE using lcg-cr.
Login using:
voms-proxy-init -voms seegrid:/seegrid/Role=sgmadmin
Manage your installation jobs to SEEGRID sites using edg-job-submit. Instead of using lcg-asis, we recomend dymanic creation of JDL by job submission scripts, whicg place proper
Requirements = other.GlueCEUniqueID == "<Target-CE>:2119/jobmanager-lcgpbs-seegrid"
in install JDL. Another option for target CE selection is using -r option of edg-job-submit. The usage of -r is problematic if "edg-brokerinfo getCE" is used in the install script, since the chosen CE will not be properly set in job's .brokerinfo file.
Also note that "--notify" option of lcg-ManageSoftware does not seem to work, and that in validation "--validate_script validate_sw" is required.
lcg-ManageVOTag is also useful in clearing of published tags, especially during development of your installation scripts:
lcg-ManageVOTag -host <Target-CE> -vo seegrid --remove -tag VO-seegrid-vive-0.2-aborted-validate
Example Scripts
Installation
site_VIVE_install scipt dynamically creates JDL and submits the installation job using CE given on invocation as a parameter, thus avoiding "edg-job-submit -r" .brokerinfo problem:
#!/bin/bash
#args: CE
echo VIVE install Startup $*
CE=$1
VER=`cat /storage/VIVE/programs/version_VIVE`
# do not use "edg-job-submit -r" because of ./BrokerInfo
cat > site_VIVE_install_tmp.jdl <<EOF
Executable = "/opt/lcg/bin/lcg-ManageSoftware";
InputSandbox = {"/storage/VIVE/programs/install_sw"};
OutputSandbox={"out", "err"};
StdOutput="out";
StdError="err";
Requirements = other.GlueCEUniqueID == "$CE" \
&& !Member("VO-seegrid-vive-$VER",other.GlueHostApplicationSoftwareRunTimeEnvironment) \
&& !Member("VO-seegrid-vive-$VER-to-be-validated",other.GlueHostApplicationSoftwareRunTimeEnvironment) \
&& !Member("VO-seegrid-vive-$VER-processing-validate",other.GlueHostApplicationSoftwareRunTimeEnvironment) \
&& !Member("VO-seegrid-vive-$VER-processing-install",other.GlueHostApplicationSoftwareRunTimeEnvironment) \
&& !Member("VO-seegrid-vive-$VER-aborted-validate",other.GlueHostApplicationSoftwareRunTimeEnvironment) \
&& !Member("VO-seegrid-vive-$VER-aborted-install",other.GlueHostApplicationSoftwareRunTimeEnvironment);
Arguments = "--install --vo seegrid --tag vive-$VER --notify Branko.Marovic@rcub.bg.ac.yu";
VirtualOrganisation="seegrid";
RetryCount=0;
EOF
edg-job-list-match site_VIVE_install_tmp.jdl
edg-job-submit site_VIVE_install_tmp.jdl
#cat site_VIVE_install_tmp.jdl
rm -f site_VIVE_install_tmp.jdl
install_sw:
#!/bin/bash
#required
# voms-proxy-init -voms seegrid:/seegrid/Role=sgmadmin
#check tags with
# lcg-infosites --vo seegrid tag
# lcg-info --vo seegrid --list-ce --attrs Tag --query 'Tag=*VO-seegrid-vive*'
# lcg-ManageVOTag -host <Target-CE> -vo seegrid --list
#manage with
# yes yes | lcg-ManageVOTag -vo seegrid --remove -tag VO-seegrid-vive-0.3.2-aborted-validate -host Target-CE
export VER=0.3.2
echo "############ starting install_sw $VER ############"
echo "Running on: $HOSTNAME(`hostname -i`) as `whoami`"
echo Belonging to CE: `$EDG_LOCATION/bin/edg-brokerinfo getCE`
if [ x$VO_SEEGRID_SW_DIR = 'x' ]; then #failure?
echo "VO_SEEGRID_SW_DIR is not set in the environment"
echo "############ ending install_sw $VER returning 1 ############"
exit 1
fi
if [ $VO_SEEGRID_SW_DIR = '.' ]; then #failure?
echo "The site does not provide a shared file system: VO_SEEGRID_SW_DIR=$VO_SEEGRID_SW_DIR"
echo "############ ending install_sw $VER returning 1 ############"
exit 1
fi
if [ ! X`whoami` = 'Xseegridsgm' ]; then #failure?
echo "invalid username" `whoami`
echo "############ ending install_sw $VER returning 1 ############"
exit 1
fi
export TAR_LOC=`pwd` #this is the temporary directory where is
#supposed to be the steering script and the tarballs
#this also tests outbound access to VIVE portal
wget http://grid02.rcub.bg.ac.yu/VIVE/seegrid-vive-$VER.tar.gz
#in this case the script doesn't need tarball from the grid but
#it fetches from the WEB requiring OUTBOUND connectivity
#it is needed anyway for VIVE software to run
cd $VO_SEEGRID_SW_DIR #go to software installation root directory
pwd
ls -al #and check its content
#remove previously created junk caused by uninstall
#this is related to undocumented lcg-ManageSoftware behavior
rm -r -f seegrid-vive-0.1*_tmp
rm -r -f seegrid-vive-0.2*_tmp
rm -r -f seegrid-vive-0.3_tmp
rm -r -f seegrid-vive-0.3.1_tmp
rm -f seegrid.*
rm -r -f -v vive-$VER #remove only the current version of the software
#for initial development and testing only:
#remove previously created installation attempts
#this also destroys valid old software versions which we may want to preserve
echo "#cleaning $VO_SEEGRID_SW_DIR"
rm -r -f vive-_tmp
rm -r -f vive-0.1*
rm -r -f vive-0.2*
#cannot rm -r -f vive-0.3* because of seegrid-vive-$VER_tmp
rm -r -f vive-0.3
rm -r -f vive-0.3.1*
rm -r -f vive-$VER
ls -al #and check its content
mkdir vive-$VER
if [ ! $? = 0 ]; then #failure?
echo "Directory vive-$VER already exists in" `pwd`
echo "############ ending install_sw $VER returning 1 ############"
exit 1
fi
cd vive-$VER #create installation directory
echo "Installing into" `pwd`
echo "running the command: tar xzvf $TAR_LOC/seegrid-vive-$VER.tar.gz"
tar xzvf $TAR_LOC/seegrid-vive-$VER.tar.gz
if [ ! $? = 0 ]; then #failure?
echo "Failure unpacking $TAR_LOC/seegrid-vive-$VER.tar.gz"
echo "############ ending install_sw $VER returning 1 ############"
exit 1
fi
echo "Installation into " `pwd` " finished"
ls -al #list what has been installed
echo "############ ending install_sw $VER returning $? ############"
exit $? #This is the relevant return code
Validation
site_VIVE_validate:
#!/bin/bash
#args: CE
echo VIVE validate Startup $*
CE=$1
VER=`cat /storage/VIVE/programs/version_VIVE`
# do not use "edg-job-submit -r" because of ./BrokerInfo
cat > site_VIVE_validate_tmp.jdl <<EOF
Executable = "/opt/lcg/bin/lcg-ManageSoftware";
InputSandbox = {"/storage/VIVE/programs/validate_sw"};
OutputSandbox = {"out", "err"};
StdOutput="out";
StdError="err";
#InputData = {"lfn:/grid/seegrid/VIVE/PACSimages/seegrid/SoftwareValidation.CSFE"};
#DataAccessProtocol={"rfio","gsidcap"};
Requirements = other.GlueCEUniqueID == "$CE" && (Member("VO-seegrid-vive-$VER-to-be-validated",other.GlueHostApplicationSoftwareRunTimeEnvironment));
Arguments = "--validate --vo seegrid --tag vive-$VER --notify Branko.Marovic@rcub.bg.ac.yu --validate_script validate_sw";
RetryCount=0;
VirtualOrganisation="seegrid";
EOF
edg-job-list-match site_VIVE_validate_tmp.jdl
edg-job-submit site_VIVE_validate_tmp.jdl
rm -f site_VIVE_validate_tmp.jdl
validate_sw:
#!/bin/bash #see the comments at the beginning of install_sw export VER=0.3.2 #set up LFC/GFAL environment export LFC_HOST=grid02.rcub.bg.ac.yu export LCG_CATALOG_TYPE=lfc export LCG_GFAL_VO=seegrid export CE=`$EDG_LOCATION/bin/edg-brokerinfo getCE` echo "############ starting validate_sw $VER ############" echo "# VO_SEEGRID_SW_DIR (e.g. /opt/exp_soft/seegridi) should be writable only by seegridsgm user" echo "# and only seegridsgm should be able to manage published application tags" echo "Running job $EDG_WL_JOBID on: $HOSTNAME(`hostname -i`) as `whoami`" echo "VO_SEEGRID_SW_DIR (e.g. /opt/exp_soft/seegrid) should be writable only by seegridsgm user" echo " and only seegridsgm should be able to manage published application tags" echo "VO_SEEGRID_SW_DIR is $VO_SEEGRID_SW_DIR" echo Belonging to CE: $CE echo Close SE is $VO_SEEGRID_DEFAULT_SE if [ x$VO_SEEGRID_SW_DIR = 'x' ]; then #failure? echo "VO_SEEGRID_SW_DIR is not set in the environment" echo "############ ending validate_sw $VER returning 1 ############" exit 1 fi if [ $VO_SEEGRID_SW_DIR = '.' ]; then #failure? echo "The site does not provide a shared file system: VO_SEEGRID_SW_DIR=$VO_SEEGRID_SW_DIR" echo "############ ending validate_sw $VER returning 1 ############" exit 1 fi #useful in diagnosing sites that do not pass the validation echo "### Checking lcg-cp" lcg-cp --vo seegrid -v lfn:/grid/seegrid/VIVE/PACSimages/seegrid/SoftwareValidation.CSFE file:`pwd`/SoftwareValidation.CSFE if [ ! $? = 0 ]; then #failure? echo "Command lcg-cp does not work, suspicious but not required" fi ls -ld `pwd` ls -al rm -f `pwd`/SoftwareValidation.CSFE cd $VO_SEEGRID_SW_DIR #software installation root directory echo "### Listing `pwd`" ls -alt cd vive-$VER if [ ! $? = 0 ]; then #failure? echo "Directory vive-$VER does not exists in" `pwd` echo "############ ending validate_sw $VER returning $? ############" exit 1 fi echo "### Checking FieldServer operation" echo "# This starts a server process that loads a file from the closeSE using RFIO" echo "# based on the information from SEEGRID LFC, then connects to TCP port 443 on" echo "# grid02.rcub.bg.ac.yu and, if OK, exits returning 113" ./FieldServer $CE "$HOSTNAME(`hostname -i`)" \ p grid02.rcub.bg.ac.yu 443 grid02.rcub.bg.ac.yu ANY \ . /VIVE-cache3D . . 300000000 0 SoftwareValidation@seegrid if [ $? = 113 ]; then echo "Dataset load and binder connectivity test passed, installation validated" echo "############ ending validate_sw $VER returning 0 ############" exit 0 fi echo "FieldServer returned $?" echo "Validation failed" echo "############ ending validate_sw $VER returning 255 ############" exit 255
Removal
uninstall-vive.jdl:
Executable = "/opt/lcg/bin/lcg-ManageSoftware";
InputSandbox = {"/storage/programs/VIVE/uninstall_sw"};
OutputSandbox = {"out", "err"};
stdoutput = "out";
stderror = "err";
Arguments = "--uninstall --vo seegrid --tag seegrid-vive-0.2 --uninstall_script uninstall_sw";
Requirements = (Member("VO-seegrid-vive-0.2",other.GlueHostApplicationSoftwareRunTimeEnvironment) \
&& (other.GlueCEUniqueID == "<Target-CE>:2119/jobmanager-lcgpbs-seegrid))";
VirtualOrganisation="seegrid";
uninstall_sw:
#!/bin/bash #see the comments at the beginning of install_sw export VER=0.2 echo "############ starting uninstall_sw $VER ############" echo "Running on: $HOSTNAME(`hostname -i`) as `whoami`" echo Belonging to CE: `$EDG_LOCATION/bin/edg-brokerinfo getCE` if [ x$VO_SEEGRID_SW_DIR = 'x' ]; then #failure? echo "VO_SEEGRID_SW_DIR is not set in the environment" echo "############ ending uninstall_sw $VER returning 1 ############" exit 1 fi if [ $VO_SEEGRID_SW_DIR = '.' ]; then #failure? echo "The site does not provide a shared file system: VO_SEEGRID_SW_DIR=$VO_SEEGRID_SW_DIR" echo "############ ending uninstall_sw $VER returning 1 ############" exit 1 fi cd $VO_SEEGRID_SW_DIR #go to software installation root directory ls -al #and check its content rm -f -v -r vive-$VER #remove only the current version of the software if [ ! $? = 0 ]; then #failure? echo "Removal of vive-$VER from" `pwd` "failed" echo "############ ending uninstall_sw $VER returning $? ############" exit 1 fi echo "Removal of vive-$VER from" `pwd` "finished" echo "############ ending uninstall_sw $VER returning $? ############" exit 0 # This is the relevant return code
