Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #!/bin/sh
0002 
0003 # deployment-specific params
0004 BASEDIR=/data/O2O
0005 RELEASE=CMSSW_10_0_5
0006 RELEASEDIR=/cvmfs/cms.cern.ch/slc6_amd64_gcc630/cms/cmssw/${RELEASE}
0007 
0008 # command params
0009 OPTIND=1
0010 
0011 SUBSYS=""
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     s)  SUBSYS=$OPTARG
0021         ;;
0022     j)  JOBNAME=$OPTARG
0023         ;;
0024     esac
0025 done
0026 
0027 shift $((OPTIND-1))
0028 
0029 [ "$1" = "--" ] && shift
0030 
0031 O2ONAME=$SUBSYS$JOBNAME
0032 #echo "name=$O2ONAME, subsystem=$SUBSYS, job=$JOBNAME"
0033 
0034 # o2o specific params
0035 LOGFILE=${BASEDIR}/logs/$O2ONAME.log
0036 JOBDIR=${BASEDIR}/${SUBSYS}/${JOBNAME}
0037 DATE=`date`
0038 
0039 # functions
0040 function logRun(){
0041     echo "----- new job started for $1 at -----" | tee -a $LOGFILE
0042     echo $DATE | tee -a $LOGFILE
0043 }
0044 
0045 function log() {
0046     echo "[`date`] : $@ " | tee -a $LOGFILE
0047 }
0048 
0049 function submit_command() {
0050     logRun $1
0051     o2o run -n $1 "$2" | tee -a $LOGFILE
0052 }
0053 
0054 function submit_test_command() {
0055     logRun $1
0056     o2o --db dev run -n $1 "$2" | tee -a $LOGFILE
0057 }
0058 
0059 function submit_cmsRun() {
0060     COMMAND="cmsRun $2 destinationDatabase={db} destinationTag={tag}"
0061     logRun $1
0062     o2o run -n $1 "$COMMAND" | tee -a $LOGFILE
0063 }
0064 
0065 function submit_test_cmsRun() {
0066     COMMAND="cmsRun $2 destinationDatabase={db} destinationTag={tag}"
0067     logRun $1
0068     o2o --db dev run -n $1 "$COMMAND" | tee -a $LOGFILE
0069 }
0070 
0071 function submit_popCon() {
0072     COMMAND="popconRun $2 -d {db} -t {tag} -c"
0073     logRun $1
0074     o2o run -n $1 "$COMMAND"  | tee -a $LOGFILE
0075 }
0076 
0077 function submit_test_popCon() {
0078     COMMAND="popconRun $2 -d {db} -t {tag} -c"
0079     logRun $1
0080     o2o --db dev run -n $1 "$COMMAND"  | tee -a $LOGFILE
0081 }
0082 
0083 # global variables
0084 export PYTHON_EGG_CACHE=/data/condbpro
0085 export SCRAM_ARCH=slc6_amd64_gcc630
0086 export O2O_LOG_FOLDER=/data/O2O/logs/${O2ONAME}
0087 export COND_AUTH_PATH=$BASEDIR
0088 source /cvmfs/cms.cern.ch/cmsset_default.sh
0089 
0090 cd ${RELEASEDIR}/src
0091 eval `scramv1  run -sh`
0092 # set up OCCI workaround
0093 export LD_PRELOAD=$CMS_ORACLEOCCI_LIB
0094 
0095 # workaround for oracle tnsnames                                                                                                                   
0096 export TNS_ADMIN=/cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/oracle-env/29/etc
0097 
0098 cd ${JOBDIR}
0099 
0100