Skip to content

Commit 318d35e

Browse files
committed
fix: do not require any of coatjava's environment
1 parent f83c135 commit 318d35e

10 files changed

Lines changed: 108 additions & 99 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ env:
1515
# NOTE: if any of these versions are changed, update the POM files too
1616
java_version: 21
1717
java_distribution: zulu
18-
groovy_version: 4.x
1918

2019

2120
concurrency:
@@ -47,31 +46,6 @@ jobs:
4746
retention-days: 1
4847
path: build*.tar.zst
4948

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

@@ -110,7 +84,6 @@ jobs:
11084
run_monitoring:
11185
needs:
11286
- build_timelines
113-
- build_coatjava
11487
- download_test_data
11588
runs-on: ubuntu-latest
11689
strategy:
@@ -123,12 +96,6 @@ jobs:
12396
with:
12497
java-version: ${{ env.java_version }}
12598
distribution: ${{ env.java_distribution }}
126-
- name: setup groovy
127-
uses: wtfjoke/setup-groovy@v2
128-
with:
129-
groovy-version: ${{ env.groovy_version }}
130-
- name: groovy version
131-
run: groovy --version
13299
- uses: actions/checkout@v4
133100
- uses: actions/cache/restore@v4
134101
with:
@@ -162,7 +129,6 @@ jobs:
162129
test_swifjob:
163130
needs:
164131
- build_timelines
165-
- build_coatjava
166132
- download_test_data
167133
runs-on: ubuntu-latest
168134
strategy:
@@ -175,12 +141,6 @@ jobs:
175141
with:
176142
java-version: ${{ env.java_version }}
177143
distribution: ${{ env.java_distribution }}
178-
- name: setup groovy
179-
uses: wtfjoke/setup-groovy@v2
180-
with:
181-
groovy-version: ${{ env.groovy_version }}
182-
- name: groovy version
183-
run: groovy --version
184144
- uses: actions/checkout@v4
185145
- uses: actions/cache/restore@v4
186146
with:
@@ -221,12 +181,6 @@ jobs:
221181
with:
222182
java-version: ${{ env.java_version }}
223183
distribution: ${{ env.java_distribution }}
224-
- name: setup groovy
225-
uses: wtfjoke/setup-groovy@v2
226-
with:
227-
groovy-version: ${{ env.groovy_version }}
228-
- name: groovy version
229-
run: groovy --version
230184
- uses: actions/checkout@v4
231185
- uses: actions/download-artifact@v4
232186
with:
@@ -260,12 +214,6 @@ jobs:
260214
- run_timelines
261215
runs-on: ubuntu-latest
262216
steps:
263-
- name: setup groovy
264-
uses: wtfjoke/setup-groovy@v2
265-
with:
266-
groovy-version: ${{ env.groovy_version }}
267-
- name: groovy version
268-
run: groovy --version
269217
- uses: actions/checkout@v4
270218
- uses: actions/download-artifact@v4
271219
with:

bin/environ.sh

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,51 +7,33 @@ 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
10+
# get the source code directory
1111
[ -z "${BASH_SOURCE[0]}" ] && thisEnv=$0 || thisEnv=${BASH_SOURCE[0]}
1212
export TIMELINESRC=$(realpath $(dirname $thisEnv)/..)
1313

1414
# RCDB
15-
[ -z "${RCDB_CONNECTION-}" ] && RCDB_CONNECTION=mysql://rcdb@clasdb.jlab.org/rcdb
16-
export RCDB_CONNECTION
17-
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-
target_classpath=(
32-
"$TIMELINESRC/target/*"
33-
"$TIMELINESRC/target/dependency/*"
34-
)
15+
[ -z "${RCDB_CONNECTION-}" ] && export RCDB_CONNECTION=mysql://rcdb@clasdb.jlab.org/rcdb
3516

36-
# java and groovy options
17+
# java options
3718
timeline_java_opts=(
38-
-DCLAS12DIR=$COATJAVA/
39-
-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
4021
-Xmx1536m
4122
-XX:+UseSerialGC
4223
)
4324

44-
# run java with more resources, to mitigate large memory residence for long run periods
45-
timeline_java_opts_highmem=$(echo ${timeline_java_opts[*]} | sed 's;Xmx1024m;Xmx2048m;')
25+
# groovy options
26+
timeline_groovy_opts=(
27+
-cp "$TIMELINESRC/target/*:$TIMELINESRC/target/dependency/*"
28+
-Djava.awt.headless=true
29+
)
4630

4731
# exports
48-
export CLASSPATH="$(echo "${target_classpath[*]}" | sed 's; ;:;g')${CLASSPATH:+:${CLASSPATH}}"
4932
export TIMELINE_JAVA_OPTS="${timeline_java_opts[*]}"
50-
export TIMELINE_JAVA_OPTS_HIGHMEM=$timeline_java_opts_highmem
33+
export TIMELINE_GROOVY_OPTS="${timeline_groovy_opts[*]}"
5134

5235
# cleanup vars
5336
unset thisEnv
5437
unset log_config
55-
unset target_classpath
5638
unset timeline_java_opts
57-
unset timeline_java_opts_highmem
39+
unset timeline_groovy_opts

bin/hipo-check.sh

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

