Skip to content

Commit a5754da

Browse files
authored
refactor: bin/ for user scripts, libexec/ for internal scripts (#300)
1 parent 7ff235b commit a5754da

27 files changed

Lines changed: 52 additions & 49 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ jobs:
158158
run: |
159159
single_rundir=$(find validation_files -mindepth 1 -maxdepth 1 -type d | head -n1)
160160
echo "single_rundir = $single_rundir"
161-
bin/test-swifjob.sh $single_rundir runner --focus-${{ matrix.type }}
161+
util/test-swifjob.sh $single_rundir runner --focus-${{ matrix.type }}
162162
- name: tree runner
163163
run: tree runner
164164

bin/deploy-timelines.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
set -e
55
set -u
6-
source $(dirname $0)/environ.sh
6+
source $(dirname $0)/../libexec/environ.sh
77

88
# timeline webserver directory
99
TIMELINEDIR=/u/group/clas/www/clas12mon/html/hipo
1010

1111
# input finding command
12-
inputCmd="$TIMELINESRC/bin/set-input-dir.sh -s timeline_web"
12+
inputCmd="$TIMELINESRC/libexec/set-input-dir.sh -s timeline_web"
1313
inputCmdOpts=""
1414

1515
usage() {
@@ -169,7 +169,7 @@ mkdir -pv $targetDir
169169
cp -rv $inputDir/* $targetDir/
170170
[ -n "$metadataFile" ] && cp -v $metadataFile $targetDir/metadata.json
171171
[ -n "$readmeNote" ] && echo "$readmeNote" > $targetDir/README
172-
$TIMELINESRC/bin/run-groovy-timeline.sh $TIMELINESRC/bin/index-webpage.groovy $targetDir
172+
$TIMELINESRC/libexec/run-groovy-timeline.sh $TIMELINESRC/libexec/index-webpage.groovy $targetDir
173173
echo "DONE."
174174

175175
# print URL

bin/run-detectors-timelines.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44
set -u
5-
source $(dirname $0)/environ.sh
5+
source $(dirname $0)/../libexec/environ.sh
66

77
# default options
88
match="^"
@@ -17,7 +17,7 @@ for key in list skip-mya focus-timelines focus-qa debug help; do
1717
done
1818

1919
# input finding command
20-
inputCmd="$TIMELINESRC/bin/set-input-dir.sh -s timeline_detectors"
20+
inputCmd="$TIMELINESRC/libexec/set-input-dir.sh -s timeline_detectors"
2121
inputCmdOpts=""
2222

2323
# usage
@@ -269,7 +269,7 @@ if ${modes['focus-all']} || ${modes['focus-timelines']}; then
269269
outputFiles=$(find . -name "*.hipo")
270270
if [ -n "$outputFiles" ]; then
271271
logFile=$logDir/hipo-check
272-
$TIMELINESRC/bin/hipo-check.sh --rm-bad $outputFiles > $logFile.out 2> $logFile.err || touch $logFile.fail
272+
$TIMELINESRC/libexec/hipo-check.sh --rm-bad $outputFiles > $logFile.out 2> $logFile.err || touch $logFile.fail
273273
fi
274274

275275
# remove any empty directories
@@ -294,9 +294,9 @@ cp -rL $finalDirPreQA/* $finalDir/
294294
if ${modes['focus-all']} || ${modes['focus-qa']}; then
295295
echo ">>> add QA lines..."
296296
logFile=$logDir/qa
297-
$TIMELINESRC/bin/run-groovy-timeline.sh $TIMELINESRC/qa-detectors/util/applyBounds.groovy $finalDirPreQA $finalDir > $logFile.out 2> $logFile.err || touch $logFile.fail
297+
$TIMELINESRC/libexec/run-groovy-timeline.sh $TIMELINESRC/qa-detectors/util/applyBounds.groovy $finalDirPreQA $finalDir > $logFile.out 2> $logFile.err || touch $logFile.fail
298298
outputFiles=$(find $finalDir -name "*_QA.hipo")
299-
[ -n "$outputFiles" ] && $TIMELINESRC/bin/hipo-check.sh $outputFiles
299+
[ -n "$outputFiles" ] && $TIMELINESRC/libexec/hipo-check.sh $outputFiles
300300
fi
301301

302302

bin/run-monitoring.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44
set -u
5-
source $(dirname $0)/environ.sh
5+
source $(dirname $0)/../libexec/environ.sh
66

77
# constants ############################################################
88
# max number of events for detector monitoring timelines
@@ -258,7 +258,7 @@ $sep
258258
# check cache (and exit), if requested
259259
if ${modes['check-cache']}; then
260260
echo "Cross-checking /cache and /mss..."
261-
$TIMELINESRC/bin/check-cache.sh ${rdirs[@]}
261+
$TIMELINESRC/libexec/check-cache.sh ${rdirs[@]}
262262
exit $?
263263
fi
264264

@@ -306,14 +306,14 @@ for rdir in ${rdirs[@]}; do
306306
runnum=$(basename $rdir | grep -m1 -o -E "[0-9]+" || echo '') # first, try from run directory (or file) basename
307307
if [ -z "$runnum" ] || ${modes['swifjob']}; then # otherwise, use RUN::config from a HIPO file (NOTE: assumes all HIPO files have the same run number)
308308
if ${modes['flatdir']}; then
309-
$TIMELINESRC/bin/hipo-check.sh $rdir
310-
runnum=$($TIMELINESRC/bin/run-groovy-timeline.sh $TIMELINESRC/bin/get-run-number.groovy $rdir | tail -n1 | grep -m1 -o -E "[0-9]+" || echo '')
309+
$TIMELINESRC/libexec/hipo-check.sh $rdir
310+
runnum=$($TIMELINESRC/libexec/run-groovy-timeline.sh $TIMELINESRC/libexec/get-run-number.groovy $rdir | tail -n1 | grep -m1 -o -E "[0-9]+" || echo '')
311311
else
312312
firstHipo=$(find $rdir -name "*.hipo" | head -n1)
313313
[ -z "$firstHipo" ] && printError "no HIPO files in run directory '$rdir'; cannot get run number or create job" && continue
314314
echo "using HIPO file $firstHipo to get run number for run directory '$rdir'"
315-
$TIMELINESRC/bin/hipo-check.sh $firstHipo
316-
runnum=$($TIMELINESRC/bin/run-groovy-timeline.sh $TIMELINESRC/bin/get-run-number.groovy $firstHipo | tail -n1 | grep -m1 -o -E "[0-9]+" || echo '')
315+
$TIMELINESRC/libexec/hipo-check.sh $firstHipo
316+
runnum=$($TIMELINESRC/libexec/run-groovy-timeline.sh $TIMELINESRC/libexec/get-run-number.groovy $firstHipo | tail -n1 | grep -m1 -o -E "[0-9]+" || echo '')
317317
fi
318318
fi
319319
[ -z "$runnum" -o $runnum -eq 0 ] && printError "unknown run number for '$rdir'; ignoring it!" && continue
@@ -348,7 +348,7 @@ for rdir in ${rdirs[@]}; do
348348

349349
# get beam energy from RCDB
350350
echo "Retrieving beam energy from RCDB..."
351-
beam_energy=$($TIMELINESRC/bin/get-beam-energy.sh $runnum | tail -n1)
351+
beam_energy=$($TIMELINESRC/libexec/get-beam-energy.sh $runnum | tail -n1)
352352
# override beam energy, for cases where RCDB is incorrect
353353
# - currently only needed for RG-F
354354
beam_energy_override=`python -c """
@@ -386,7 +386,7 @@ set -o pipefail
386386
echo "RUN $runnum"
387387
388388
# set env vars
389-
source $TIMELINESRC/bin/environ.sh
389+
source $TIMELINESRC/libexec/environ.sh
390390
391391
# produce histograms
392392
java $TIMELINE_JAVA_OPTS \\
@@ -398,7 +398,7 @@ java $TIMELINE_JAVA_OPTS \\
398398
$beam_energy
399399
400400
# check output HIPO files
401-
$TIMELINESRC/bin/hipo-check.sh \$(find $outputSubDir -name "*.hipo")
401+
$TIMELINESRC/libexec/hipo-check.sh \$(find $outputSubDir -name "*.hipo")
402402
EOF
403403
;;
404404

@@ -416,10 +416,10 @@ set -o pipefail
416416
echo "RUN $runnum"
417417
418418
# set env vars
419-
source $TIMELINESRC/bin/environ.sh
419+
source $TIMELINESRC/libexec/environ.sh
420420
421421
# produce histograms
422-
$TIMELINESRC/bin/run-groovy-timeline.sh \\
422+
$TIMELINESRC/libexec/run-groovy-timeline.sh \\
423423
$TIMELINESRC/qa-physics/monitorRead.groovy \\
424424
$(realpath $rdir) \\
425425
$outputSubDir \\
@@ -428,7 +428,7 @@ $TIMELINESRC/bin/run-groovy-timeline.sh \\
428428
$beam_energy
429429
430430
# check output HIPO files
431-
$TIMELINESRC/bin/hipo-check.sh \$(find $outputSubDir -name "*.hipo")
431+
$TIMELINESRC/libexec/hipo-check.sh \$(find $outputSubDir -name "*.hipo")
432432
EOF
433433
;;
434434

bin/run-physics-timelines.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
set -e
44
set -u
5-
source $(dirname $0)/environ.sh
5+
source $(dirname $0)/../libexec/environ.sh
66

77
# default options
88
inputDir=""
99
dataset=""
1010
outputDir=""
1111

1212
# input finding command
13-
inputCmd="$TIMELINESRC/bin/set-input-dir.sh -s timeline_physics"
13+
inputCmd="$TIMELINESRC/libexec/set-input-dir.sh -s timeline_physics"
1414
inputCmdOpts=""
1515

1616
# usage
@@ -108,23 +108,23 @@ function exe {
108108
exe ./datasetOrganize.sh $dataset $inputDir $qaDir
109109

110110
# produce chargeTree.json
111-
exe $TIMELINESRC/bin/run-groovy-timeline.sh buildChargeTree.groovy $qaDir
111+
exe $TIMELINESRC/libexec/run-groovy-timeline.sh buildChargeTree.groovy $qaDir
112112

113113
# loop over datasets
114114
# trigger electrons monitor
115-
exe $TIMELINESRC/bin/run-groovy-timeline.sh qaPlot.groovy $qaDir
116-
exe $TIMELINESRC/bin/run-groovy-timeline.sh qaCut.groovy $qaDir $dataset
115+
exe $TIMELINESRC/libexec/run-groovy-timeline.sh qaPlot.groovy $qaDir
116+
exe $TIMELINESRC/libexec/run-groovy-timeline.sh qaCut.groovy $qaDir $dataset
117117
# FT electrons
118-
exe $TIMELINESRC/bin/run-groovy-timeline.sh qaPlot.groovy $qaDir FT
119-
exe $TIMELINESRC/bin/run-groovy-timeline.sh qaCut.groovy $qaDir $dataset FT
118+
exe $TIMELINESRC/libexec/run-groovy-timeline.sh qaPlot.groovy $qaDir FT
119+
exe $TIMELINESRC/libexec/run-groovy-timeline.sh qaCut.groovy $qaDir $dataset FT
120120
# meld FT and FD JSON files
121-
exe $TIMELINESRC/bin/run-groovy-timeline.sh mergeFTandFD.groovy $qaDir
121+
exe $TIMELINESRC/libexec/run-groovy-timeline.sh mergeFTandFD.groovy $qaDir
122122
# general monitor
123-
exe $TIMELINESRC/bin/run-groovy-timeline.sh monitorPlot.groovy $qaDir
123+
exe $TIMELINESRC/libexec/run-groovy-timeline.sh monitorPlot.groovy $qaDir
124124
# move timelines to output area
125125
exe ./stageTimelines.sh $qaDir $finalDir
126126
# trash empty files
127-
exe $TIMELINESRC/bin/run-groovy-timeline.sh $TIMELINESRC/qa-physics/removeEmptyFiles.groovy $outputDir/trash $finalDir
127+
exe $TIMELINESRC/libexec/run-groovy-timeline.sh $TIMELINESRC/qa-physics/removeEmptyFiles.groovy $outputDir/trash $finalDir
128128

129129
popd
130130

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ for cacheRunDir in ${cacheRunDirList[@]}; do
8282
<(ls $cacheRunDir) \\
8383
<(ls $tapeRunDir)
8484
"""
85-
echo "$TIMELINESRC/bin/jcacheRun.sh $(echo $cacheRunDir | sed 's;^.*/cache/;/cache/;')" >> $jcacheList
85+
echo "$TIMELINESRC/libexec/jcache-run.sh $(echo $cacheRunDir | sed 's;^.*/cache/;/cache/;')" >> $jcacheList
8686
fi
8787
fi
8888
done
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)