Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:53

0001 #!/bin/sh
0002 
0003 # deployment-specific params
0004 BASEDIR=@root
0005 RELEASE=@release
0006 ARCH=@arch
0007 RELEASEDIR=@cmsswroot/${RELEASE}
0008 
0009 # command params
0010 OPTIND=1
0011 
0012 JOBNAME=""
0013 
0014 while getopts "h?s:j:" opt; do
0015     case $opt in
0016     h|\?)
0017         echo "Mo' to spiego..."
0018         exit 0
0019         ;;
0020     j)  JOBNAME=$OPTARG
0021         ;;
0022     esac
0023 done
0024 
0025 shift $((OPTIND-1))
0026 
0027 [ "$1" = "--" ] && shift
0028 
0029 # o2o specific params
0030 LOGFILE=${BASEDIR}/logs/$JOBNAME.log
0031 JOBDIR=${BASEDIR}/${JOBNAME}
0032 DATE=`date`
0033 
0034 # functions
0035 function logRun(){
0036     echo "----- new job started for $1 at -----" | tee -a $LOGFILE
0037     echo $DATE | tee -a $LOGFILE
0038 }
0039 
0040 function log() {
0041     echo "[`date`] : $@ " | tee -a $LOGFILE
0042 }
0043 
0044 function submit_command() {
0045     logRun $1
0046     o2o run -n $1 "$2" | tee -a $LOGFILE
0047 }
0048 
0049 function submit_test_command() {
0050     logRun $1
0051     o2o --db dev run -n $1 "$2" | tee -a $LOGFILE
0052 }
0053 
0054 function submit_cmsRun() {
0055     COMMAND="cmsRun $2 destinationDatabase={db} destinationTag={tag}"
0056     logRun $1
0057     o2o run -n $1 "$COMMAND" | tee -a $LOGFILE
0058 }
0059 
0060 function submit_test_cmsRun() {
0061     COMMAND="cmsRun $2 destinationDatabase={db} destinationTag={tag}"
0062     logRun $1
0063     o2o --db dev run -n $1 "$COMMAND" | tee -a $LOGFILE
0064 }
0065 
0066 function submit_popCon() {
0067     COMMAND="popconRun $2 -d {db} -t {tag} -c"
0068     logRun $1
0069     o2o run -n $1 "$COMMAND"  | tee -a $LOGFILE
0070 }
0071 
0072 function submit_test_popCon() {
0073     COMMAND="popconRun $2 -d {db} -t {tag} -c"
0074     logRun $1
0075     o2o --db dev run -n $1 "$COMMAND"  | tee -a $LOGFILE
0076 }
0077 
0078 # global variables
0079 export PYTHON_EGG_CACHE=@localhome
0080 export SCRAM_ARCH=$ARCH
0081 export O2O_LOG_FOLDER=@root/logs/${JOBNAME}
0082 export COND_AUTH_PATH=$BASEDIR
0083 source @cmsswroot/cmsset_default.sh
0084 
0085 cd ${RELEASEDIR}/src
0086 eval `scramv1  run -sh`
0087 # set up OCCI workaround
0088 export LD_PRELOAD=$CMS_ORACLEOCCI_LIB
0089 
0090 # workaround for oracle tnsnames
0091 export TNS_ADMIN=@extroot/oracle-env/29/etc
0092 
0093 cd ${JOBDIR}
0094 
0095