4444
# run `hipo-utils -test`
4545
set +e
46-
hipo-utils -test $hipoFile
46+
java $TIMELINE_JAVA_OPTS org.jlab.jnp.hipo4.utils.HipoUtilities -test $hipoFile
4747
testCode=$?
4848
set -e
4949
[ $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 \

bin/run-groovy-timeline.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22
# run the timeline's version of `groovy`, to ensure the correct dependencies are used
33
# FIXME: this script should only exist until ALL timeline groovy code is compiled;
44
# at the moment, the physics QA code needs this
5-
# NOTE: this assumes $CLASSPATH has already been set, by sourcing `environ.sh`
6-
exec java groovy.ui.GroovyMain -Djava.awt.headless=true "$@"
5+
6+
if [ -z "$TIMELINE_GROOVY_OPTS" ]; then
7+
echo "ERROR: please source environ.sh first" >&2
8+
exit 100
9+
fi
10+
11+
exec java $TIMELINE_GROOVY_OPTS groovy.ui.GroovyMain "$@"

data/logging/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Logging Configuration
2+
3+
Shamefully copied from [`coatjava`](https://github.com/JeffersonLab/coatjava/tree/development/etc/logging), to avoid relying on `$COATJAVA` environment variable.

data/logging/debug.properties

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# Global logging configuration for clas
3+
# Nick Tyler, UofSC
4+
#
5+
# Modified from hps-java logging
6+
# Jeremy McCormick, SLAC
7+
#
8+
9+
# default global level
10+
.level = INFO
11+
12+
# default handler which prints to console
13+
handlers = java.util.logging.ConsoleHandler
14+
15+
# Old detailed format
16+
# prints timestamp (1$), level (4$), source ($2), message (5$), and (optionally) an exception (6$).
17+
#java.util.logging.SimpleFormatter.format = %1$tY-%1$tm-%1$td %1$tT [%4$s] %2$s :: %5$s%6$s%n
18+
19+
# New simplified format
20+
# MESSAGE
21+
java.util.logging.SimpleFormatter.format = %5$s%6$s%n
22+
23+
# configure the console handler
24+
java.util.logging.ConsoleHandler.level = ALL
25+
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
26+
27+
28+
29+

data/logging/logging.properties

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#
2+
# Global logging configuration for clas
3+
# Nick Tyler, UofSC
4+
#
5+
# Modified from hps-java logging
6+
# Jeremy McCormick, SLAC
7+
#
8+
9+
# default global level
10+
.level = WARNING
11+
12+
# default handler which prints to console
13+
handlers = java.util.logging.ConsoleHandler
14+
15+
# Old detailed format
16+
# prints timestamp (1$), level (4$), source ($2), message (5$), and (optionally) an exception (6$).
17+
#java.util.logging.SimpleFormatter.format = %1$tY-%1$tm-%1$td %1$tT [%4$s] %2$s :: %5$s%6$s%n
18+
19+
# New simplified format
20+
# [LEVEL][LOGGER] MESSAGE
21+
java.util.logging.SimpleFormatter.format = %1$tT [%4$s] %5$s%6$s%n
22+
23+
# configure the console handler
24+
java.util.logging.ConsoleHandler.level = ALL
25+
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
26+
27+
# turn minuit logging off
28+
org.freehep.math.minuit.level = OFF
29+
30+
# calibration logging
31+
org.jlab.detector.calib.level = OFF
32+
33+
# Reconstruction level
34+
org.jlab.clas.reco.level = OFF
35+
36+
# Hipo io level
37+
org.jlab.io.hipo = OFF
38+
39+
# Magnetic Field level
40+
cnuphys.magfield.level = OFF
41+
42+
# Log level for each service
43+
org.jlab.service.ec.level = OFF
44+
org.jlab.service.eb.level = OFF
45+
org.jlab.rec.cvt.services.level = OFF
46+
org.jlab.service.htcc.level = OFF
47+
org.jlab.rec.dc.level = OFF
48+
49+
50+
51+

qa-physics/README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@ Physics QA features:
2323
> [!IMPORTANT]
2424
> See the [QADB Ground rules](https://github.com/JeffersonLab/clas12-qadb), which must be strictly followed for the QA procedure.
2525
26-
# Setup
27-
28-
It is recommended to use `bash` or `zsh` as your shell; `tcsh` is not supported.
29-
30-
1. Set `COATJAVA` environment (follow CLAS12 software documentation)
31-
2. Note for developers: set local environment variables with `source ../bin/environ.sh`.
32-
Wrapper scripts in `../bin/` do this automatically, but if you intend to run
33-
individual scripts here (namely during manual QA), you may need to call this `source` command.
34-
3526
# Notes
3627

3728
For run-group specific notes, including the commands used to perform the QA, see

src/main/java/org/jlab/clas/timeline/run_histograms.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static void main(String[] args) {
3131
if(args.length>5)if(Integer.parseInt(args[5])==0)useTB=false;
3232
System.out.println("will process run number "+runNum+" from list "+filelist+" looking for up to "+maxevents+" events, beam energy setting "+EB);
3333

34-
//// instantiate monitors
34+
//// instantiate histogramming classes
3535
monitor2p2GeV ana_mon = new monitor2p2GeV(runNum,outputDir,EB,useTB);
3636
FTOFandDC ana_ftof_dc = new FTOFandDC(runNum,outputDir,useTB);
3737
CTOF ana_ctof = new CTOF(runNum,outputDir,useTB);
@@ -79,7 +79,7 @@ public static void main(String[] args) {
7979
while(reader.hasEvent()&& count<maxevents ) {
8080
DataEvent event = reader.getNextEvent();
8181

82-
//// call each monitor's `processEvent`
82+
//// call each histogramming class instance's `processEvent`
8383
ana_mon.processEvent(event);
8484
ana_ctof.processEvent(event);
8585
ana_ftof_dc.processEvent(event);
@@ -108,7 +108,7 @@ public static void main(String[] args) {
108108
}
109109
System.out.println("Total : " + count + " events");
110110

111-
//// call each monitor's `write`
111+
//// call each histogramming class instance's `write`
112112
ana_mon.write();
113113
ana_ctof.write();
114114
ana_ftof_dc.write();

0 commit comments

Comments
 (0)