diff --git a/CondCore/Utilities/o2o/deploy_offline.sh b/CondCore/Utilities/o2o/deploy_offline.sh new file mode 100644 index 0000000000000..aec7e3669ba5e --- /dev/null +++ b/CondCore/Utilities/o2o/deploy_offline.sh @@ -0,0 +1,79 @@ +#!/bin/sh + +home=~ +localhome=/data/condbpro +root=/data/O2O +cmsswroot=/cvmfs/cms.cern.ch/ +extroot=/data/ext +release=CMSSW_10_0_5 +arch=slc6_amd64_gcc630 +sourceroot=CondCore/Utilities/o2o/templates +source=$cmsswroot/$arch/cms/cmssw/$release/src/$sourceroot + +files=( setup.sh + setStrip.sh + SiStripDCS.sh + ecal_laser.sh + EcalLaser.sh + EcalLaserTest.sh + EcalLaser_express.sh + EcalLaser_expressTest.sh ) + +folders=( EcalLaser + EcalLaserTest + EcalLaser_express + EcalLaser_expressTest + SiStrip ) + +cd $root +if [ ! -d scripts ]; then + mkdir scripts +fi +if [ ! -d logs ]; then + mkdir logs +fi + +sed_fmt () { + var=$(echo $1 | sed -e "s#/#\\\/#g") +} + +replace_params () { + params=( @root + @home + @cmsswroot + @extroot ) + tgt_file=$1 + var='' + # replace path params + sed_fmt $root + tgt_root=$var + sed -i -e s/@root/$tgt_root/g $tgt_file + sed_fmt $cmsswroot + tgt_cmsswroot=$var + sed -i -e s/@cmsswroot/$tgt_cmsswroot/g $tgt_file + sed_fmt $extroot + tgt_extroot=$var + sed -i -e s/@extroot/$tgt_extroot/g $tgt_file + sed_fmt $home + tgt_home=$var + # relace non-path params + sed -i -e s/@home/$tgt_home/g $tgt_file + sed -i -e s/@release/$release/g $tgt_file + sed -i -e s/@arch/$arch/g $tgt_file +} + +for file in "${files[@]}" +do + cp $source/$file scripts/ + tgt_file=scripts/$file + replace_params $tgt_file +done +for f in "${folders[@]}" +do + if [ ! -d $f ]; then + mkdir -p $f + fi + if [ ! -d logs/$f ]; then + mkdir logs/$f + fi +done diff --git a/CondCore/Utilities/o2o/deploy_online.sh b/CondCore/Utilities/o2o/deploy_online.sh new file mode 100644 index 0000000000000..94b7561325285 --- /dev/null +++ b/CondCore/Utilities/o2o/deploy_online.sh @@ -0,0 +1,89 @@ +#!/bin/sh + +home=~ +localhome=/data/popconpro +root=/data/O2O +cmsswroot=/opt/offline +extroot=/data/ext +release=CMSSW_10_0_5 +arch=slc7_amd64_gcc630 +sourceroot=CondCore/Utilities/o2o/templates +source=$cmsswroot/$arch/cms/cmssw/$release/src/$sourceroot + +files=( setup.sh + runStart.sh + runTestStart.sh + runStop.sh + runTestStop.sh + EcalDAQ.sh + EcalDAQTest.sh + EcalDCS.sh + EcalDCSTest.sh + EcalTPG.sh + RunInfoStart.sh + RunInfoStop.sh + RunInfoStartTest.sh + RunInfoStopTest.sh ) + +folders=( EcalDAQ + EcalDAQTest + EcalDCS + EcalDCSTest + EcalTPG + RunInfoStart + RunInfoStop + RunInfoStartTest + RunInfoStopTest ) + +cd $root +if [ ! -d scripts ]; then + mkdir scripts +fi +if [ ! -d logs ]; then + mkdir logs +fi + +sed_fmt () { + var=$(echo $1 | sed -e "s#/#\\\/#g") +} + +replace_params () { + params=( @root + @home + @cmsswroot + @extroot ) + tgt_file=$1 + var='' + # replace path params + sed_fmt $root + tgt_root=$var + sed -i -e s/@root/$tgt_root/g $tgt_file + sed_fmt $cmsswroot + tgt_cmsswroot=$var + sed -i -e s/@cmsswroot/$tgt_cmsswroot/g $tgt_file + sed_fmt $extroot + tgt_extroot=$var + sed -i -e s/@extroot/$tgt_extroot/g $tgt_file + sed_fmt $home + tgt_home=$var + # relace non-path params + sed -i -e s/@home/$tgt_home/g $tgt_file + sed -i -e s/@release/$release/g $tgt_file + sed -i -e s/@arch/$arch/g $tgt_file +} + +for file in "${files[@]}" +do + cp $source/$file scripts/ + tgt_file=scripts/$file + replace_params $tgt_file +done +for f in "${folders[@]}" +do + if [ ! -d $f ]; then + mkdir -p $f + fi + if [ ! -d logs/$f ]; then + mkdir logs/$f + fi +done diff --git a/CondCore/Utilities/o2o/deployed/offline/EcalLaser.sh b/CondCore/Utilities/o2o/deployed/offline/EcalLaser.sh new file mode 100755 index 0000000000000..c625c82aec887 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/offline/EcalLaser.sh @@ -0,0 +1,3 @@ +source /data/O2O/scripts/setupO2O.sh -s Ecal -j Laser +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalLaser $SRCDIR/EcalLaser_prompt_popcon.py diff --git a/CondCore/Utilities/o2o/deployed/offline/EcalLaserTest.sh b/CondCore/Utilities/o2o/deployed/offline/EcalLaserTest.sh new file mode 100755 index 0000000000000..61c71e74e4042 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/offline/EcalLaserTest.sh @@ -0,0 +1,3 @@ +source /data/O2O/scripts/setupO2O.sh -s Ecal -j LaserTest +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalLaserTest $SRCDIR/EcalLaser_prompt_popcon.py diff --git a/CondCore/Utilities/o2o/deployed/offline/EcalLaser_express.sh b/CondCore/Utilities/o2o/deployed/offline/EcalLaser_express.sh new file mode 100755 index 0000000000000..4db2775f4fea0 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/offline/EcalLaser_express.sh @@ -0,0 +1,3 @@ +source /data/O2O/scripts/setupO2O.sh -s Ecal -j Laser_express +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalLaser_express $SRCDIR/EcalLaser_express_popcon.py diff --git a/CondCore/Utilities/o2o/deployed/offline/EcalLaser_expressTest.sh b/CondCore/Utilities/o2o/deployed/offline/EcalLaser_expressTest.sh new file mode 100755 index 0000000000000..771c6cc78a5ca --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/offline/EcalLaser_expressTest.sh @@ -0,0 +1,3 @@ +source /data/O2O/scripts/setupO2O_new.sh -s Ecal -j Laser_expressTest +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_test_popCon EcalLaser_expressTest $SRCDIR/EcalLaser_express_popcon.py diff --git a/CondCore/Utilities/o2o/deployed/offline/SiStripDCS.crontab b/CondCore/Utilities/o2o/deployed/offline/SiStripDCS.crontab new file mode 100644 index 0000000000000..a09be0c0cb4e9 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/offline/SiStripDCS.crontab @@ -0,0 +1,4 @@ +5 * * * * /data/O2O/scripts/SiStripDCS.sh SiStripDetVOff_1hourDelay +20 * * * * /data/O2O/scripts/SiStripDCS.sh SiStripDetVOff_13hourDelay +40 * * * * /data/O2O/scripts/SiStripDCS.sh SiStripDetVOff_prompt +45 * * * * /data/O2O/scripts/SiStripDCS.sh SiStripDetVOff_sampling_test \ No newline at end of file diff --git a/CondCore/Utilities/o2o/deployed/offline/SiStripDCS.sh b/CondCore/Utilities/o2o/deployed/offline/SiStripDCS.sh new file mode 100755 index 0000000000000..6c4b3bdd5fa32 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/offline/SiStripDCS.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# +# wrapper script to run DCS O2O +# Last updated: Apr 21, 2017 +# Author: Huilin Qu +# +# Usage: SiStripDCS.sh JOB_NAME + +JOBNAME=$1 + +O2O_HOME=/data/O2O/ + +source $O2O_HOME/scripts/setStripO2O.sh $JOBNAME +o2oRun_SiStripDCS.py $JOBNAME |tee -a $LOGFILE + +# Exit with status of last command +# Make sure the last command is o2oRun_SiStripDCS.py! +exit $? diff --git a/CondCore/Utilities/o2o/deployed/offline/runTimeBasedO2O.crontab b/CondCore/Utilities/o2o/deployed/offline/runTimeBasedO2O.crontab new file mode 100644 index 0000000000000..e3e73bb7ebd2c --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/offline/runTimeBasedO2O.crontab @@ -0,0 +1 @@ +0 */2 * * * /bin/sh /data/O2O/scripts/runTimeBasedO2O.sh >/dev/null 2>&1 diff --git a/CondCore/Utilities/o2o/deployed/offline/runTimeBasedO2O.sh b/CondCore/Utilities/o2o/deployed/offline/runTimeBasedO2O.sh new file mode 100755 index 0000000000000..1db430b3a498e --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/offline/runTimeBasedO2O.sh @@ -0,0 +1,26 @@ +#!/bin/bash +####### ------ beginning -------- ####################### +BASEDIR=/data/O2O +LOGFILE=${BASEDIR}/logs/TimeBasedO2O.log +DATE=`date` +echo " " | tee -a $LOGFILE +echo "----- new cronjob started for Time Based O2O at -----" | tee -a $LOGFILE +echo "$DATE" | tee -a $LOGFILE + +#Check if the exportation scripts are running, if so exits without launching them +PID_0=`ps aux | grep '/bin/sh /data/O2O/scripts/EcalLaser.sh' | grep -v grep | awk '{print $2}'` +if [ "${PID_0}" ] + then + echo "Ecal Laser Exportation script still running with pid ${PID_0}: exiting" | tee -a $LOGFILE + exit 1 +else + /bin/sh /data/O2O/scripts/EcalLaser.sh +fi +PID_1=`ps aux | grep '/bin/sh /data/O2O/scripts/EcalLaser_express.sh' | grep -v grep | awk '{print $2}'` +if [ "${PID_1}" ] + then + echo "Ecal LaserExpress Exportation script still running with pid ${PID_1}: exiting" | tee -a $LOGFILE + exit 1 +else + /bin/sh /data/O2O/scripts/EcalLaser_express.sh +fi diff --git a/CondCore/Utilities/o2o/deployed/offline/setStripO2O.sh b/CondCore/Utilities/o2o/deployed/offline/setStripO2O.sh new file mode 100755 index 0000000000000..d06950b821034 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/offline/setStripO2O.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# set the CMSSW environtmet for SiStripO2O +# and the proxies for conditionUploader +# + +O2ONAME=$1 + +# deployment-specific params +BASEDIR=/data/O2O +SCRAM_ARCH=slc6_amd64_gcc630 +RELEASE=CMSSW_10_0_5 +RELEASEDIR=/cvmfs/cms.cern.ch/slc6_amd64_gcc630/cms/cmssw/${RELEASE} + +source /cvmfs/cms.cern.ch/cmsset_default.sh +cd ${RELEASEDIR}/src +eval `scramv1 ru -sh` +cd - + +O2O_HOME=/data/O2O/SiStrip/ + +# for sqlalchmey (?) +export PYTHON_EGG_CACHE=/data/condbpro +# path to .netrc file and .cms_cond dir +export COND_AUTH_PATH=/data/O2O/SiStrip + +# save log files produced by o2oRun.py on disk +export JOBDIR=${O2O_HOME}/jobs/${O2ONAME} +export O2O_LOG_FOLDER=${BASEDIR}/logs/${O2ONAME} +export LOGFILE=${BASEDIR}/logs/$O2ONAME.log + +# temperoray fix for TNS_ADMIN +export TNS_ADMIN=/cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/oracle-env/29/etc diff --git a/CondCore/Utilities/o2o/deployed/offline/setupO2O.sh b/CondCore/Utilities/o2o/deployed/offline/setupO2O.sh new file mode 100755 index 0000000000000..1a3a7caf9d5d8 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/offline/setupO2O.sh @@ -0,0 +1,100 @@ +#!/bin/sh + +# deployment-specific params +BASEDIR=/data/O2O +RELEASE=CMSSW_10_0_5 +RELEASEDIR=/cvmfs/cms.cern.ch/slc6_amd64_gcc630/cms/cmssw/${RELEASE} + +# command params +OPTIND=1 + +SUBSYS="" +JOBNAME="" + +while getopts "h?s:j:" opt; do + case $opt in + h|\?) + echo "Mo' to spiego..." + exit 0 + ;; + s) SUBSYS=$OPTARG + ;; + j) JOBNAME=$OPTARG + ;; + esac +done + +shift $((OPTIND-1)) + +[ "$1" = "--" ] && shift + +O2ONAME=$SUBSYS$JOBNAME +#echo "name=$O2ONAME, subsystem=$SUBSYS, job=$JOBNAME" + +# o2o specific params +LOGFILE=${BASEDIR}/logs/$O2ONAME.log +JOBDIR=${BASEDIR}/${SUBSYS}/${JOBNAME} +DATE=`date` + +# functions +function logRun(){ + echo "----- new job started for $1 at -----" | tee -a $LOGFILE + echo $DATE | tee -a $LOGFILE +} + +function log() { + echo "[`date`] : $@ " | tee -a $LOGFILE +} + +function submit_command() { + logRun $1 + o2o run -n $1 "$2" | tee -a $LOGFILE +} + +function submit_test_command() { + logRun $1 + o2o --db dev run -n $1 "$2" | tee -a $LOGFILE +} + +function submit_cmsRun() { + COMMAND="cmsRun $2 destinationDatabase={db} destinationTag={tag}" + logRun $1 + o2o run -n $1 "$COMMAND" | tee -a $LOGFILE +} + +function submit_test_cmsRun() { + COMMAND="cmsRun $2 destinationDatabase={db} destinationTag={tag}" + logRun $1 + o2o --db dev run -n $1 "$COMMAND" | tee -a $LOGFILE +} + +function submit_popCon() { + COMMAND="popconRun $2 -d {db} -t {tag} -c" + logRun $1 + o2o run -n $1 "$COMMAND" | tee -a $LOGFILE +} + +function submit_test_popCon() { + COMMAND="popconRun $2 -d {db} -t {tag} -c" + logRun $1 + o2o --db dev run -n $1 "$COMMAND" | tee -a $LOGFILE +} + +# global variables +export PYTHON_EGG_CACHE=/data/condbpro +export SCRAM_ARCH=slc6_amd64_gcc630 +export O2O_LOG_FOLDER=/data/O2O/logs/${O2ONAME} +export COND_AUTH_PATH=$BASEDIR +source /cvmfs/cms.cern.ch/cmsset_default.sh + +cd ${RELEASEDIR}/src +eval `scramv1 run -sh` +# set up OCCI workaround +export LD_PRELOAD=$CMS_ORACLEOCCI_LIB + +# workaround for oracle tnsnames +export TNS_ADMIN=/cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/oracle-env/29/etc + +cd ${JOBDIR} + + diff --git a/CondCore/Utilities/o2o/deployed/online/EcalDAQ.sh b/CondCore/Utilities/o2o/deployed/online/EcalDAQ.sh new file mode 100755 index 0000000000000..924483807112c --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/EcalDAQ.sh @@ -0,0 +1,3 @@ +source /data/O2O/scripts/setupO2O.sh -s Ecal -j DAQ +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalDAQ $SRCDIR/EcalDAQ_popcon.py diff --git a/CondCore/Utilities/o2o/deployed/online/EcalDAQTest.sh b/CondCore/Utilities/o2o/deployed/online/EcalDAQTest.sh new file mode 100755 index 0000000000000..b9d5f6dfe6559 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/EcalDAQTest.sh @@ -0,0 +1,3 @@ +source /data/O2O/scripts/setupO2O.sh -s Ecal -j DAQTest +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalDAQTest $SRCDIR/EcalDAQ_popcon.py diff --git a/CondCore/Utilities/o2o/deployed/online/EcalDCS.sh b/CondCore/Utilities/o2o/deployed/online/EcalDCS.sh new file mode 100755 index 0000000000000..0fbdf27fa6bf3 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/EcalDCS.sh @@ -0,0 +1,3 @@ +source /data/O2O/scripts/setupO2O.sh -s Ecal -j DCS +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalDCS $SRCDIR/EcalDCS_popcon.py diff --git a/CondCore/Utilities/o2o/deployed/online/EcalDCSTest.sh b/CondCore/Utilities/o2o/deployed/online/EcalDCSTest.sh new file mode 100755 index 0000000000000..a86c72eb59369 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/EcalDCSTest.sh @@ -0,0 +1,3 @@ +source /data/O2O/scripts/setupO2O.sh -s Ecal -j DCSTest +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalDCSTest $SRCDIR/EcalDCS_popcon.py diff --git a/CondCore/Utilities/o2o/deployed/online/EcalTPG.sh b/CondCore/Utilities/o2o/deployed/online/EcalTPG.sh new file mode 100755 index 0000000000000..40f2beccb1a08 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/EcalTPG.sh @@ -0,0 +1,68 @@ +#!/bin/bash +#setting up environment variables +export HOME=/nfshome0/popconpro +export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/nfshome0/popconpro/bin + +JCPORT=9999 + +while getopts ":t:r:p:k" options; do + case $options in + t ) TPG_KEY=$OPTARG;; + r ) RUN_NUMBER=$OPTARG;; + p ) JCPORT=$OPTARG;; + k ) KILLSWITCH=1;; + esac +done + +source /data/O2O/scripts/setupO2O.sh -s Ecal -j TPG + +log "-----------------------------------------------------------------------" +log "EcalTPG.sh" +log "PID $$" +log "HOSTNAME $HOSTNAME" +log "JCPORT $JCPORT" +log "TPG_KEY $TPG_KEY" +log "RUN_NUMBER $RUN_NUMBER" +log "date `date`" +log "-----------------------------------------------------------------------" + +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python + +# run the O2Os... +submit_cmsRun EcalTPGTowerStatus $SRCDIR/copyBadTT_cfg.py +submit_cmsRun EcalTPGCrystalStatus $SRCDIR/copyBadXT_cfg.py +submit_cmsRun EcalTPGFineGrainEBGroup $SRCDIR/copyFgrGroup_cfg.py +submit_cmsRun EcalTPGFineGrainEBIdMap $SRCDIR/copyFgrIdMap_cfg.py +submit_cmsRun EcalTPGFineGrainStripEE $SRCDIR/copyFgrStripEE_cfg.py +submit_cmsRun EcalTPGFineGrainTowerEE $SRCDIR/copyFgrTowerEE_cfg.py +submit_cmsRun EcalTPGLinearizationConst $SRCDIR/copyLin_cfg.py +submit_cmsRun EcalTPGLutGroup $SRCDIR/copyLutGroup_cfg.py +submit_cmsRun EcalTPGLutIdMap $SRCDIR/copyLutIdMap_cfg.py +submit_cmsRun EcalTPGPedestals $SRCDIR/copyPed_cfg.py +submit_cmsRun EcalTPGPhysicsConst $SRCDIR/copyPhysConst_cfg.py +submit_cmsRun EcalTPGSlidingWindow $SRCDIR/copySli_cfg.py +submit_cmsRun EcalTPGWeightGroup $SRCDIR/copyWGroup_cfg.py +submit_cmsRun EcalTPGWeightIdMap $SRCDIR/copyWIdMap_cfg.py +submit_cmsRun EcalTPGSpike $SRCDIR/copySpikeTh_cfg.py +submit_cmsRun EcalTPGStripStatus $SRCDIR/copyBadStrip_cfg.py +submit_command EcalADCToGeV_express "cmsRun $SRCDIR/EcalADCToGeVConstantPopConBTransitionAnalyzer_cfg.py runNumber=$RUN_NUMBER destinationDatabase={db} destinationTag={tag} tagForRunInfo={runInfoTag} tagForBOff={boffTag} tagForBOn={bonTag}" +submit_command EcalADCToGeV_hlt "cmsRun $SRCDIR/EcalADCToGeVConstantPopConBTransitionAnalyzer_cfg.py runNumber=$RUN_NUMBER destinationDatabase={db} destinationTag={tag} tagForRunInfo={runInfoTag} tagForBOff={boffTag} tagForBOn={bonTag}" +submit_command EcalIntercalibConstants_express "cmsRun $SRCDIR/EcalIntercalibConstantsPopConBTransitionAnalyzer_cfg.py runNumber=$RUN_NUMBER destinationDatabase={db} destinationTag={tag} tagForRunInfo={runInfoTag} tagForBOff={boffTag} tagForBOn={bonTag}" +submit_command EcalIntercalibConstants_hlt "cmsRun $SRCDIR/EcalIntercalibConstantsPopConBTransitionAnalyzer_cfg.py runNumber=$RUN_NUMBER destinationDatabase={db} destinationTag={tag} tagForRunInfo={runInfoTag} tagForBOff={boffTag} tagForBOn={bonTag}" + +log "-----------------------------------------------------------------------" +if [ -n "$KILLSWITCH" ]; then + log "Killswitch activated" +ADDR="http://$HOSTNAME:$JCPORT/urn:xdaq-application:service=jobcontrol/ProcKill?kill=$$" + +KILLCMD="curl $ADDR" + +log $KILLCMD +$KILLCMD > /dev/null + +fi + +log DONE + + +exit 0 diff --git a/CondCore/Utilities/o2o/deployed/online/EcalTPGTest.sh b/CondCore/Utilities/o2o/deployed/online/EcalTPGTest.sh new file mode 100755 index 0000000000000..f34553a5c7fe0 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/EcalTPGTest.sh @@ -0,0 +1,55 @@ +#!/bin/bash +#setting up environment variables +export HOME=/nfshome0/popconpro +export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/nfshome0/popconpro/bin + +#JCPORT=9999 + +#while getopts ":t:r:p:k" options; do +# case $options in +# t ) TPG_KEY=$OPTARG;; +# r ) RUN_NUMBER=$OPTARG;; +# p ) JCPORT=$OPTARG;; +# k ) KILLSWITCH=1;; +# esac +#done + +source /data/O2O/scripts/setupO2O.sh -s Ecal -j TPGTest + +#log "-----------------------------------------------------------------------" +#log "EcalTPG.sh" +#log "PID $$" +#log "HOSTNAME $HOSTNAME" +#log "JCPORT $JCPORT" +#log "TPG_KEY $TPG_KEY" +#log "RUN_NUMBER $RUN_NUMBER" +#log "date `date`" +#log "-----------------------------------------------------------------------" + +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python + +# run the O2Os... +submit_test_cmsRun copyBadTT $SRCDIR/copyBadTT_cfg.py +submit_test_cmsRun copyLin copyLin_cfg.py +submit_test_cmsRun copyPed copyPed_cfg.py +submit_test_cmsRun copyPhysConst copyPhysConst_cfg.py +submit_test_cmsRun copySli copySli_cfg.py +submit_test_cmsRun updateADCToGeV_express updateADCToGeV_express.py + +# END OF CHANGES +#log "-----------------------------------------------------------------------" +#if [ -n "$KILLSWITCH" ]; then +# log "Killswitch activated" +#ADDR="http://$HOSTNAME:$JCPORT/urn:xdaq-application:service=jobcontrol/ProcKill?kill=$$" + +#KILLCMD="curl $ADDR" + +#log $KILLCMD +#$KILLCMD > /dev/null + +#fi + +#log DONE + + +exit 0 diff --git a/CondCore/Utilities/o2o/deployed/online/RunInfoStart.sh b/CondCore/Utilities/o2o/deployed/online/RunInfoStart.sh new file mode 100644 index 0000000000000..102df4adc3cbb --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/RunInfoStart.sh @@ -0,0 +1,3 @@ +source /data/O2O/scripts/setupO2O.sh -s RunInfo -j Start +SRCDIR=$RELEASEDIR/src/CondTools/RunInfo/python +submit_command RunInfoStart "cmsRun $SRCDIR/RunInfoPopConAnalyzer.py runNumber=$1 destinationConnection={db} tag={tag}" diff --git a/CondCore/Utilities/o2o/deployed/online/RunInfoStartTest.sh b/CondCore/Utilities/o2o/deployed/online/RunInfoStartTest.sh new file mode 100644 index 0000000000000..be4bbd7955738 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/RunInfoStartTest.sh @@ -0,0 +1,3 @@ +source /data/O2O/scripts/setupO2O.sh -s RunInfo -j StartTest +SRCDIR=$RELEASEDIR/src/CondTools/RunInfo/python +submit_test_command RunInfoStartTest "cmsRun $SRCDIR/RunInfoPopConAnalyzer.py runNumber=$1 destinationConnection={db} tag={tag}" diff --git a/CondCore/Utilities/o2o/deployed/online/RunInfoStop.sh b/CondCore/Utilities/o2o/deployed/online/RunInfoStop.sh new file mode 100644 index 0000000000000..27216bcb0fe94 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/RunInfoStop.sh @@ -0,0 +1,3 @@ +source /data/O2O/scripts/setupO2O.sh -s RunInfo -j Stop +SRCDIR=$RELEASEDIR/src/CondTools/RunInfo/python +submit_command RunInfoStop "cmsRun $SRCDIR/RunInfoPopConAnalyzer.py runNumber=$1 destinationConnection={db} tag={tag}" diff --git a/CondCore/Utilities/o2o/deployed/online/RunInfoStopTest.sh b/CondCore/Utilities/o2o/deployed/online/RunInfoStopTest.sh new file mode 100644 index 0000000000000..bdae7b9b2c9db --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/RunInfoStopTest.sh @@ -0,0 +1,3 @@ +source /data/O2O/scripts/setupO2O.sh -s RunInfo -j StopTest +SRCDIR=$RELEASEDIR/src/CondTools/RunInfo/python +submit_test_command RunInfoStopTest "cmsRun $SRCDIR/RunInfoPopConAnalyzer.py runNumber=$1 destinationConnection={db} tag={tag}" diff --git a/CondCore/Utilities/o2o/deployed/online/runStart.sh b/CondCore/Utilities/o2o/deployed/online/runStart.sh new file mode 100755 index 0000000000000..f0e51c1f563c2 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/runStart.sh @@ -0,0 +1,16 @@ +#!/bin/bash +####### ------ beginning -------- ####################### +LOGFILE=/data/O2O/logs/runStart.log +DATE=`date` +#setting up environment variables +export HOME=/nfshome0/popconpro +export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/nfshome0/popconpro/bin + +echo " " | tee -a $LOGFILE +echo "----- new job started for run $1 start at -----" | tee -a $LOGFILE +echo "$DATE" | tee -a $LOGFILE + +/bin/sh /data/O2O/scripts/RunInfoStart.sh $1 | tee -a $LOGFILE +/bin/sh /data/O2O/scripts/EcalDAQ.sh | tee -a $LOGFILE +/bin/sh /data/O2O/scripts/EcalDCS.sh | tee -a $LOGFILE +#/bin/sh /data/O2O/scripts/RunInfoStartTest.sh $1 | tee -a /data/O2O/logs/runTestStart.log diff --git a/CondCore/Utilities/o2o/deployed/online/runStop.sh b/CondCore/Utilities/o2o/deployed/online/runStop.sh new file mode 100755 index 0000000000000..3cde915c38aa7 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/runStop.sh @@ -0,0 +1,14 @@ +#!/bin/bash +####### ------ beginning -------- ####################### +LOGFILE=/data/O2O/logs/runStop.log +DATE=`date` +#setting up environment variables +export HOME=/nfshome0/popconpro +export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/nfshome0/popconpro/bin + +echo " " | tee -a $LOGFILE +echo "----- new job started for run $1 stop at -----" | tee -a $LOGFILE +echo "$DATE" | tee -a $LOGFILE + +/bin/sh /data/O2O/scripts/RunInfoStop.sh $1 | tee -a $LOGFILE +#/bin/sh /data/O2O/scripts/RunInfoStopTest.sh $1 | tee -a /data/O2O/logs/runTestStop.log \ No newline at end of file diff --git a/CondCore/Utilities/o2o/deployed/online/runTestStart.sh b/CondCore/Utilities/o2o/deployed/online/runTestStart.sh new file mode 100755 index 0000000000000..d4fa05e02f513 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/runTestStart.sh @@ -0,0 +1,15 @@ +#!/bin/bash +####### ------ beginning -------- ####################### +LOGFILE=/data/O2O/logs/runTestStart.log +DATE=`date` +#setting up environment variables +export HOME=/nfshome0/popconpro +export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/nfshome0/popconpro/bin + +echo " " | tee -a $LOGFILE +echo "----- new cronjob started for Run $1 test start at -----" | tee -a $LOGFILE +echo "$DATE" | tee -a $LOGFILE + +/bin/sh /data/O2O/scripts/RunInfoStartTest.sh $1 | tee -a $LOGFILE +/bin/sh /data/O2O/scripts/EcalDAQTest.sh | tee -a $LOGFILE +/bin/sh /data/O2O/scripts/EcalDCSTest.sh | tee -a $LOGFILE \ No newline at end of file diff --git a/CondCore/Utilities/o2o/deployed/online/runTestStop.sh b/CondCore/Utilities/o2o/deployed/online/runTestStop.sh new file mode 100755 index 0000000000000..83ceb4334a157 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/runTestStop.sh @@ -0,0 +1,13 @@ +#!/bin/bash +####### ------ beginning -------- ####################### +LOGFILE=/data/O2O/logs/runTestStop.log +DATE=`date` +#setting up environment variables +export HOME=/nfshome0/popconpro +export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/nfshome0/popconpro/bin + +echo " " | tee -a $LOGFILE +echo "----- new job started for run $1 test stop at -----" | tee -a $LOGFILE +echo "$DATE" | tee -a $LOGFILE + +/bin/sh /data/O2O/scripts/RunInfoStopTest.sh $1 | tee -a $LOGFILE diff --git a/CondCore/Utilities/o2o/deployed/online/setupO2O.sh b/CondCore/Utilities/o2o/deployed/online/setupO2O.sh new file mode 100755 index 0000000000000..ed4b9abc3a6c8 --- /dev/null +++ b/CondCore/Utilities/o2o/deployed/online/setupO2O.sh @@ -0,0 +1,100 @@ +#!/bin/sh + +# deployment-specific params +BASEDIR=/data/O2O +RELEASE=CMSSW_10_0_5 +ARCH=slc7_amd64_gcc630 +RELEASEDIR=/opt/offline/${ARCH}/cms/cmssw/${RELEASE} + +# command params +OPTIND=1 + +SUBSYS="" +JOBNAME="" + +while getopts "h?s:j:" opt; do + case $opt in + h|\?) + echo "Mo' to spiego..." + exit 0 + ;; + s) SUBSYS=$OPTARG + ;; + j) JOBNAME=$OPTARG + ;; + esac +done + +shift $((OPTIND-1)) + +[ "$1" = "--" ] && shift + +O2ONAME=$SUBSYS$JOBNAME +#echo "name=$O2ONAME, subsystem=$SUBSYS, job=$JOBNAME" + +# o2o specific params +LOGFILE=${BASEDIR}/logs/$O2ONAME.log +JOBDIR=${BASEDIR}/${SUBSYS}/${JOBNAME} +DATE=`date` + +# functions +function logRun(){ + echo "----- new job started for $1 at -----" | tee -a $LOGFILE + echo $DATE | tee -a $LOGFILE +} + +function log() { + echo "[`date`] : $@ " | tee -a $LOGFILE +} + +function submit_command() { + logRun $1 + o2o run -n $1 "$2" | tee -a $LOGFILE +} + +function submit_test_command() { + logRun $1 + o2o --db dev run -n $1 "$2" | tee -a $LOGFILE +} + +function submit_cmsRun() { + COMMAND="cmsRun $2 destinationDatabase={db} destinationTag={tag}" + logRun $1 + o2o run -n $1 "$COMMAND" | tee -a $LOGFILE +} + +function submit_test_cmsRun() { + COMMAND="cmsRun $2 destinationDatabase={db} destinationTag={tag}" + logRun $1 + o2o --db dev run -n $1 "$COMMAND" | tee -a $LOGFILE +} + +function submit_popCon() { + COMMAND="popconRun $2 -d {db} -t {tag} -c" + logRun $1 + o2o run -n $1 "$COMMAND" | tee -a $LOGFILE +} + +function submit_test_popCon() { + COMMAND="popconRun $2 -d {db} -t {tag} -c" + logRun $1 + o2o --db dev run -n $1 "$COMMAND" | tee -a $LOGFILE +} + +# global variables +export SCRAM_ARCH=$ARCH +export O2O_LOG_FOLDER=/data/O2O/logs/${O2ONAME} +export COND_AUTH_PATH=$BASEDIR +source /opt/offline/cmsset_default.sh + +cd ${RELEASEDIR}/src +eval `scramv1 run -sh` +# set up OCCI workaround +export LD_PRELOAD=$CMS_ORACLEOCCI_LIB + +# workaround for oracle tnsnames +export TNS_ADMIN=/data/ext/oracle-env/29/etc + +cd ${JOBDIR} + + diff --git a/CondCore/Utilities/o2o/templates/EcalDAQ.sh b/CondCore/Utilities/o2o/templates/EcalDAQ.sh new file mode 100755 index 0000000000000..f4e5a03d5f8cb --- /dev/null +++ b/CondCore/Utilities/o2o/templates/EcalDAQ.sh @@ -0,0 +1,3 @@ +source @root/scripts/setup.sh -j EcalDAQ +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalDAQ $SRCDIR/EcalDAQ_popcon.py diff --git a/CondCore/Utilities/o2o/templates/EcalDAQTest.sh b/CondCore/Utilities/o2o/templates/EcalDAQTest.sh new file mode 100755 index 0000000000000..68d887d87b4d6 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/EcalDAQTest.sh @@ -0,0 +1,3 @@ +source @root/scripts/setup.sh -j EcalDAQTest +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalDAQTest $SRCDIR/EcalDAQ_popcon.py diff --git a/CondCore/Utilities/o2o/templates/EcalDCS.sh b/CondCore/Utilities/o2o/templates/EcalDCS.sh new file mode 100755 index 0000000000000..bcfef7d0b99ce --- /dev/null +++ b/CondCore/Utilities/o2o/templates/EcalDCS.sh @@ -0,0 +1,3 @@ +source @root/scripts/setup.sh -j EcalDCS +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalDCS $SRCDIR/EcalDCS_popcon.py diff --git a/CondCore/Utilities/o2o/templates/EcalDCSTest.sh b/CondCore/Utilities/o2o/templates/EcalDCSTest.sh new file mode 100755 index 0000000000000..215673cf07506 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/EcalDCSTest.sh @@ -0,0 +1,3 @@ +source @root/scripts/setup.sh -j EcalDCSTest +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalDCSTest $SRCDIR/EcalDCS_popcon.py diff --git a/CondCore/Utilities/o2o/templates/EcalLaser.sh b/CondCore/Utilities/o2o/templates/EcalLaser.sh new file mode 100755 index 0000000000000..52c262a3f89d7 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/EcalLaser.sh @@ -0,0 +1,3 @@ +source @root/scripts/setup.sh -j EcalLaser +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalLaser $SRCDIR/EcalLaser_prompt_popcon.py diff --git a/CondCore/Utilities/o2o/templates/EcalLaserTest.sh b/CondCore/Utilities/o2o/templates/EcalLaserTest.sh new file mode 100755 index 0000000000000..c2586688b6c19 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/EcalLaserTest.sh @@ -0,0 +1,3 @@ +source @root/scripts/setup.sh -j EcalLaserTest +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalLaserTest $SRCDIR/EcalLaser_prompt_popcon.py diff --git a/CondCore/Utilities/o2o/templates/EcalLaser_express.sh b/CondCore/Utilities/o2o/templates/EcalLaser_express.sh new file mode 100755 index 0000000000000..2c0f8becd9c69 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/EcalLaser_express.sh @@ -0,0 +1,3 @@ +source @root/scripts/setup.sh -j EcalLaser_express +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_popCon EcalLaser_express $SRCDIR/EcalLaser_express_popcon.py diff --git a/CondCore/Utilities/o2o/templates/EcalLaser_expressTest.sh b/CondCore/Utilities/o2o/templates/EcalLaser_expressTest.sh new file mode 100755 index 0000000000000..f433d8345b69e --- /dev/null +++ b/CondCore/Utilities/o2o/templates/EcalLaser_expressTest.sh @@ -0,0 +1,3 @@ +source @root/scripts/setup.sh -j EcalLaser_expressTest +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python +submit_test_popCon EcalLaser_expressTest $SRCDIR/EcalLaser_express_popcon.py diff --git a/CondCore/Utilities/o2o/templates/EcalTPG.sh b/CondCore/Utilities/o2o/templates/EcalTPG.sh new file mode 100755 index 0000000000000..1ab900de0a7be --- /dev/null +++ b/CondCore/Utilities/o2o/templates/EcalTPG.sh @@ -0,0 +1,68 @@ +#!/bin/bash +#setting up environment variables +export HOME=@home +export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:@home/bin + +JCPORT=9999 + +while getopts ":t:r:p:k" options; do + case $options in + t ) TPG_KEY=$OPTARG;; + r ) RUN_NUMBER=$OPTARG;; + p ) JCPORT=$OPTARG;; + k ) KILLSWITCH=1;; + esac +done + +source @root/scripts/setup.sh -j EcalTPG + +log "-----------------------------------------------------------------------" +log "EcalTPG.sh" +log "PID $$" +log "HOSTNAME $HOSTNAME" +log "JCPORT $JCPORT" +log "TPG_KEY $TPG_KEY" +log "RUN_NUMBER $RUN_NUMBER" +log "date `date`" +log "-----------------------------------------------------------------------" + +SRCDIR=$RELEASEDIR/src/CondTools/Ecal/python + +# run the O2Os... +submit_cmsRun EcalTPGTowerStatus $SRCDIR/copyBadTT_cfg.py +submit_cmsRun EcalTPGCrystalStatus $SRCDIR/copyBadXT_cfg.py +submit_cmsRun EcalTPGFineGrainEBGroup $SRCDIR/copyFgrGroup_cfg.py +submit_cmsRun EcalTPGFineGrainEBIdMap $SRCDIR/copyFgrIdMap_cfg.py +submit_cmsRun EcalTPGFineGrainStripEE $SRCDIR/copyFgrStripEE_cfg.py +submit_cmsRun EcalTPGFineGrainTowerEE $SRCDIR/copyFgrTowerEE_cfg.py +submit_cmsRun EcalTPGLinearizationConst $SRCDIR/copyLin_cfg.py +submit_cmsRun EcalTPGLutGroup $SRCDIR/copyLutGroup_cfg.py +submit_cmsRun EcalTPGLutIdMap $SRCDIR/copyLutIdMap_cfg.py +submit_cmsRun EcalTPGPedestals $SRCDIR/copyPed_cfg.py +submit_cmsRun EcalTPGPhysicsConst $SRCDIR/copyPhysConst_cfg.py +submit_cmsRun EcalTPGSlidingWindow $SRCDIR/copySli_cfg.py +submit_cmsRun EcalTPGWeightGroup $SRCDIR/copyWGroup_cfg.py +submit_cmsRun EcalTPGWeightIdMap $SRCDIR/copyWIdMap_cfg.py +submit_cmsRun EcalTPGSpike $SRCDIR/copySpikeTh_cfg.py +submit_cmsRun EcalTPGStripStatus $SRCDIR/copyBadStrip_cfg.py +submit_command EcalADCToGeV_express "cmsRun $SRCDIR/EcalADCToGeVConstantPopConBTransitionAnalyzer_cfg.py runNumber=$RUN_NUMBER destinationDatabase={db} destinationTag={tag} tagForRunInfo={runInfoTag} tagForBOff={boffTag} tagForBOn={bonTag}" +submit_command EcalADCToGeV_hlt "cmsRun $SRCDIR/EcalADCToGeVConstantPopConBTransitionAnalyzer_cfg.py runNumber=$RUN_NUMBER destinationDatabase={db} destinationTag={tag} tagForRunInfo={runInfoTag} tagForBOff={boffTag} tagForBOn={bonTag}" +submit_command EcalIntercalibConstants_express "cmsRun $SRCDIR/EcalIntercalibConstantsPopConBTransitionAnalyzer_cfg.py runNumber=$RUN_NUMBER destinationDatabase={db} destinationTag={tag} tagForRunInfo={runInfoTag} tagForBOff={boffTag} tagForBOn={bonTag}" +submit_command EcalIntercalibConstants_hlt "cmsRun $SRCDIR/EcalIntercalibConstantsPopConBTransitionAnalyzer_cfg.py runNumber=$RUN_NUMBER destinationDatabase={db} destinationTag={tag} tagForRunInfo={runInfoTag} tagForBOff={boffTag} tagForBOn={bonTag}" + +log "-----------------------------------------------------------------------" +if [ -n "$KILLSWITCH" ]; then + log "Killswitch activated" +ADDR="http://$HOSTNAME:$JCPORT/urn:xdaq-application:service=jobcontrol/ProcKill?kill=$$" + +KILLCMD="curl $ADDR" + +log $KILLCMD +$KILLCMD > /dev/null + +fi + +log DONE + + +exit 0 diff --git a/CondCore/Utilities/o2o/templates/RunInfoStart.sh b/CondCore/Utilities/o2o/templates/RunInfoStart.sh new file mode 100644 index 0000000000000..fb643348bf769 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/RunInfoStart.sh @@ -0,0 +1,3 @@ +source @root/scripts/setup.sh -j RunInfoStart +SRCDIR=$RELEASEDIR/src/CondTools/RunInfo/python +submit_command RunInfoStart "cmsRun $SRCDIR/RunInfoPopConAnalyzer.py runNumber=$1 destinationConnection={db} tag={tag}" diff --git a/CondCore/Utilities/o2o/templates/RunInfoStartTest.sh b/CondCore/Utilities/o2o/templates/RunInfoStartTest.sh new file mode 100644 index 0000000000000..7c0e0f6701acd --- /dev/null +++ b/CondCore/Utilities/o2o/templates/RunInfoStartTest.sh @@ -0,0 +1,3 @@ +source @root/scripts/setup.sh -j RunInfoStartTest +SRCDIR=$RELEASEDIR/src/CondTools/RunInfo/python +submit_test_command RunInfoStartTest "cmsRun $SRCDIR/RunInfoPopConAnalyzer.py runNumber=$1 destinationConnection={db} tag={tag}" diff --git a/CondCore/Utilities/o2o/templates/RunInfoStop.sh b/CondCore/Utilities/o2o/templates/RunInfoStop.sh new file mode 100644 index 0000000000000..f7b890f32b677 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/RunInfoStop.sh @@ -0,0 +1,3 @@ +source @root/scripts/setup.sh -j RunInfoStop +SRCDIR=$RELEASEDIR/src/CondTools/RunInfo/python +submit_command RunInfoStop "cmsRun $SRCDIR/RunInfoPopConAnalyzer.py runNumber=$1 destinationConnection={db} tag={tag}" diff --git a/CondCore/Utilities/o2o/templates/RunInfoStopTest.sh b/CondCore/Utilities/o2o/templates/RunInfoStopTest.sh new file mode 100644 index 0000000000000..2d00c78731045 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/RunInfoStopTest.sh @@ -0,0 +1,3 @@ +source @root/scripts/setup.sh -j RunInfoStopTest +SRCDIR=$RELEASEDIR/src/CondTools/RunInfo/python +submit_test_command RunInfoStopTest "cmsRun $SRCDIR/RunInfoPopConAnalyzer.py runNumber=$1 destinationConnection={db} tag={tag}" diff --git a/CondCore/Utilities/o2o/templates/SiStripDCS.sh b/CondCore/Utilities/o2o/templates/SiStripDCS.sh new file mode 100755 index 0000000000000..f85242a0f7032 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/SiStripDCS.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# +# wrapper script to run DCS O2O +# Last updated: Apr 21, 2017 +# Author: Huilin Qu +# +# Usage: SiStripDCS.sh JOB_NAME + +JOBNAME=$1 + +O2O_HOME=@root + +source $O2O_HOME/scripts/setStrip.sh $JOBNAME +o2oRun_SiStripDCS.py $JOBNAME |tee -a $LOGFILE + +# Exit with status of last command +# Make sure the last command is o2oRun_SiStripDCS.py! +exit $? diff --git a/CondCore/Utilities/o2o/templates/ecal_laser.sh b/CondCore/Utilities/o2o/templates/ecal_laser.sh new file mode 100755 index 0000000000000..73cee73809d6f --- /dev/null +++ b/CondCore/Utilities/o2o/templates/ecal_laser.sh @@ -0,0 +1,26 @@ +#!/bin/bash +####### ------ beginning -------- ####################### +BASEDIR=@root +LOGFILE=${BASEDIR}/logs/TimeBasedO2O.log +DATE=`date` +echo " " | tee -a $LOGFILE +echo "----- new cronjob started for Time Based O2O at -----" | tee -a $LOGFILE +echo "$DATE" | tee -a $LOGFILE + +#Check if the exportation script is running, if so exits without launching it +PID_0=`ps aux | grep '/bin/sh @root/scripts/EcalLaser.sh' | grep -v grep | awk '{print $2}'` +if [ "${PID_0}" ] + then + echo "Ecal Laser Exportation script still running with pid ${PID_0}: exiting" | tee -a $LOGFILE + exit 1 +else + /bin/sh @root/scripts/EcalLaser.sh +fi +PID_1=`ps aux | grep '/bin/sh @root/scripts/EcalLaser_express.sh' | grep -v grep | awk '{print $2}'` +if [ "${PID_1}" ] + then + echo "Ecal LaserExpress Exportation script still running with pid ${PID_1}: exiting" | tee -a $LOGFILE + exit 1 +else + /bin/sh @root/scripts/EcalLaser_express.sh +fi diff --git a/CondCore/Utilities/o2o/templates/runStart.sh b/CondCore/Utilities/o2o/templates/runStart.sh new file mode 100755 index 0000000000000..2fb4bc2a32c7a --- /dev/null +++ b/CondCore/Utilities/o2o/templates/runStart.sh @@ -0,0 +1,16 @@ +#!/bin/bash +####### ------ beginning -------- ####################### +LOGFILE=@root/logs/runStart.log +DATE=`date` +#setting up environment variables +export HOME=@home +export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:@home/bin + +echo " " | tee -a $LOGFILE +echo "----- new job started for run $1 start at -----" | tee -a $LOGFILE +echo "$DATE" | tee -a $LOGFILE + +/bin/sh @root/scripts/RunInfoStart.sh $1 | tee -a $LOGFILE +/bin/sh @root/scripts/EcalDAQ.sh | tee -a $LOGFILE +/bin/sh @root/scripts/EcalDCS.sh | tee -a $LOGFILE + diff --git a/CondCore/Utilities/o2o/templates/runStop.sh b/CondCore/Utilities/o2o/templates/runStop.sh new file mode 100755 index 0000000000000..80ff72487b180 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/runStop.sh @@ -0,0 +1,13 @@ +#!/bin/bash +####### ------ beginning -------- ####################### +LOGFILE=@root/logs/runStop.log +DATE=`date` +#setting up environment variables +export HOME=@home +export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:@home/bin + +echo " " | tee -a $LOGFILE +echo "----- new job started for run $1 stop at -----" | tee -a $LOGFILE +echo "$DATE" | tee -a $LOGFILE + +/bin/sh @root/scripts/RunInfoStop.sh $1 | tee -a $LOGFILE diff --git a/CondCore/Utilities/o2o/templates/runTestStart.sh b/CondCore/Utilities/o2o/templates/runTestStart.sh new file mode 100755 index 0000000000000..0e5d91cfe4ec9 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/runTestStart.sh @@ -0,0 +1,15 @@ +#!/bin/bash +####### ------ beginning -------- ####################### +LOGFILE=@root/logs/runTestStart.log +DATE=`date` +#setting up environment variables +export HOME=@home +export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:@home/bin + +echo " " | tee -a $LOGFILE +echo "----- new cronjob started for Run $1 test start at -----" | tee -a $LOGFILE +echo "$DATE" | tee -a $LOGFILE + +/bin/sh @root/scripts/RunInfoStartTest.sh $1 | tee -a $LOGFILE +/bin/sh @root/scripts/EcalDAQTest.sh | tee -a $LOGFILE +/bin/sh @root/scripts/EcalDCSTest.sh | tee -a $LOGFILE \ No newline at end of file diff --git a/CondCore/Utilities/o2o/templates/runTestStop.sh b/CondCore/Utilities/o2o/templates/runTestStop.sh new file mode 100755 index 0000000000000..00601ca371a42 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/runTestStop.sh @@ -0,0 +1,13 @@ +#!/bin/bash +####### ------ beginning -------- ####################### +LOGFILE=@root/logs/runTestStop.log +DATE=`date` +#setting up environment variables +export HOME=@home +export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:@home/bin + +echo " " | tee -a $LOGFILE +echo "----- new job started for run $1 test stop at -----" | tee -a $LOGFILE +echo "$DATE" | tee -a $LOGFILE + +/bin/sh @root/scripts/RunInfoStopTest.sh $1 | tee -a $LOGFILE diff --git a/CondCore/Utilities/o2o/templates/setStrip.sh b/CondCore/Utilities/o2o/templates/setStrip.sh new file mode 100755 index 0000000000000..8e252cac96b66 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/setStrip.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# set the CMSSW environtmet for SiStripO2O +# and the proxies for conditionUploader +# + +O2ONAME=$1 + +# deployment-specific params +BASEDIR=@root +SCRAM_ARCH=@arch +RELEASE=@release +RELEASEDIR=@cmsswroot/@arch/cms/cmssw/${RELEASE} + +source @cmsswroot/cmsset_default.sh +cd ${RELEASEDIR}/src +eval `scramv1 ru -sh` +cd - + +O2O_HOME=$BASEDIR/SiStrip/ + +# for sqlalchmey (?) +export PYTHON_EGG_CACHE=@localhome +# path to .netrc file and .cms_cond dir +export COND_AUTH_PATH=@root/SiStrip + +# save log files produced by o2oRun.py on disk +export JOBDIR=${O2O_HOME}/jobs/${O2ONAME} +export O2O_LOG_FOLDER=${BASEDIR}/logs/${O2ONAME} +export LOGFILE=${BASEDIR}/logs/$O2ONAME.log + +# temperoray fix for TNS_ADMIN +export TNS_ADMIN=@extroot/oracle-env/29/etc diff --git a/CondCore/Utilities/o2o/templates/setup.sh b/CondCore/Utilities/o2o/templates/setup.sh new file mode 100755 index 0000000000000..1158c53931393 --- /dev/null +++ b/CondCore/Utilities/o2o/templates/setup.sh @@ -0,0 +1,95 @@ +#!/bin/sh + +# deployment-specific params +BASEDIR=@root +RELEASE=@release +ARCH=@arch +RELEASEDIR=@cmsswroot/${RELEASE} + +# command params +OPTIND=1 + +JOBNAME="" + +while getopts "h?s:j:" opt; do + case $opt in + h|\?) + echo "Mo' to spiego..." + exit 0 + ;; + j) JOBNAME=$OPTARG + ;; + esac +done + +shift $((OPTIND-1)) + +[ "$1" = "--" ] && shift + +# o2o specific params +LOGFILE=${BASEDIR}/logs/$JOBNAME.log +JOBDIR=${BASEDIR}/${JOBNAME} +DATE=`date` + +# functions +function logRun(){ + echo "----- new job started for $1 at -----" | tee -a $LOGFILE + echo $DATE | tee -a $LOGFILE +} + +function log() { + echo "[`date`] : $@ " | tee -a $LOGFILE +} + +function submit_command() { + logRun $1 + o2o run -n $1 "$2" | tee -a $LOGFILE +} + +function submit_test_command() { + logRun $1 + o2o --db dev run -n $1 "$2" | tee -a $LOGFILE +} + +function submit_cmsRun() { + COMMAND="cmsRun $2 destinationDatabase={db} destinationTag={tag}" + logRun $1 + o2o run -n $1 "$COMMAND" | tee -a $LOGFILE +} + +function submit_test_cmsRun() { + COMMAND="cmsRun $2 destinationDatabase={db} destinationTag={tag}" + logRun $1 + o2o --db dev run -n $1 "$COMMAND" | tee -a $LOGFILE +} + +function submit_popCon() { + COMMAND="popconRun $2 -d {db} -t {tag} -c" + logRun $1 + o2o run -n $1 "$COMMAND" | tee -a $LOGFILE +} + +function submit_test_popCon() { + COMMAND="popconRun $2 -d {db} -t {tag} -c" + logRun $1 + o2o --db dev run -n $1 "$COMMAND" | tee -a $LOGFILE +} + +# global variables +export PYTHON_EGG_CACHE=@localhome +export SCRAM_ARCH=$ARCH +export O2O_LOG_FOLDER=@root/logs/${JOBNAME} +export COND_AUTH_PATH=$BASEDIR +source @cmsswroot/cmsset_default.sh + +cd ${RELEASEDIR}/src +eval `scramv1 run -sh` +# set up OCCI workaround +export LD_PRELOAD=$CMS_ORACLEOCCI_LIB + +# workaround for oracle tnsnames +export TNS_ADMIN=@extroot/oracle-env/29/etc + +cd ${JOBDIR} + +