diff --git a/scripts/elog_par_post b/scripts/elog_par_post index decc28e4..15a918ba 100755 --- a/scripts/elog_par_post +++ b/scripts/elog_par_post @@ -2,6 +2,7 @@ import requests from requests.auth import HTTPBasicAuth import argparse +import socket def readRunTable(fname): runTableData={} @@ -20,7 +21,11 @@ def postRunTableDict(runtable_data, experiment, run): ws_url = args_url + "/run_control/{0}/ws/add_run_params".format(experiment) print('URL:',ws_url) user=experiment[:3]+'opr' - with open('/cds/home/opr/%s/forElogPost.txt'%user,'r') as reader: + elogPostFile='/cds/home/opr/%s/forElogPost.txt'%user + hostname=socket.gethostname() + if hostname.find('sdf')>=0: + elogPostFile='/sdf/group/lcls/ds/tools/forElogPost.txt' + with open(elogPostFile,'r') as reader: answer = reader.readline() r = requests.post(ws_url, params={"run_num": run}, json=runtable_data, \ auth=HTTPBasicAuth(experiment[:3]+'opr', answer[:-1])) diff --git a/scripts/makepeds b/scripts/makepeds index c170082b..5f877da4 100755 --- a/scripts/makepeds +++ b/scripts/makepeds @@ -161,8 +161,9 @@ FFB=${FFB:=0} QUEUE=${QUEUE:='xxx'} INTERACTIVE=${INTERACTIVE:=0} -FFBQUEUES=('anaq' 'ffbh1q' 'ffbl1q' 'ffbh2q' 'ffbl2q' 'ffbh3q' 'ffbl3q' 'ffbh4q' 'ffbl4q') -ANAQUEUES=('psanagpuq' 'psanaq' 'psfehq' 'psfehprioq' 'psfehhiprioq') +FFBQUEUES=('anaq' 'ffbh1q' 'ffbl1q' 'ffbh2q' 'ffbl2q' 'ffbh3q' 'ffbl3q' 'ffbgpuq') +ANAQUEUES=('psanagpuq' 'psanaq') +SDFQUEUES=('milano' 'roma') for FFBQUEUE in ${FFBQUEUES[@]}; do if [[ $QUEUE == $FFBQUEUE ]]; then FFB=1 @@ -177,6 +178,14 @@ for ANAQUEUE in ${ANAQUEUES[@]}; do fi done +for SDFQUEUE in ${SDFQUEUES[@]}; do + if [[ $QUEUE == $SDFQUEUE ]]; then + FFB=2 + break + fi +done + + if [[ $RUN == 0 ]]; then if [[ $INTERACTIVE == 0 ]]; then printf "Please enter a run number: \n"; read RUN @@ -192,7 +201,7 @@ else HUTCH=${EXP:0:3} fi -if [[ $HOSTNAME =~ "psana" ]] || [[ $HOSTNAME =~ "drp-srcf" ]]; then +if [[ $HOSTNAME =~ "psana" ]] || [[ $HOSTNAME =~ "drp-srcf" ]] || [[ $HOSTNAME =~ "sdf" ]]; then #echo $DIR/makepeds_psana $@ $DIR/makepeds_psana $@ else @@ -204,6 +213,12 @@ else echo calling on FFB system: makepeds_psana $@ echo ssh -Y $USER@psffb "$DIR/makepeds_psana $@" ssh -Y $USER@psffb "$DIR/makepeds_psana $@" + elif [[ $FFB == 2 ]]; then + echo calling on SDF system: makepeds_psana $@ + #we need to change paths here as directories are completely independent + DIR=`echo $DIR | sed s/cds/sdf/g | sed 's/\/reg\/g\/pcds/\/sed\/group\/lcls\/ds\/tools/g'` + echo ssh -Y $USER@s3dflogin ssh -Y psana "$DIR/makepeds_psana $@" + ssh -Y $USER@s3dflogin ssh -Y psana "$DIR/makepeds_psana $@" else echo calling on offline system: makepeds_psana $@ echo ssh -Y $USER@psana "$DIR/makepeds_psana $@" @@ -211,15 +226,24 @@ else fi fi -source pcds_conda +if [[ $HOSTNAME =~ "sdf" ]]; then + source /sdf/group/lcls/ds/ana/sw/conda1/manage/bin/psconda.sh +else + source pcds_conda +fi elog_par_post --file pedestal -e "$EXP" -r $RUN -#if this is a default pedestal run, then do not post as this is handled in the pedestal scripts +#if this is a default pedestal run, then do not post as this is handled in takepeds if [[ $elogMessage == 'DARK' ]] && [[ $ELOGTXT == '' ]] ; then echo ---- Done processing pedestals for Run $RUN ----- exit 0 fi +if [[ $HOSTNAME =~ "sdf" ]]; then + echo Posting messages to the elog is currently not implemented from S3DF yet + exit 0 +fi + PYCMD=LogBookPost.py echo -- Now posting special message to elog -- echo -- $elogMessage -- @@ -232,7 +256,6 @@ if [[ `whoami` =~ "opr" ]]; then else $BINPATH $PYCMD -i "${HUTCH^^}" -u `whoami` -p pcds -e "$EXP" -t DARK -r $RUN -m "$elogMessage"& fi - elog_par_post --file pedestal -e "$EXP" -r $RUN else echo $BINPATH $PYCMD -i "${HUTCH^^}" -e "$EXP" -t DARK -r $RUN -m "$elogMessage" if [[ $HOSTNAME == 'cxi-monitor' ]]; then