Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -556,6 +584,7 @@ jobs:
- spotbugs
- test_decoder
- test_clara
- test_grapes
- test_coatjava_macos
- unit_tests
runs-on: ubuntu-latest
Expand Down
23 changes: 7 additions & 16 deletions bin/install-clara
Original file line number Diff line number Diff line change
Expand Up @@ -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: $@"
Expand Down Expand Up @@ -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]"""
Expand All @@ -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 ;;
Expand Down Expand Up @@ -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/
15 changes: 8 additions & 7 deletions build-coatjava.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 0 additions & 25 deletions common-tools/clara-io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,4 @@

</dependencies>

<!-- copy the CLARA jar for runtime usage -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-jclara</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib/utils</outputDirectory>
<includeGroupIds>org.jlab.coda</includeGroupIds>
<includeArtifactIds>jclara</includeArtifactIds>
<includeTypes>jar</includeTypes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
3 changes: 3 additions & 0 deletions common-tools/copycat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# copycat

POMs to install runtime dependencies to our prefix class path.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<!--
this POM installs `ai.djl` runtime dependencies to our prefix classpath;
this includes its transitive dependencies, e.g. `gson` and `slf4j`
-->

<artifactId>djl-runtime</artifactId>
<groupId>org.jlab.clas</groupId>
<artifactId>copycat-djl</artifactId>
<packaging>pom</packaging>

<parent>
<groupId>org.jlab.clas</groupId>
<artifactId>common-tools</artifactId>
<artifactId>copycat</artifactId>
<version>14.2.4-SNAPSHOT</version>
</parent>

Expand Down Expand Up @@ -103,8 +99,8 @@
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib/services</outputDirectory>
<includeScope>runtime</includeScope>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<includeScope>runtime</includeScope> <!-- include transitive dependencies, e.g. `gson` and `slf4j` -->
</configuration>
</execution>
</executions>
Expand Down
72 changes: 72 additions & 0 deletions common-tools/copycat/jlab/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.jlab.clas</groupId>
<artifactId>copycat-jlab</artifactId>
<packaging>pom</packaging>

<parent>
<groupId>org.jlab.clas</groupId>
<artifactId>copycat</artifactId>
<version>14.2.4-SNAPSHOT</version>
</parent>

<!-- grapes is in a seperate repo -->
<repositories>
<!-- https://code.jlab.org/hallb/clas12/coatjava/grapes package registry -->
<repository>
<id>code.jlab.org-hallb-grapes</id>
<url>https://code.jlab.org/api/v4/projects/776/packages/maven</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.jlab.coda</groupId>
<artifactId>jclara</artifactId>
</dependency>
<dependency>
<groupId>org.jlab.jnp</groupId>
<artifactId>grapes</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-jclara</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib/clara</outputDirectory>
<includeGroupIds>org.jlab.coda</includeGroupIds>
<includeArtifactIds>jclara</includeArtifactIds>
<includeTypes>jar</includeTypes>
</configuration>
</execution>
<execution>
<id>copy-grapes</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib/grapes</outputDirectory>
<includeGroupIds>org.jlab.jnp</includeGroupIds>
<includeArtifactIds>grapes</includeArtifactIds>
<includeTypes>jar</includeTypes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
22 changes: 22 additions & 0 deletions common-tools/copycat/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.jlab.clas</groupId>
<artifactId>copycat</artifactId>
<version>14.2.4-SNAPSHOT</version>
<packaging>pom</packaging>

<parent>
<groupId>org.jlab.clas</groupId>
<artifactId>common-tools</artifactId>
<version>14.2.4-SNAPSHOT</version>
</parent>

<modules>
<!-- NOTE: separate modules for finer control over what gets copied, e.g., `djl` needs transitives but `jlab` doesn't -->
<module>djl</module>
<module>jlab</module>
</modules>

</project>
2 changes: 1 addition & 1 deletion common-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<module>clara-io</module>
<module>clas-tracking</module>
<module>clas-decay-tools</module>
<module>djl-runtime</module>
<module>copycat</module>
<module>coat-libs</module>
</modules>

Expand Down
21 changes: 21 additions & 0 deletions etc/services/grapes.yaml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 2 additions & 3 deletions libexec/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@
<version>6.2</version>
</dependency>

<dependency>
<groupId>org.jlab.jnp</groupId>
<artifactId>grapes</artifactId>
<version>2.27</version>
</dependency>

<dependency>
<groupId>org.jlab.coda</groupId>
<artifactId>jevio</artifactId>
Expand Down
Loading