diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbf70ee5b2..222a97bcdc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -338,6 +338,34 @@ jobs: retention-days: 1 path: rec.hipo + test_grapes: + needs: test_clara + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Set up JDK + uses: actions/setup-java@v6.1.0 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: ${{ env.java_distribution }} + - uses: actions/download-artifact@v8 + with: + name: test_clara_result + - uses: actions/download-artifact@v8 + with: + name: build_ubuntu-latest + - name: untar build + run: | + tar xzf clara.tar.gz + tar xzf coatjava.tar.gz + - name: run test + run: ./bin/run-clara -y ./etc/services/grapes.yaml -t 4 -n 500 -c ./clara -o ./tmp rec.hipo + - name: hipo-utils -info + run: | + for f in rec.hipo $(find tmp -type f -name '*.hipo'); do + coatjava/bin/hipo-utils -info $f + done + test_coatjava: needs: [ build ] strategy: @@ -556,6 +584,7 @@ jobs: - spotbugs - test_decoder - test_clara + - test_grapes - test_coatjava_macos - unit_tests runs-on: ubuntu-latest diff --git a/bin/install-clara b/bin/install-clara index 3c89e2dfa4..b9d05674d3 100755 --- a/bin/install-clara +++ b/bin/install-clara @@ -3,8 +3,7 @@ set -e # Default versions: -grapes=2.26 -clara=5.0.2 +clara=main function error() { echo -e "\n$usage\n\n Use option '-h' for more usage guidance.\n\nERROR: $@" @@ -56,24 +55,18 @@ function cleanup() { } function build_clara { - #git clone --branch $clara --depth 1 https://code.jlab.org/hallb/clas12/clara-java - git clone --depth 1 https://code.jlab.org/hallb/clas12/clara-java + git clone --branch $clara --depth 1 https://code.jlab.org/hallb/clas12/maven/clara-java.git cd clara-java && CLARA_HOME=$1 ./gradlew deploy && cd - } -function build_grapes { - git clone --depth 1 --branch $grapes https://code.jlab.org/hallb/clas12/coatjava/grapes.git - cd grapes && mvn package && cd - -} - trap cleanup EXIT # Configure: debug=0 args=() -usage="Usage: install-clara [-v] [-c COATJAVA] [-f CLARA] [-g GRAPES] PATH" +usage="Usage: install-clara [-v] [-c COATJAVA] [-f CLARA] PATH" info=""" -- The default CLARA / GRAPES versions are $clara / $grapes +- The default CLARA version is $clara - COATJAVA can also be specified as a local installation directory - If the COATJAVA version is not specified, it will try to auto-detect it. - [-v adds verbosity and disables cleanup]""" @@ -84,7 +77,7 @@ do -h|--help) echo -e "\n$usage" && echo -e "$info" && exit 1 ;; -f) clara="$2" && shift && shift ;; -c) coatjava="$2" && shift && shift ;; - -g) grapes="$2" && shift && shift ;; + -g) echo "WARNING: option -g has been removed" >&2 && shift && shift ;; -v) let debug=$debug+1 && shift ;; -*|--*) echo -e "$usage\n\nUnknown option: $1" && exit 1 ;; *) args+=("$1") && shift ;; @@ -138,7 +131,5 @@ mkdir -p clara-cre/plugins/clas12/config cp -Lr $coatjava/etc $coatjava/bin $coatjava/lib* clara-cre/plugins/clas12 # GRAPES: -echo -e "\nRetrieving GRAPES version $grapes ..." -build_grapes $PWD/grapes -mkdir -p clara-cre/plugins/grapes/lib/core/ -cp grapes/target/grapes-*core*.jar clara-cre/plugins/grapes/lib/core/ +mkdir -p clara-cre/plugins/grapes/lib/core +cp $coatjava/libexec/grapes*.jar clara-cre/plugins/grapes/lib/core/ diff --git a/build-coatjava.sh b/build-coatjava.sh index dea396ae15..70cf38bf82 100755 --- a/build-coatjava.sh +++ b/build-coatjava.sh @@ -386,22 +386,23 @@ fi # - seem to break thread safety of `mvn install`, i.e., we'd need to run `mvn package` first, then `mvn install` # - we just want copy the produced JAR files to a final installation directory, so the following bash code gets the job done without drama install_jars() { - src=$(dirname $1) + src=$1 dest=$2 [ $# -ge 3 ] && filter="$3" || filter='*.jar' - if [ -d $src/target ]; then - for f in $(find $src/target -name $filter); do + if [ -d $src ]; then + for f in $(find $src -name $filter); do mkdir -p $dest cp $f $dest/ done fi } for pom in $(find reconstruction -name pom.xml); do - install_jars $pom $prefix_dir/lib/services + install_jars $(dirname $pom)/target $prefix_dir/lib/services done -install_jars common-tools/djl-runtime/pom.xml $prefix_dir/lib/services -install_jars common-tools/clara-io/pom.xml $prefix_dir/lib/utils 'jclara-*.jar' -install_jars common-tools/coat-libs/pom.xml $prefix_dir/lib/clas 'coat-libs-*.jar' +install_jars common-tools/copycat/djl/target/lib $prefix_dir/lib/services +install_jars common-tools/copycat/jlab/target/lib/clara $prefix_dir/lib/utils +install_jars common-tools/copycat/jlab/target/lib/grapes $prefix_dir/libexec # keep grapes outta the coatjava classpath +install_jars common-tools/coat-libs/target $prefix_dir/lib/clas 'coat-libs-*.jar' echo "installed coatjava to: $prefix_dir" # install clara diff --git a/common-tools/clara-io/pom.xml b/common-tools/clara-io/pom.xml index c942080a04..8ebd8c9a59 100644 --- a/common-tools/clara-io/pom.xml +++ b/common-tools/clara-io/pom.xml @@ -55,29 +55,4 @@ - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-jclara - package - - copy-dependencies - - - ${project.build.directory}/lib/utils - org.jlab.coda - jclara - jar - - - - - - - diff --git a/common-tools/copycat/README.md b/common-tools/copycat/README.md new file mode 100644 index 0000000000..b0c4103c8a --- /dev/null +++ b/common-tools/copycat/README.md @@ -0,0 +1,3 @@ +# copycat + +POMs to install runtime dependencies to our prefix class path. diff --git a/common-tools/djl-runtime/pom.xml b/common-tools/copycat/djl/pom.xml similarity index 88% rename from common-tools/djl-runtime/pom.xml rename to common-tools/copycat/djl/pom.xml index 5c6d998062..319c016b4b 100644 --- a/common-tools/djl-runtime/pom.xml +++ b/common-tools/copycat/djl/pom.xml @@ -2,17 +2,13 @@ 4.0.0 - - - djl-runtime + org.jlab.clas + copycat-djl pom org.jlab.clas - common-tools + copycat 14.2.4-SNAPSHOT @@ -103,8 +99,8 @@ copy-dependencies - ${project.build.directory}/lib/services - runtime + ${project.build.directory}/lib + runtime diff --git a/common-tools/copycat/jlab/pom.xml b/common-tools/copycat/jlab/pom.xml new file mode 100644 index 0000000000..3118d63adb --- /dev/null +++ b/common-tools/copycat/jlab/pom.xml @@ -0,0 +1,72 @@ + + + 4.0.0 + + org.jlab.clas + copycat-jlab + pom + + + org.jlab.clas + copycat + 14.2.4-SNAPSHOT + + + + + + + code.jlab.org-hallb-grapes + https://code.jlab.org/api/v4/projects/776/packages/maven + + + + + + org.jlab.coda + jclara + + + org.jlab.jnp + grapes + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-jclara + package + + copy-dependencies + + + ${project.build.directory}/lib/clara + org.jlab.coda + jclara + jar + + + + copy-grapes + package + + copy-dependencies + + + ${project.build.directory}/lib/grapes + org.jlab.jnp + grapes + jar + + + + + + + + diff --git a/common-tools/copycat/pom.xml b/common-tools/copycat/pom.xml new file mode 100644 index 0000000000..fedc2e5d93 --- /dev/null +++ b/common-tools/copycat/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + org.jlab.clas + copycat + 14.2.4-SNAPSHOT + pom + + + org.jlab.clas + common-tools + 14.2.4-SNAPSHOT + + + + + djl + jlab + + + diff --git a/common-tools/pom.xml b/common-tools/pom.xml index 852f74101f..96c4eda547 100644 --- a/common-tools/pom.xml +++ b/common-tools/pom.xml @@ -29,7 +29,7 @@ clara-io clas-tracking clas-decay-tools - djl-runtime + copycat coat-libs diff --git a/etc/services/grapes.yaml b/etc/services/grapes.yaml new file mode 100644 index 0000000000..9c109d74b6 --- /dev/null +++ b/etc/services/grapes.yaml @@ -0,0 +1,21 @@ +io-services: + reader: + class: org.jlab.jnp.grapes.io.HipoFrameReader + name: HipoFrameReader + writer: + class: org.jlab.jnp.grapes.io.HipoFrameWriter + name: HipoFrameWriter +services: + - class: org.jlab.jnp.grapes.services.ElastWagon + name: elast +configuration: + io-services: + writer: + compression: 2 + services: + elast: + id: 1 + beamEnergy: 10.6 + targetPDG: 2212 +mime-types: + - binary/data-hipo-frame diff --git a/libexec/env.sh b/libexec/env.sh index 543a1f81bd..0e05f99cf3 100644 --- a/libexec/env.sh +++ b/libexec/env.sh @@ -36,11 +36,10 @@ if [ "${1-}" != '--no-classpath' ]; then done unset jar_dirs export COATJAVA_CLASSPATH + # set log manager + export JAVA_OPTS="-Djava.util.logging.manager=org.jlab.logging.SplitLogManager ${JAVA_OPTS-}" fi -# set log manager -export JAVA_OPTS="-Djava.util.logging.manager=org.jlab.logging.SplitLogManager ${JAVA_OPTS-}" - # additional environment variables for groovy or interactive use # - call as `source $0 groovy` or `source $0 jshell` if [ $# -ge 1 ]; then diff --git a/pom.xml b/pom.xml index 26f2b9ab3b..4c869d1666 100644 --- a/pom.xml +++ b/pom.xml @@ -124,6 +124,12 @@ 6.2 + + org.jlab.jnp + grapes + 2.27 + + org.jlab.coda jevio