Skip to content

Commit 7ff235b

Browse files
authored
refactor!: massive cleanup (#293)
1 parent 2abd017 commit 7ff235b

234 files changed

Lines changed: 9052 additions & 15633 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ registries:
44
clas12maven:
55
type: maven-repository
66
url: https://clasweb.jlab.org/clas12maven
7+
groovy_jfrog:
8+
type: maven-repository
9+
url: https://groovy.jfrog.io/artifactory/plugins-release
710

811
updates:
912
- package-ecosystem: "maven"
@@ -12,6 +15,7 @@ updates:
1215
interval: "weekly"
1316
registries:
1417
- clas12maven
18+
- groovy_jfrog
1519
- package-ecosystem: "github-actions"
1620
directory: "/"
1721
schedule:

.github/workflows/ci.yml

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ defaults:
1212

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

2119

2220
concurrency:
@@ -38,42 +36,16 @@ jobs:
3836
java-version: ${{ env.java_version }}
3937
distribution: ${{ env.java_distribution }}
4038
- name: build
41-
run: mvn package
39+
run: ./install.sh
4240
- name: tar # to preserve any permissions
4341
run: |
44-
tar cavf build_detectors.tar.zst detectors/target
45-
tar cavf build_monitoring.tar.zst monitoring/target
42+
tar cavf build_timeline.tar.zst target
4643
- uses: actions/upload-artifact@v4
4744
with:
4845
name: build_timelines
4946
retention-days: 1
5047
path: build*.tar.zst
5148

52-
build_coatjava:
53-
runs-on: ubuntu-latest
54-
steps:
55-
- name: setup java
56-
uses: actions/setup-java@v4
57-
with:
58-
java-version: ${{ env.java_version }}
59-
distribution: ${{ env.java_distribution }}
60-
- name: checkout coatjava
61-
uses: actions/checkout@v4
62-
with:
63-
repository: JeffersonLab/coatjava
64-
ref: development
65-
- name: build coatjava
66-
run: ./build-coatjava.sh
67-
- name: tree
68-
run: tree
69-
- name: tar
70-
run: tar cavf build_coatjava.tar.zst coatjava
71-
- uses: actions/upload-artifact@v4
72-
with:
73-
name: build_coatjava
74-
retention-days: 1
75-
path: build*.tar.zst
76-
7749
# download test data
7850
#############################################################################
7951

@@ -112,7 +84,6 @@ jobs:
11284
run_monitoring:
11385
needs:
11486
- build_timelines
115-
- build_coatjava
11687
- download_test_data
11788
runs-on: ubuntu-latest
11889
strategy:
@@ -125,12 +96,6 @@ jobs:
12596
with:
12697
java-version: ${{ env.java_version }}
12798
distribution: ${{ env.java_distribution }}
128-
- name: setup groovy
129-
uses: wtfjoke/setup-groovy@v2
130-
with:
131-
groovy-version: ${{ env.groovy_version }}
132-
- name: groovy version
133-
run: groovy --version
13499
- uses: actions/checkout@v4
135100
- uses: actions/cache/restore@v4
136101
with:
@@ -144,8 +109,6 @@ jobs:
144109
run: ls *.tar.zst | xargs -I{} tar xavf {}
145110
- name: tree
146111
run: tree
147-
- name: set RCDB connection # to one that's available to the runner
148-
run: echo RCDB_CONNECTION=${{env.rcdb_connection}} | tee -a $GITHUB_ENV
149112
- name: run monitoring
150113
run: bin/run-monitoring.sh -d ${{env.dataset}} --findhipo --series --focus-${{matrix.type}} validation_files
151114
- name: tree slurm
@@ -166,7 +129,6 @@ jobs:
166129
test_swifjob:
167130
needs:
168131
- build_timelines
169-
- build_coatjava
170132
- download_test_data
171133
runs-on: ubuntu-latest
172134
strategy:
@@ -179,12 +141,6 @@ jobs:
179141
with:
180142
java-version: ${{ env.java_version }}
181143
distribution: ${{ env.java_distribution }}
182-
- name: setup groovy
183-
uses: wtfjoke/setup-groovy@v2
184-
with:
185-
groovy-version: ${{ env.groovy_version }}
186-
- name: groovy version
187-
run: groovy --version
188144
- uses: actions/checkout@v4
189145
- uses: actions/cache/restore@v4
190146
with:
@@ -198,8 +154,6 @@ jobs:
198154
run: ls *.tar.zst | xargs -I{} tar xavf {}
199155
- name: tree
200156
run: tree
201-
- name: set RCDB connection # to one that's available to the runner
202-
run: echo RCDB_CONNECTION=${{env.rcdb_connection}} | tee -a $GITHUB_ENV
203157
- name: test monitoring swifjob
204158
run: |
205159
single_rundir=$(find validation_files -mindepth 1 -maxdepth 1 -type d | head -n1)
@@ -227,12 +181,6 @@ jobs:
227181
with:
228182
java-version: ${{ env.java_version }}
229183
distribution: ${{ env.java_distribution }}
230-
- name: setup groovy
231-
uses: wtfjoke/setup-groovy@v2
232-
with:
233-
groovy-version: ${{ env.groovy_version }}
234-
- name: groovy version
235-
run: groovy --version
236184
- uses: actions/checkout@v4
237185
- uses: actions/download-artifact@v4
238186
with:
@@ -266,12 +214,6 @@ jobs:
266214
- run_timelines
267215
runs-on: ubuntu-latest
268216
steps:
269-
- name: setup groovy
270-
uses: wtfjoke/setup-groovy@v2
271-
with:
272-
groovy-version: ${{ env.groovy_version }}
273-
- name: groovy version
274-
run: groovy --version
275217
- uses: actions/checkout@v4
276218
- uses: actions/download-artifact@v4
277219
with:

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# text editor tmp files
22
.*.sw*
33
.sw*
4+
.settings
5+
.project
6+
.classpath
7+
.factorypath
48

59
# builds
6-
detectors/target
7-
monitoring/target
10+
/target
811

912
# transient files
1013
*.hipo

bin/deploy-timelines.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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-
run-groovy $TIMELINE_GROOVY_OPTS $TIMELINESRC/bin/index-webpage.groovy $targetDir
172+
$TIMELINESRC/bin/run-groovy-timeline.sh $TIMELINESRC/bin/index-webpage.groovy $targetDir
173173
echo "DONE."
174174

175175
# print URL

bin/dump-timelines.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import org.jlab.groot.data.TDirectory
44
def outFilePrefix = "out"
55
if(args.length<1) {
66
System.err.println """
7-
USAGE: run-groovy ${this.class.getSimpleName()}.groovy [TIMELINE] [OUTPUT FILE PREFIX]
7+
USAGE: groovy ${this.class.getSimpleName()}.groovy [TIMELINE] [OUTPUT FILE PREFIX]
88
- [TIMELINE] may either be a timeline URL or a timeline HIPO file
99
- [OUTPUT FILE PREFIX] for the dumped timelines (default = $outFilePrefix)
1010
"""

bin/environ.sh

Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,63 +7,24 @@ printWarning() { echo -e "\e[1;35m[WARNING]: $* \e[0m" >&2; }
77
# enable/disable verbose logger
88
log_config=logging # set to 'logging' for quiet, or to 'debug' for verbose
99

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

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

18-
# check coatjava environment
19-
if [ -z "${COATJAVA-}" ]; then
20-
# if on a CI runner, use CI coatjava build artifacts; otherwise print error
21-
coatjava_ci=$TIMELINESRC/coatjava
22-
[ -d $coatjava_ci ] &&
23-
export COATJAVA=$coatjava_ci ||
24-
printError "cannot find coatjava; please make sure environment variable COATJAVA is set to your coatjava installation"
25-
fi
26-
27-
# ensure coatjava executables are found
28-
[ -n "${COATJAVA-}" ] && export PATH="$COATJAVA/bin${PATH:+:${PATH}}"
29-
30-
# class paths
31-
java_classpath=(
32-
"$COATJAVA/lib/clas/*"
33-
"$COATJAVA/lib/utils/*"
34-
"$TIMELINESRC/monitoring/target/*"
35-
)
36-
groovy_classpath=(
37-
"$TIMELINESRC/detectors/target/*"
38-
"$(dirname $(dirname $(which groovy)))/lib/*"
39-
)
40-
41-
# java and groovy options
17+
# java options
4218
timeline_java_opts=(
43-
-DCLAS12DIR=$COATJAVA/
44-
-Djava.util.logging.config.file=$COATJAVA/etc/logging/$log_config.properties
19+
-cp "$TIMELINESRC/target/*:$TIMELINESRC/target/dependency/*"
20+
-Djava.util.logging.config.file=$TIMELINESRC/data/logging/$log_config.properties
4521
-Xmx1536m
4622
-XX:+UseSerialGC
47-
)
48-
timeline_groovy_opts=(
4923
-Djava.awt.headless=true
5024
)
51-
52-
# run java with more resources, to mitigate large memory residence for long run periods
53-
timeline_java_opts_highmem=$(echo ${timeline_java_opts[*]} | sed 's;Xmx1024m;Xmx2048m;')
54-
55-
# exports
56-
export CLASSPATH="$(echo "${java_classpath[*]}" | sed 's; ;:;g')${CLASSPATH:+:${CLASSPATH}}"
57-
export JYPATH="$(echo "${groovy_classpath[*]}" | sed 's; ;:;g')${JYPATH:+:${JYPATH}}"
5825
export TIMELINE_JAVA_OPTS="${timeline_java_opts[*]}"
59-
export TIMELINE_GROOVY_OPTS="${timeline_groovy_opts[*]}"
60-
export TIMELINE_JAVA_OPTS_HIGHMEM=$timeline_java_opts_highmem
6126

6227
# cleanup vars
63-
unset thisEnv
28+
unset this_env
6429
unset log_config
65-
unset java_classpath
66-
unset groovy_classpath
6730
unset timeline_java_opts
68-
unset timeline_groovy_opts
69-
unset timeline_java_opts_highmem

bin/get-beam-energy.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,4 @@ set -e
44
set -u
55
source $(dirname $0)/environ.sh
66

7-
# set class path to include groovy's classpath, for `java` calls
8-
export CLASSPATH="$JYPATH${CLASSPATH:+:${CLASSPATH}}"
9-
10-
java org.jlab.clas.timeline.get_beam_energy $*
7+
java $TIMELINE_JAVA_OPTS org.jlab.clas.timeline.get_beam_energy $*

bin/get-run-number.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tools T = new Tools()
44

55
if(args.length<1) {
66
System.err.println """
7-
USAGE: run-groovy ${this.class.getSimpleName()}.groovy [HIPO file]
7+
USAGE: groovy ${this.class.getSimpleName()}.groovy [HIPO file]
88
Returns run number for a given file
99
"""
1010
System.exit(101)

bin/hipo-check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ for hipoFile in ${hipoFiles[@]}; do
5959

6060
# run `hipo-utils -test`
6161
set +e
62-
hipo-utils -test $hipoFile
62+
java $TIMELINE_JAVA_OPTS org.jlab.jnp.hipo4.utils.HipoUtilities -test $hipoFile
6363
testCode=$?
6464
set -e
6565
[ $testCode -ne 0 ] && markBad $hipoFile "\`hipo-utils -test\` failed" && continue

bin/hipo-trim.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ for inputDir in $inputDirs; do
5454
outputSubDir: $outputSubDir
5555
"""
5656

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

7171
# trim the input file
72-
hipo-utils -filter \
72+
java $TIMELINE_JAVA_OPTS org.jlab.jnp.hipo4.utils.HipoUtilities -filter \
7373
-b "*::*" \
7474
-n $nEvents \
7575
-o $outputFile \

0 commit comments

Comments
 (0)