Skip to content
Snippets Groups Projects
Commit e40c8fb4 authored by Keith Thorne's avatar Keith Thorne
Browse files

Remove RCG 2.4 install scripts

Close #31.  This removes scripts created to migrate ws,front-end to RCG 2.4.
They are no longer applicable as we go to more package, cmake based solutions
parent 0089c63b
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 725 deletions
#!/usr/bin/env bash
#
# script rcg_stand_upgrade.sh - Upgrade RCG on stand-alone front-end to 2.4
#
# save current location
thisDir=`pwd`
rcgTag="2.4.1"
#
echo "RCG "${rcgTag}" upgrade to stand-alone front-end"
tmpFold=/var/tmp/RCG_Update
progFile=${tmpFold}/upgrade_progress.txt
if [ -f ${progFile} ]; then
echo "Resume upgrade"
else
while true; do
read -p "Do you want to proceed with the install?" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) "Please answer yes or no";;
esac
done
#
mkdir -p ${tmpFold}
rm -rf ${tmpFold}/*
touch ${progFile}
fi
#
# check if downloads complete
#
downDone=`grep DownloadDone ${progFile}`
cfgTar=cdscfg-2_4.tar.gz
echo 'downDone' $downDone
if [ -z "$downDone" ]; then
echo "Downloading files using Kerberos login"
klLoc=`which klist`
if [ -z "$klLoc" ]; then
echo " Kerberos not installed, emerge krb5, curl"
sudo emerge krb5
sudo emerge curl
fi
kname=`klist | grep Default`
if [ -z "$kname" ]; then
echo "Kerberos login not set - restart after doing kinit <albert.einstein>@LIGO.ORG"
exit
else
echo "kinit is good"
fi
#
webDir="https://llocds.ligo-la.caltech.edu/daq/software/upgrades"
downCfg=`grep DownloadCfg ${progFile}`
if [ -z "$downCfg" ]; then
echo "Download new environment configuration"
rm -f ${tmpFold}/${cfgTar}
curl -u : --negotiate ${webDir}/${cfgTar} > ${tmpFold}/${cfgTar}
echo "DownloadCfg" `date` >> ${progFile}
else
echo "Download new environment configuration - ALREADY DONE"
fi
#
echo "DownloadDone" `date` >> ${progFile}
else
echo "Downloading files using Kerberos login - ALREADY DONE"
fi
#
# copy scripts
cpScrDone=`grep CopyScr ${progFile}`
scrDir=${tmpFold}/scripts
if [ -z "$cpScrDone" ]; then
echo "Copy install scripts to work area"
mkdir -p ${scrDir}
cp ${thisDir}/scripts/* ${scrDir}
echo "CopyScr" `date` >> ${progFile}
else
echo "Copy install scripts to work area - ALREADY DONE"
fi
#
# get list of models
mdlListDone=`grep GenModelList ${progFile}`
if [ -z "$mdlListDone" ]; then
${scrDir}/gen_model_list.sh ${scrDir}
echo "GenModelList" `date` >> ${progFile}
else
echo "Get lists of models - ALREADY DONE"
fi
#
# Create EPICS snapshots
epicsBkupDone=`grep EpicsBackup ${progFile}`
if [ -z "$epicsBkupDone" ]; then
${scrDir}/backup_epics.sh ${scrDir}
echo "EpicsBackup" `date` >> ${progFile}
else
echo "Create EPICS shapshots - ALREADY DONE"
fi
#
# Kill DAQ processes
daqKillDone=`grep DaqKilled ${progFile}`
if [ -z "$daqKillDone" ]; then
${scrDir}/kill_daq.sh
echo "DaqKilled" `date` >> ${progFile}
else
echo "Kill DAQD,NDS - ALREADY DONE"
fi
#
# Stop sub-models
subStopDone=`grep SubStop ${progFile}`
if [ -z "$subStopDone" ]; then
${scrDir}/stop_sub.sh ${scrDir}
echo "SubStop" `date` >> ${progFile}
else
echo "Stop sub-models - ALREADY DONE"
fi
#
# Stop IOP models
iopStopDone=`grep IopStop ${progFile}`
if [ -z "$iopStopDone" ]; then
${scrDir}/stop_iops.sh ${scrDir}
echo "IopStop" `date` >> ${progFile}
else
echo "Stop IOP models - ALREADY DONE"
fi
#
# move and update userapps
appMoveDone=`grep UserAppMove ${progFile}`
if [ -z "$appMoveDone" ]; then
${scrDir}/move_userapps.sh
retCode=#?
echo "UserAppMove" `date` >> ${progFile}
if [ "$retCode -ne 0" ]; then
exit 1
fi
else
echo "Move userapps to /opt/rtcds/userapps - ALREADY DONE"
fi
#
# Copy RCG to /opt/rtcds/rtscore
cpRcgDone=`grep CopyRcg ${progFile}`
rcgDir=/opt/rtcds/rtscore
if [ -z "$cpRcgDone" ]; then
echo "Copy this RCG in /opt/rtcds/rtscore"
mkdir -p ${rcgDir}
rcgPath=${thisDir%%/etc/install}
cp -Rp ${rcgPath} ${rcgDir}
rcgPtr=${rcgPath##/*/}
cd ${rcgDir}
rm -f release
ln -s ${rcgPtr} release
cd ${thisDir}
echo "CopyRcg" `date` >> ${progFile}
else
echo "Copy this RCG to /opt/rtcds/rtscore - ALREADY DONE"
fi
#
# install new cfg
cfgUpdateDone=`grep CfgUpdate ${progFile}`
if [ -z "$cfgUpdateDone" ]; then
echo "Install new cdscfg"
cd ${tmpFold}
echo " went to "${tmpFold}
echo "try to open" ${cfgTar}
tar -xzf ${cfgTar}
cd cdscfg/install
./cfg_fe.sh
cd ${thisDir}
echo "CfgUpdate" `date` >> ${progFile}
echo "Now log out and log back in, then rerun this script to continue"
else
echo "Install new cdscfg - ALREADY DONE"
fi
#
# install RCG scripts
rcgScrDone=`grep RcgScripts ${progFile}`
if [ -z "$rcgScrDone" ]; then
echo "Copy RCG scripts to scripts area"
cd ${rcgDir}/release
cp src/epics/util/iniChk.pl /opt/rtcds/${site}/${ifo}/scripts
cd ${thisDir}
echo "RcgScripts" `date` >> ${progFile}
else
echo "Install RCG scripts - ALREADY DONE"
fi
# install new mbuf
#
mbufUpdateDone=`grep MbufUpdate ${progFile}`
if [ -z "$mbufUpdateDone" ]; then
${scrDir}/new_mbuf.sh ${rcgTag}
echo "MbufUpdate" `date` >> ${progFile}
else
echo "Update mbuf - ALREADY DONE"
fi
#
# install new awgtpman
awgTpUpdateDone=`grep AwgTpUpdate ${progFile}`
if [ -z "$awgTpUpdateDone" ]; then
${scrDir}/new_awgtpman.sh ${rcgTag}
echo "AwgTpUpdate" `date` >> ${progFile}
else
echo "Update awgtpman - ALREADY DONE"
fi
# install new real-time dataviewer
dvUpdateDone=`grep DvUpdate ${progFile}`
if [ -z "$dvUpdateDone" ]; then
${scrDir}/new_dv.sh ${rcgTag}
echo "DvUpdate" `date` >> ${progFile}
else
echo "Update dataviewer - ALREADY DONE"
fi
# create new build area
cfgRtBuildDone=`grep CfgRtBuild ${progFile}`
if [ -z "$cfgRtBuildDone" ]; then
echo "Configure real-time build area"
cd ${RTCDSROOT}
mkdir -p rtbuild
cd rtbuild
${RCG_DIR}/configure
echo "CfgRtBuild" `date` >> ${progFile}
else
echo "Configure real-time build area - ALREADY DONE"
fi
# Rebuild models
mdlBuildDone=`grep ModelBuild ${progFile}`
if [ -z "$mdlBuildDone" ]; then
${scrDir}/remake_models.sh ${scrDir}
echo "ModelBuild" `date` >> ${progFile}
else
echo "Rebuild models with new RCG - ALREADY DONE"
fi
# Rebuild stand-alone daqd
daqdBuildDone=`grep DaqdBuild ${progFile}`
if [ -z "$daqdBuildDone" ]; then
${scrDir}/new_daqd.sh ${rcgTag}
echo "DaqdBuild" `date` >> ${progFile}
else
echo "Build new stand-alone daqd - ALREADY DONE"
fi
# Rebuild nds
ndsBuildDone=`grep NdsBuild ${progFile}`
if [ -z "$ndsBuildDone" ]; then
${scrDir}/new_nds.sh ${rcgTag}
echo "NdsBuild" `date` >> ${progFile}
else
echo "Build new nds - ALREADY DONE"
fi
# Restart the models
mdlRestartDone=`grep ModelRestart ${progFile}`
if [ -z "$mdlRestartDone" ]; then
${scrDir}/restart_models.sh ${scrDir}
echo "ModelRestart" `date` >> ${progFile}
else
echo "Restart models built with new RCG - ALREADY DONE"
fi
# Restart DAQ, NDS
daqRestartDone=`grep DaqRestart ${progFile}`
if [ -z "$daqRestartDone" ]; then
${scrDir}/restart_daq.sh
echo "DaqRestart" `date` >> ${progFile}
else
echo "Restart DAQ built with new RCG - ALREADY DONE"
fi
#!/usr/bin/env bash
#
# script rcg_ws_upgrade.sh - Upgrade workstation for RCG 2.4
#
# save current location
thisDir=`pwd`
rcgTag="2.4.1"
#
echo "RCG "${rcgTag}" upgrade to workstation"
tmpFold=/var/tmp/RCG_Update
progFile=${tmpFold}/upgrade_progress.txt
if [ -f ${progFile} ]; then
echo "Resume upgrade"
else
while true; do
read -p "Do you want to proceed with the install?" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) "Please answer yes or no";;
esac
done
#
mkdir -p ${tmpFold}
rm -rf ${tmpFold}/*
touch ${progFile}
fi
#
# check if downloads complete
#
downDone=`grep DownloadDone ${progFile}`
cfgTar=cdscfg-2_4.tar.gz
echo 'downDone' $downDone
if [ -z "$downDone" ]; then
echo "Downloading files using Kerberos login"
klLoc=`which klist`
if [ -z "$klLoc" ]; then
echo " Install Kerberos - try sudo apt-get install krb5"
exit
fi
kname=`klist | grep Default`
if [ -z "$kname" ]; then
echo "Kerberos login not set - restart after doing kinit <albert.einstein>@LIGO.ORG"
exit
else
echo "kinit is good"
fi
#
webDir="https://llocds.ligo-la.caltech.edu/daq/software/upgrades"
downCfg=`grep DownloadCfg ${progFile}`
if [ -z "$downCfg" ]; then
echo "Download new environment configuration"
rm -f ${tmpFold}/${cfgTar}
curl -u : --negotiate ${webDir}/${cfgTar} > ${tmpFold}/${cfgTar}
echo "DownloadCfg" `date` >> ${progFile}
else
echo "Download new environment configuration - ALREADY DONE"
fi
#
echo "DownloadDone" `date` >> ${progFile}
else
echo "Downloading files using Kerberos login - ALREADY DONE"
fi
#
# copy scripts
cpScrDone=`grep CopyScr ${progFile}`
scrDir=${tmpFold}/scripts
if [ -z "$cpScrDone" ]; then
echo "Copy install scripts to work area"
mkdir -p ${scrDir}
cp ${thisDir}/scripts/* ${scrDir}
echo "CopyScr" `date` >> ${progFile}
else
echo "Copy install scripts to work area - ALREADY DONE"
fi
#
# install new cfg
cfgUpdateDone=`grep CfgUpdate ${progFile}`
if [ -z "$cfgUpdateDone" ]; then
echo "Install new cdscfg"
cd ${tmpFold}
echo " went to "${tmpFold}
echo "try to open" ${cfgTar}
tar -xzf ${cfgTar}
cd cdscfg/install
./cfg_ws.sh
cd ${thisDir}
echo "CfgUpdate" `date` >> ${progFile}
echo "Now log out and log back in, then rerun this script to continue"
else
echo "Install new cdscfg - ALREADY DONE"
fi
# install new dataviewer
dvUpdateDone=`grep DvUpdate ${progFile}`
if [ -z "$dvUpdateDone" ]; then
${scrDir}/new_dv_ws.sh ${rcgTag}
echo "DvUpdate" `date` >> ${progFile}
else
echo "Update dataviewer - ALREADY DONE"
fi
#!/usr/bin/env bash
if [ "$# -gt 0" ]; then
UPDATE_DIR=$1
else
if [ "$UPDATE_DIR" ]; then
UPDATE_DIR=${UPDATE_DIR}
else
UPDATE_DIR=/var/tmp/update
mkdir -p $UPDATE_DIR
fi
fi
cd ${UPDATE_DIR}
mkdir -p snapshots
source /opt/cdscfg/rtsetup.sh
for model in $(cat models/all_models.txt); do
snapFile=snapshots/${model}_backup.snap
reqFile=/opt/rtcds/${site}/${ifo}/target/${model}/${model}epics/autoBurt.req
burtrb -f ${reqFile} -o ${snapFile}
done
#!/usr/bin/env bash
# script to get lists of models on test stand front-end
echo "Get lists of models"
# Were we passed UPDATE_DIR information on the command line?
if [ $# -gt 0 ]; then
UPDATE_DIR=$1
else
if [ "$UPDATE_DIR" ]; then
UPDATE_DIR=${UPDATE_DIR}
else
UPDATE_DIR=/var/tmp/update
mkdir -p $UPDATE_DIR
fi
fi
mdlDir=${UPDATE_DIR}/models
mkdir -p ${mdlDir}
#
source /opt/cdscfg/rtsetup.sh
#
cd /opt/rtcds/${site}/${ifo}/target
#
ls -d ${ifo}* > ${mdlDir}/all_models.txt
echo "IOP models found:"
cat ${mdlDir}/all_models.txt | grep iop
cat ${mdlDir}/all_models.txt | grep iop > ${mdlDir}/iop_models.txt
#
echo "sub models found:"
cat ${mdlDir}/all_models.txt | grep -v iop
cat ${mdlDir}/all_models.txt | grep -v iop > ${mdlDir}/sub_models.txt
\ No newline at end of file
#!/usr/bin/env bash
echo "Kill DAQD,NDS"
if [ -f /etc/init.d/daqd ]; then
sudo /etc/init.d/monit stop
sudo /etc/init.d/daqd stop
sudo /etc/init.d/nds stop
else
# remove DAQ from inittab and stop
sudo cp /etc/inittab /tmp/inittab0
sudo cat /tmp/inittab0 | sed 's/fb:2345/#fb:2345/' > /tmp/inittab1
sudo cat /tmp/inittab1 | sed 's/nds:2345/#nds:2345/' > /tmp/inittab2
sudo cp /tmp/inittab2 /etc/inittab
sudo init q
fi
#!/usr/bin/env bash
# script to re-locate userapps to /opt/rtcds
#
source /opt/cdscfg/rtsetup.sh
#
newHome=/opt/rtcds/userapps
newPath=${newHome}/release
if [ -d ${newHome} ]; then
echo "Userapps already moved to /opt/rtcds/userapps"
cd ${newHome}
else
mkdir -p ${newHome}
oldHome=/opt/rtcds/${site}/${ifo}/userapps
if [ -d ${oldHome} ]; then
echo "Move userapps to /opt/rtcds/userapps"
mv /opt/rtcds/${site}/${ifo}/userapps/* ${newHome}
cd ${newHome}
rm release
if [ -d trunk ]; then
ln -s trunk release
elif [ -d cds_user_apps/trunk ]; then
ln -s cds_user_apps/trunk release
else
echo "OOPS - unable to create release - do it manually"
exit 1
fi
else
echo "No userapps found - check out a fresh one"
appsSvn="https://redoubt.ligo-wa.caltech.edu/svn/cds_user_apps"
cd ${newHome}
svn co ${appsSvn}
ln -s cds_user_apps/trunk release
fi
fi
echo "Update userapps from cds_user_apps Subversion"
cd ${newHome}
svn update release
exit 0
#!/usr/bin/env bash
# script to build new awgtpman
if [ $# -gt 0 ]; then
RCGTAG=$1
echo " Build new awgtpman for RCG $RCGTAG"
else
echo " You need to add RCGTAG as input parameter"
exit
fi
#
source /opt/cdscfg/rtsetup.sh
#
cd ${RCG_DIR}/src/gds
make clean
make
cp -p awgtpman ${RTCDSROOT}/target/gds/bin/awgtpman-${RCGTAG}
cd ${RTCDSROOT}/target/gds/bin
mkdir -p bin_archive
mv awgtpman-${RCGTAG} bin_archive
cp -p awgtpman bin_archive/awgtpman-pre${RCGTAG}
cp -p bin_archive/awgtpman-${RCGTAG} awgtpman
#!/usr/bin/env bash
# script to build new daqd
if [ "$# -gt 0" ]; then
RCGTAG=$1
echo " Build new mbuf for RCG $RCGTAG"
else
echo " You need to add RCGTAG as input parameter"
exit
fi
#
source /opt/cdscfg/rtsetup.sh
cd ${RTBUILD_DIR}
#
make standiop
cp -p build/standiop/daqd ${RTCDSROOT}/target/fb/daqd-${RCGTAG}
cd ${RTCDSROOT}/target/fb
mkdir -p bin_archive
mv daqd-${RCGTAG} bin_archive
cp -p daqd bin_archive/daqd-pre${RCGTAG}
cp -p bin_archive/daqd-${RCGTAG} daqd
#!/usr/bin/env bash
# script to build new dataviewer
if [ $# -gt 0 ]; then
RCGTAG=$1
echo " Build new dataviewer for RCG $RCGTAG"
else
echo " You need to add RCGTAG as input parameter"
exit
fi
#
source /opt/cdscfg/rtsetup.sh
#
cd /opt/rtapps
if [ -L dv ]; then
rm dv
elif [ -d dv ]; then
mv dv dv-pre${RCGTAG}
fi
#
cd ${RCG_DIR}/src/dv
make clean
make
make install
cd /opt/rtapps
mv dv dv-${RCGTAG}
ln -s dv-${RCGTAG} dv
#!/usr/bin/env bash
# script to build new dataviewer on workstation
if [ $# -gt 0 ]; then
RCGTAG=$1
echo " Build new dataviewer for RCG $RCGTAG"
else
echo " You need to add RCGTAG as input parameter"
exit
fi
#
source /ligo/cdscfg/stdsetup.sh
#
cd ${APPSROOT}
if [ -L dv ]; then
rm dv
elif [ -d dv ]; then
mv dv dv-pre${RCGTAG}
fi
#
cd ${RCG_DIR}/src/dv
make clean
make
make ligoapps
cd ${APPSROOT}
mv dv dv-${RCGTAG}
ln -s dv-${RCGTAG} dv
#!/usr/bin/env bash
# script to build new mbuf
if [ $# -gt 0 ]; then
RCGTAG=$1
echo " Build new mbuf for RCG $RCGTAG"
else
echo " You need to add RCGTAG as input parameter"
exit
fi
#
source /opt/cdscfg/rtsetup.sh
cd ${RCG_DIR}
cd src/drv/mbuf
make
cd /lib/modules/2.6.34.1/kernel/drivers/mbuf
sudo bash -c "cp -p mbuf.ko mbuf.ko.old"
sudo bash -c "cp ${RCG_DIR}/src/drv/mbuf/mbuf.ko mbuf.ko.${RCGTAG}"
sudo bash -c "lsmod | grep mbuf && rmmod mbuf"
sudo bash -c "cp -p mbuf.ko.${RCGTAG} mbuf.ko"
sudo bash -c "insmod mbuf.ko"
#!/bin/bash
# script to build new stand-alone NDS
if [ "$# -gt 0" ]; then
RCGTAG=$1
echo " Build new mbuf for RCG $RCGTAG"
else
echo " You need to add RCGTAG as input parameter"
exit
fi
#
source /opt/cdscfg/rtsetup.sh
#
cd ${RTBUILD_DIR}
#
make nds
cp -p build/nds/nds ${RTCDSROOT}/target/fb/nds-${RCGTAG}
cd ${RTCDSROOT}/target/fb
mkdir -p bin_archive
mv nds-${RCGTAG} bin_archive
cp -p nds bin_archive/nds-pre${RCGTAG}
cp -p bin_archive/nds-${RCGTAG} nds
#!/usr/bin/env bash
# rebuild models with new RCG
echo "Rebuild models with new RCG"
# Were we passed UPDATE_DIR information on the command line?
if [ "$# -gt 0" ]; then
UPDATE_DIR=$1
else
if [ "$UPDATE_DIR" ]; then
UPDATE_DIR=${UPDATE_DIR}
else
UPDATE_DIR=/var/update
fi
fi
mdlDir=${UPDATE_DIR}/models
#
source /opt/cdscfg/rtsetup.sh
#
cd ${RTBUILD_DIR}
#
for iopmodel in $(cat ${mdlDir}/iop_models.txt); do
make ${iopmodel}
make install-${iopmodel}
done
for model in $(cat ${mdlDir}/sub_models.txt); do
make ${model}
make install-${model}
done
#!/usr/bin/env bash
# add DAQ to inittab and start
echo " Restart standalone DAQ, NDS"
if [ -f /etc/init.d/monit ]; then
sudo /etc/init.d/monit restart
else
sudo cp /etc/inittab /tmp/inittab0
sudo cat /tmp/inittab0 | sed 's/#fb:2345/fb:2345/' > /tmp/inittab1
sudo cat /tmp/inittab1 | sed 's/#nds:2345/nds:2345/' > /tmp/inittab2
sudo cp /tmp/inittab2 /etc/inittab
sudo init q
fi
#!/usr/bin/env bash
# restart models
echo "Restart models built with new RCG"
# Were we passed UPDATE_DIR information on the command line?
if [ "$# -gt 0" ]; then
UPDATE_DIR=$1
else
if [ "$UPDATE_DIR" ]; then
UPDATE_DIR=${UPDATE_DIR}
else
UPDATE_DIR=/var/update
fi
fi
#
source /opt/cdscfg/rtsetup.sh
#
cd ${UPDATE_DIR}
for iopmodel in $(cat models/iop_models.txt); do
start${iopmodel}
snapFile=snapshots/${iopmodel}_backup.snap
burtwb -f ${snapFile}
start${iopmodel}
done
for model in $(cat models/sub_models.txt); do
start${model}
snapFile=snapshots/${model}_backup.snap
burtwb -f ${snapFile}
start${model}
done
#!/usr/bin/env bash
# stop IOP models
echo "Stop IOP models"
# allow input of update directory
if [ "$# -gt 0" ]; then
UPDATE_DIR=$1
else
if [ "$UPDATE_DIR" ]; then
UPDATE_DIR=${UPDATE_DIR}
else
UPDATE_DIR=/var/update
fi
fi
#
source /opt/cdscfg/rtsetup.sh
#
cd ${UPDATE_DIR}
#
for model in $(cat models/iop_models.txt); do
echo "Stop "${model}
kill${model}
done
#!/usr/bin/env bash
# stop sub-models
echo "Stop sub-models"
# allow input of update directory
if [ "$# -gt 0" ]; then
UPDATE_DIR=$1
else
if [ "$UPDATE_DIR" ]; then
UPDATE_DIR=${UPDATE_DIR}
else
UPDATE_DIR=/var/update
fi
fi
#
source /opt/cdscfg/rtsetup.sh
#
cd ${UPDATE_DIR}
for model in $(cat models/sub_models.txt); do
echo "Stopping "${model}
kill${model}
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment