Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ff7c211
style: fix indentation in `.java` files
c-dilks Mar 7, 2025
605697e
build: use the same compiler plugins
c-dilks Mar 7, 2025
4d0680e
refactor!: remove `main` methods from monitoring classes
c-dilks Mar 7, 2025
c4aab6d
perf: remove unused variables, includes, and dead code
c-dilks Mar 8, 2025
f7fe5ff
refactor!: remove `plot` methods from monitoring classes
c-dilks Mar 8, 2025
1f506a9
refactor: `ana_2p2` should only call monitor's `processEvent` and `wr…
c-dilks Mar 8, 2025
aa4d5b0
refactor!: combine POM modules and organize source tree
c-dilks Mar 10, 2025
d240836
fix(ci): build-artifact path
c-dilks Mar 10, 2025
04516f4
fix: package name is `clas.timeline`, not `clas12.timeline`
c-dilks Mar 10, 2025
37f85c1
fix: classpath env var
c-dilks Mar 10, 2025
76037e3
fix: do not require groovy JARs to be in caller classpath
c-dilks Mar 10, 2025
b82d1b8
fix: DRY violation of classpath array in `environ.sh`
c-dilks Mar 10, 2025
ab4fee1
refactor: rename `main` Java and Groovy files
c-dilks Mar 10, 2025
02f4986
fix: include `groovy-yaml` as a dependency
c-dilks Mar 10, 2025
702b167
fix: try `snakeyaml`
c-dilks Mar 10, 2025
75eddac
build: bump version to 3.0.0
c-dilks Mar 10, 2025
52ed214
ci: tell dependabot to track `groovy.jfrog.io`
c-dilks Mar 10, 2025
f44713b
build: revert to `groovy-yaml`; still doesn't fix the bug
c-dilks Mar 10, 2025
0af7444
fix: simplify `install.sh`
c-dilks Mar 11, 2025
cd484c4
fix: do not use `run-groovy`
c-dilks Mar 11, 2025
026786a
fix: eliminate `$JYPATH`, which is only used by `run-groovy`
c-dilks Mar 11, 2025
1c93065
fix: use maven-packaged `groovy`, and use `snakeyaml` for parsing
c-dilks Mar 11, 2025
6abed8c
fix: full path to `run-groovy-timeline.sh`
c-dilks Mar 11, 2025
4e5238e
refactor!: remove `$TIMELINE_GROOVY_OPTS` env var
c-dilks Mar 11, 2025
77bc86c
refactor!: remove unused methods in `org.jlab.clas.timeline.histograms`
c-dilks Mar 11, 2025
5e6d8d1
doc: respect combination of `monitoring` and `detectors` maven modules
c-dilks Mar 11, 2025
495b6ba
refactor!: remove `occupancies.java`, for BST and BMT occupancy
c-dilks Mar 11, 2025
4fca8ae
refactor!: remove `deuterontarget.java`
c-dilks Mar 11, 2025
e48f63a
refactor: better names for histogramming Java classes
c-dilks Mar 11, 2025
1d9900f
refactor!: remove `dst_mon` histogramming class
c-dilks Mar 11, 2025
604f670
refactor!: remove unused CTOF and FTOF analysis `groovy` classes
c-dilks Mar 11, 2025
e3ec7e4
fix(build): `groovy-yaml` is in `groovy-all`
c-dilks Mar 12, 2025
2ac5970
build: bump version to 2.99.0
c-dilks Mar 12, 2025
295d235
refactor: rename analysis class methods...
c-dilks Mar 12, 2025
5a12fca
Merge branch 'main' into v3
c-dilks Mar 12, 2025
8b1cf96
Merge branch 'main' into v3
c-dilks Mar 12, 2025
f83c135
fix: consistent RCDB URIs
c-dilks Mar 19, 2025
318d35e
fix: do not require any of `coatjava`'s environment
c-dilks Mar 19, 2025
46f7e48
fix: all `java` calls should use `TIMELINE_JAVA_OPTS`
c-dilks Mar 19, 2025
666c980
fix: remove last remaining `CLASSPATH`
c-dilks Mar 19, 2025
23fccfe
style: snake case
c-dilks Mar 27, 2025
58f74b8
style: remove trailing whitespace
c-dilks Mar 27, 2025
5573d38
doc: more details in setup.md
c-dilks Mar 27, 2025
6ffc5d7
modified: doc/setup.md
c-dilks Mar 27, 2025
3c1dc1b
refactor: more renamings
c-dilks Mar 27, 2025
f4de52f
fix: executable path
c-dilks Mar 27, 2025
155abdc
Merge remote-tracking branch 'origin/main' into v3
c-dilks Apr 8, 2025
3ddab69
build: prefer 'plugins-release-local' artifactory repo, which has ONL…
c-dilks Apr 8, 2025
778d5c7
fix: ignore more `jdtls` dotfiles
c-dilks Apr 14, 2025
19f3dd5
Merge remote-tracking branch 'origin/main' into v3
c-dilks Apr 14, 2025
e53c33f
build: test `jfrog` repo `plugins-release`
c-dilks Apr 14, 2025
a1f4ecd
fix: bump slurm mem request
c-dilks Apr 14, 2025
cff4d0e
fix: source env vars in generated scripts
c-dilks Apr 15, 2025
5157761
fix: limit heap space for groovy too
c-dilks Apr 15, 2025
3953c8a
fix: use same options for `java` and `groovy`
c-dilks Apr 15, 2025
822e5a0
build: bump version
c-dilks Apr 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ registries:
clas12maven:
type: maven-repository
url: https://clasweb.jlab.org/clas12maven
groovy_jfrog:
type: maven-repository
url: https://groovy.jfrog.io/artifactory/plugins-release
Comment thread
c-dilks marked this conversation as resolved.

updates:
- package-ecosystem: "maven"
Expand All @@ -12,6 +15,7 @@ updates:
interval: "weekly"
registries:
- clas12maven
- groovy_jfrog
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
62 changes: 2 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ defaults:

env:
dataset: ci_test
rcdb_connection: mysql://rcdb@clasdb.jlab.org/rcdb # RCDB server available to runners
# NOTE: if any of these versions are changed, update the POM files too
java_version: 21
java_distribution: zulu
groovy_version: 4.x


concurrency:
Expand All @@ -38,42 +36,16 @@ jobs:
java-version: ${{ env.java_version }}
distribution: ${{ env.java_distribution }}
- name: build
run: mvn package
run: ./install.sh
- name: tar # to preserve any permissions
run: |
tar cavf build_detectors.tar.zst detectors/target
tar cavf build_monitoring.tar.zst monitoring/target
tar cavf build_timeline.tar.zst target
- uses: actions/upload-artifact@v4
with:
name: build_timelines
retention-days: 1
path: build*.tar.zst

build_coatjava:
runs-on: ubuntu-latest
steps:
- name: setup java
uses: actions/setup-java@v4
with:
java-version: ${{ env.java_version }}
distribution: ${{ env.java_distribution }}
- name: checkout coatjava
uses: actions/checkout@v4
with:
repository: JeffersonLab/coatjava
ref: development
- name: build coatjava
run: ./build-coatjava.sh
- name: tree
run: tree
- name: tar
run: tar cavf build_coatjava.tar.zst coatjava
- uses: actions/upload-artifact@v4
with:
name: build_coatjava
retention-days: 1
path: build*.tar.zst

# download test data
#############################################################################

Expand Down Expand Up @@ -112,7 +84,6 @@ jobs:
run_monitoring:
needs:
- build_timelines
- build_coatjava
- download_test_data
runs-on: ubuntu-latest
strategy:
Expand All @@ -125,12 +96,6 @@ jobs:
with:
java-version: ${{ env.java_version }}
distribution: ${{ env.java_distribution }}
- name: setup groovy
uses: wtfjoke/setup-groovy@v2
with:
groovy-version: ${{ env.groovy_version }}
- name: groovy version
run: groovy --version
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
Expand All @@ -144,8 +109,6 @@ jobs:
run: ls *.tar.zst | xargs -I{} tar xavf {}
- name: tree
run: tree
- name: set RCDB connection # to one that's available to the runner
run: echo RCDB_CONNECTION=${{env.rcdb_connection}} | tee -a $GITHUB_ENV
- name: run monitoring
run: bin/run-monitoring.sh -d ${{env.dataset}} --findhipo --series --focus-${{matrix.type}} validation_files
- name: tree slurm
Expand All @@ -166,7 +129,6 @@ jobs:
test_swifjob:
needs:
- build_timelines
- build_coatjava
- download_test_data
runs-on: ubuntu-latest
strategy:
Expand All @@ -179,12 +141,6 @@ jobs:
with:
java-version: ${{ env.java_version }}
distribution: ${{ env.java_distribution }}
- name: setup groovy
uses: wtfjoke/setup-groovy@v2
with:
groovy-version: ${{ env.groovy_version }}
- name: groovy version
run: groovy --version
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
Expand All @@ -198,8 +154,6 @@ jobs:
run: ls *.tar.zst | xargs -I{} tar xavf {}
- name: tree
run: tree
- name: set RCDB connection # to one that's available to the runner
run: echo RCDB_CONNECTION=${{env.rcdb_connection}} | tee -a $GITHUB_ENV
- name: test monitoring swifjob
run: |
single_rundir=$(find validation_files -mindepth 1 -maxdepth 1 -type d | head -n1)
Expand Down Expand Up @@ -227,12 +181,6 @@ jobs:
with:
java-version: ${{ env.java_version }}
distribution: ${{ env.java_distribution }}
- name: setup groovy
uses: wtfjoke/setup-groovy@v2
with:
groovy-version: ${{ env.groovy_version }}
- name: groovy version
run: groovy --version
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -266,12 +214,6 @@ jobs:
- run_timelines
runs-on: ubuntu-latest
steps:
- name: setup groovy
uses: wtfjoke/setup-groovy@v2
with:
groovy-version: ${{ env.groovy_version }}
- name: groovy version
run: groovy --version
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# text editor tmp files
.*.sw*
.sw*
.settings
.project
.classpath
.factorypath

# builds
detectors/target
monitoring/target
/target

# transient files
*.hipo
Expand Down
2 changes: 1 addition & 1 deletion bin/deploy-timelines.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ mkdir -pv $targetDir
cp -rv $inputDir/* $targetDir/
[ -n "$metadataFile" ] && cp -v $metadataFile $targetDir/metadata.json
[ -n "$readmeNote" ] && echo "$readmeNote" > $targetDir/README
run-groovy $TIMELINE_GROOVY_OPTS $TIMELINESRC/bin/index-webpage.groovy $targetDir
$TIMELINESRC/bin/run-groovy-timeline.sh $TIMELINESRC/bin/index-webpage.groovy $targetDir
echo "DONE."

# print URL
Expand Down
2 changes: 1 addition & 1 deletion bin/dump-timelines.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.jlab.groot.data.TDirectory
def outFilePrefix = "out"
if(args.length<1) {
System.err.println """
USAGE: run-groovy ${this.class.getSimpleName()}.groovy [TIMELINE] [OUTPUT FILE PREFIX]
USAGE: groovy ${this.class.getSimpleName()}.groovy [TIMELINE] [OUTPUT FILE PREFIX]
- [TIMELINE] may either be a timeline URL or a timeline HIPO file
- [OUTPUT FILE PREFIX] for the dumped timelines (default = $outFilePrefix)
"""
Expand Down
55 changes: 8 additions & 47 deletions bin/environ.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,24 @@ printWarning() { echo -e "\e[1;35m[WARNING]: $* \e[0m" >&2; }
# enable/disable verbose logger
log_config=logging # set to 'logging' for quiet, or to 'debug' for verbose

# get the working directory
[ -z "${BASH_SOURCE[0]}" ] && thisEnv=$0 || thisEnv=${BASH_SOURCE[0]}
export TIMELINESRC=$(realpath $(dirname $thisEnv)/..)
# get the source code directory
[ -z "${BASH_SOURCE[0]}" ] && this_env=$0 || this_env=${BASH_SOURCE[0]}
export TIMELINESRC=$(realpath $(dirname $this_env)/..)

# RCDB
[ -z "${RCDB_CONNECTION-}" ] && RCDB_CONNECTION=mysql://rcdb@clasdb-farm.jlab.org/rcdb
export RCDB_CONNECTION
[ -z "${RCDB_CONNECTION-}" ] && export RCDB_CONNECTION=mysql://rcdb@clasdb.jlab.org/rcdb

# check coatjava environment
if [ -z "${COATJAVA-}" ]; then
# if on a CI runner, use CI coatjava build artifacts; otherwise print error
coatjava_ci=$TIMELINESRC/coatjava
[ -d $coatjava_ci ] &&
export COATJAVA=$coatjava_ci ||
printError "cannot find coatjava; please make sure environment variable COATJAVA is set to your coatjava installation"
fi

# ensure coatjava executables are found
[ -n "${COATJAVA-}" ] && export PATH="$COATJAVA/bin${PATH:+:${PATH}}"

# class paths
java_classpath=(
"$COATJAVA/lib/clas/*"
"$COATJAVA/lib/utils/*"
"$TIMELINESRC/monitoring/target/*"
)
groovy_classpath=(
"$TIMELINESRC/detectors/target/*"
"$(dirname $(dirname $(which groovy)))/lib/*"
)

# java and groovy options
# java options
timeline_java_opts=(
-DCLAS12DIR=$COATJAVA/
-Djava.util.logging.config.file=$COATJAVA/etc/logging/$log_config.properties
-cp "$TIMELINESRC/target/*:$TIMELINESRC/target/dependency/*"
-Djava.util.logging.config.file=$TIMELINESRC/data/logging/$log_config.properties
-Xmx1536m
-XX:+UseSerialGC
)
timeline_groovy_opts=(
-Djava.awt.headless=true
)

# run java with more resources, to mitigate large memory residence for long run periods
timeline_java_opts_highmem=$(echo ${timeline_java_opts[*]} | sed 's;Xmx1024m;Xmx2048m;')

# exports
export CLASSPATH="$(echo "${java_classpath[*]}" | sed 's; ;:;g')${CLASSPATH:+:${CLASSPATH}}"
export JYPATH="$(echo "${groovy_classpath[*]}" | sed 's; ;:;g')${JYPATH:+:${JYPATH}}"
export TIMELINE_JAVA_OPTS="${timeline_java_opts[*]}"
export TIMELINE_GROOVY_OPTS="${timeline_groovy_opts[*]}"
export TIMELINE_JAVA_OPTS_HIGHMEM=$timeline_java_opts_highmem

# cleanup vars
unset thisEnv
unset this_env
unset log_config
unset java_classpath
unset groovy_classpath
unset timeline_java_opts
unset timeline_groovy_opts
unset timeline_java_opts_highmem
5 changes: 1 addition & 4 deletions bin/get-beam-energy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ set -e
set -u
source $(dirname $0)/environ.sh

# set class path to include groovy's classpath, for `java` calls
export CLASSPATH="$JYPATH${CLASSPATH:+:${CLASSPATH}}"

java org.jlab.clas.timeline.get_beam_energy $*
java $TIMELINE_JAVA_OPTS org.jlab.clas.timeline.get_beam_energy $*
2 changes: 1 addition & 1 deletion bin/get-run-number.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tools T = new Tools()

if(args.length<1) {
System.err.println """
USAGE: run-groovy ${this.class.getSimpleName()}.groovy [HIPO file]
USAGE: groovy ${this.class.getSimpleName()}.groovy [HIPO file]
Returns run number for a given file
"""
System.exit(101)
Expand Down
2 changes: 1 addition & 1 deletion bin/hipo-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ for hipoFile in ${hipoFiles[@]}; do

# run `hipo-utils -test`
set +e
hipo-utils -test $hipoFile
java $TIMELINE_JAVA_OPTS org.jlab.jnp.hipo4.utils.HipoUtilities -test $hipoFile
testCode=$?
set -e
[ $testCode -ne 0 ] && markBad $hipoFile "\`hipo-utils -test\` failed" && continue
Expand Down
4 changes: 2 additions & 2 deletions bin/hipo-trim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ for inputDir in $inputDirs; do
outputSubDir: $outputSubDir
"""

# if the output file exists, `hipo-utils -filter` will fail
# if the output file exists, `HipoUtilities -filter` will fail
if [ -f $outputFile ]; then
echo """
ERROR: this output file already exists...
Expand All @@ -69,7 +69,7 @@ for inputDir in $inputDirs; do
mkdir -pv $outputSubDir

# trim the input file
hipo-utils -filter \
java $TIMELINE_JAVA_OPTS org.jlab.jnp.hipo4.utils.HipoUtilities -filter \
-b "*::*" \
-n $nEvents \
-o $outputFile \
Expand Down
2 changes: 1 addition & 1 deletion bin/index-webpage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import groovy.json.JsonOutput

if(args.length!=1) {
System.err.println """
USAGE: run-groovy ${this.class.getSimpleName()}.groovy [WEBSERVER_DIRECTORY]
USAGE: groovy ${this.class.getSimpleName()}.groovy [WEBSERVER_DIRECTORY]
"""
System.exit(101)
}
Expand Down
28 changes: 7 additions & 21 deletions bin/run-detectors-timelines.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ outputDir=""
numThreads=8
singleTimeline=""
declare -A modes
for key in list build skip-mya focus-timelines focus-qa debug help; do
for key in list skip-mya focus-timelines focus-qa debug help; do
modes[$key]=false
done

Expand Down Expand Up @@ -48,8 +48,6 @@ usage() {

--list dump the list of timelines and exit

--build cleanly-rebuild the timeline code, then run

--skip-mya skip timelines which require MYA (needed if running offsite or on CI)

--focus-timelines only produce the detector timelines, do not run detector QA code
Expand Down Expand Up @@ -92,17 +90,14 @@ if ${modes['help']}; then
exit 101
fi

# set class path to include groovy's classpath, for `java` calls
export CLASSPATH="$JYPATH${CLASSPATH:+:${CLASSPATH}}"

# get main executable for detector timelines
run_detectors_script="org.jlab.clas.timeline.run_detectors"
run_analysis_script="org.jlab.clas.timeline.analysis.run_analysis"

# build list of timelines
if ${modes['skip-mya']}; then
timelineList=$(java $run_detectors_script --timelines | grep -vE '^epics_' | sort | grep $match)
timelineList=$(java $TIMELINE_JAVA_OPTS $run_analysis_script --timelines | grep -vE '^epics_' | sort | grep $match)
else
timelineList=$(java $run_detectors_script --timelines | sort | grep $match)
timelineList=$(java $TIMELINE_JAVA_OPTS $run_analysis_script --timelines | sort | grep $match)
fi

# list detector timelines, if requested
Expand Down Expand Up @@ -145,15 +140,6 @@ OPTIONS = {"""
for key in "${!modes[@]}"; do printf "%20s => %s,\n" $key ${modes[$key]}; done
echo "}"

# rebuild, if desired
if ${modes['build']}; then
echo "building detector timeline"
pushd $TIMELINESRC/detectors
mvn clean package
[ $? -ne 0 ] && exit 100
popd
fi

# output detector subdirectories
detDirs=(
band
Expand Down Expand Up @@ -238,11 +224,11 @@ if ${modes['focus-all']} || ${modes['focus-timelines']}; then
[ -n "$singleTimeline" -a "$timelineObj" != "$singleTimeline" ] && continue
echo ">>> producing timeline '$timelineObj' ..."
if ${modes['debug']}; then
java $TIMELINE_JAVA_OPTS $run_detectors_script $timelineObj $inputDir
java $TIMELINE_JAVA_OPTS $run_analysis_script $timelineObj $inputDir
echo "PREMATURE EXIT, since --debug option was used"
exit
else
java $TIMELINE_JAVA_OPTS $run_detectors_script $timelineObj $inputDir > $logFile.out 2> $logFile.err || touch $logFile.fail &
java $TIMELINE_JAVA_OPTS $run_analysis_script $timelineObj $inputDir > $logFile.out 2> $logFile.err || touch $logFile.fail &
job_ids+=($!)
job_names+=($timelineObj)
fi
Expand Down Expand Up @@ -308,7 +294,7 @@ cp -rL $finalDirPreQA/* $finalDir/
if ${modes['focus-all']} || ${modes['focus-qa']}; then
echo ">>> add QA lines..."
logFile=$logDir/qa
run-groovy $TIMELINE_GROOVY_OPTS $TIMELINESRC/qa-detectors/util/applyBounds.groovy $finalDirPreQA $finalDir > $logFile.out 2> $logFile.err || touch $logFile.fail
$TIMELINESRC/bin/run-groovy-timeline.sh $TIMELINESRC/qa-detectors/util/applyBounds.groovy $finalDirPreQA $finalDir > $logFile.out 2> $logFile.err || touch $logFile.fail
outputFiles=$(find $finalDir -name "*_QA.hipo")
[ -n "$outputFiles" ] && $TIMELINESRC/bin/hipo-check.sh $outputFiles
fi
Expand Down
Loading