Skip to content

Commit 9ae47c3

Browse files
authored
fix(ci): use cvmfs instead of xrootd, for field maps (#954)
1 parent 40fc318 commit 9ae47c3

File tree

9 files changed

+85
-52
lines changed

9 files changed

+85
-52
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ jobs:
4242
with:
4343
key: raw_test_data # fixed key will always hit; clear cache to trigger cache miss
4444
path: |
45-
clas_005038.evio.00000
46-
clas_021559.evio.00001
4745
clas_018779.evio.00001
4846
lookup-only: true
4947
- name: install xrootd-client
@@ -53,10 +51,12 @@ jobs:
5351
sudo apt -y install xrootd-client
5452
- name: download
5553
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
54+
# run: |
55+
# xrdcp xroot://sci-xrootd.jlab.org///osgpool/hallb/clas12/validation/raw/rg-d/clas_018779.evio.00001 ./
5656
run: |
57-
xrdcp xroot://sci-xrootd.jlab.org///osgpool/hallb/clas12/validation/clas_005038.evio.00000 ./
58-
xrdcp xroot://sci-xrootd.jlab.org///osgpool/hallb/clas12/validation/raw/rg-l/clas_021559.evio.00001 ./
59-
xrdcp xroot://sci-xrootd.jlab.org///osgpool/hallb/clas12/validation/raw/rg-d/clas_018779.evio.00001 ./
57+
git lfs install
58+
git clone --depth 1 https://code.jlab.org/hallb/clas12/validation-data
59+
cp validation-data/raw/rg-d/clas_018779.evio.00001 .
6060
6161
# build
6262
#############################################################################
@@ -76,14 +76,6 @@ jobs:
7676
java-version: ${{ env.JAVA_VERSION }}
7777
distribution: ${{ env.java_distribution }}
7878
cache: maven
79-
- name: install xrootd-client (linux)
80-
if: ${{ matrix.runner == 'ubuntu-latest' }}
81-
run: |
82-
sudo apt -y update
83-
sudo apt -y install xrootd-client
84-
- name: install xrootd-client (macos)
85-
if: ${{ matrix.runner == 'macos-latest' }}
86-
run: brew install xrootd
8779
- name: setup cvmfs
8880
uses: cvmfs-contrib/github-action-cvmfs@v5
8981
with:
@@ -94,7 +86,11 @@ jobs:
9486
if: ${{ github.ref_type == 'tag' }}
9587
run: libexec/version-bump.sh ${{ github.ref_name }}
9688
- name: build
97-
run: ./build-coatjava.sh --clara --xrootd --no-progress -T${{ env.nthreads }}
89+
run: |
90+
git lfs install
91+
git submodule update --init ./etc/data/magfield
92+
./build-coatjava.sh --cvmfs --no-progress -T${{ env.nthreads }}
93+
./install-clara -b -c ./coatjava ./clara
9894
- name: tar # tarball to preserve permissions
9995
run: |
10096
tar czvf coatjava.tar.gz coatjava
@@ -134,15 +130,11 @@ jobs:
134130
java-version: ${{ matrix.JAVA_VERSION }}
135131
distribution: ${{ env.java_distribution }}
136132
cache: maven
137-
- name: install xrootd-client
138-
run: |
139-
sudo apt -y update
140-
sudo apt -y install xrootd-client
141133
- uses: cvmfs-contrib/github-action-cvmfs@v5
142134
with:
143135
cvmfs_repositories: 'oasis.opensciencegrid.org'
144136
- name: unit tests
145-
run: ./build-coatjava.sh --xrootd --unittests --no-progress -T${{ env.nthreads }}
137+
run: ./build-coatjava.sh --cvmfs --unittests --no-progress -T${{ env.nthreads }}
146138
- name: collect jacoco report
147139
if: ${{ matrix.JAVA_VERSION == env.JAVA_VERSION }}
148140
run: validation/jacoco-aggregate.sh
@@ -190,26 +182,20 @@ jobs:
190182
- uses: cvmfs-contrib/github-action-cvmfs@v5
191183
with:
192184
cvmfs_repositories: 'oasis.opensciencegrid.org'
193-
- name: install xrootd-client
194-
run: |
195-
sudo apt -y update
196-
sudo apt -y install xrootd-client
197185
- uses: actions/download-artifact@v6
198186
with:
199187
name: build_ubuntu-latest
200188
- uses: actions/cache/restore@v4
201189
with:
202190
key: raw_test_data
203191
path: |
204-
clas_005038.evio.00000
205-
clas_021559.evio.00001
206192
clas_018779.evio.00001
207193
- name: untar build
208194
run: tar xzvf coatjava.tar.gz
209195
- name: run test
210196
run: |
211197
ls -lhtr
212-
./coatjava/bin/decoder -n 10000 -o dog.hipo ./clas_005038.evio.00000
198+
./coatjava/bin/decoder -n 10000 -o dog.hipo ./clas_018779.evio.00001
213199
214200
test_clara:
215201
needs: [ build, download_test_data ]
@@ -235,8 +221,6 @@ jobs:
235221
with:
236222
key: raw_test_data
237223
path: |
238-
clas_005038.evio.00000
239-
clas_021559.evio.00001
240224
clas_018779.evio.00001
241225
- name: untar build
242226
run: |
@@ -287,9 +271,13 @@ jobs:
287271
with:
288272
cvmfs_repositories: 'oasis.opensciencegrid.org'
289273
- name: untar build
290-
run: tar xzvf coatjava.tar.gz
274+
run: |
275+
tar xzvf coatjava.tar.gz
276+
tar xzvf clara.tar.gz
291277
- name: run test
292278
run: |
279+
git lfs install
280+
git submodule update --init validation/advanced-tests/data
293281
cd validation/advanced-tests
294282
echo "COMMAND: ${{ matrix.cmd }}"
295283
${{ matrix.cmd }}

.gitlab-ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ build:
4949
- job: mirror
5050
optional: true
5151
script:
52+
- git lfs install
53+
- git submodule update --init etc/data/magfield
5254
- ./build-coatjava.sh --clara -T$JL_RUNNER_AVAIL_CPU --quiet --no-progress
5355
- tar -czf coatjava.tar.gz coatjava
5456
- tar -czf clara.tar.gz clara
@@ -69,7 +71,9 @@ build:
6971
download:
7072
stage: build
7173
script:
72-
- xrdcp xroot://sci-xrootd.jlab.org///osgpool/hallb/clas12/validation/raw/rg-d/clas_018779.evio.00001 ./
74+
# - xrdcp xroot://sci-xrootd.jlab.org///osgpool/hallb/clas12/validation/raw/rg-d/clas_018779.evio.00001 ./
75+
- git clone https://code.jlab.org/hallb/clas12/validation-data
76+
- cp validation-data/raw/rg-d/clas_018779.evio.00001 .
7377
artifacts:
7478
when: always
7579
expire_in: 1 day
@@ -124,6 +128,9 @@ eb:
124128
dependencies: [build]
125129
script:
126130
- tar -xzf coatjava.tar.gz
131+
- tar -xzf clara.tar.gz
132+
- git lfs install
133+
- git submodule update --init validation/advanced-tests/data
127134
- cd validation/advanced-tests
128135
- ./run-eb-tests.sh -100 ${ARG}
129136
parallel:

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "etc/data/magfield"]
2+
path = etc/data/magfield
3+
url = https://code.jlab.org/hallb/clas12/magfield
4+
[submodule "validation/advanced-tests/data"]
5+
path = validation/advanced-tests/data
6+
url = https://code.jlab.org/hallb/clas12/coatjava/advanced-tests

build-coatjava.sh

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ usage='''build-coatjava.sh [OPTIONS]... [MAVEN_OPTIONS]...
2323
2424
--xrootd use xrootd to download field maps
2525
--cvmfs use cvmfs to download field maps
26+
--lfs use lfs for field maps and test data
2627
2728
--clara install clara too
29+
--data download test data (requires lfs)
2830
2931
--help show this message
3032
@@ -40,7 +42,9 @@ downloadMaps="yes"
4042
runUnitTests="no"
4143
useXrootd=false
4244
useCvmfs=false
45+
useLfs=false
4346
installClara=false
47+
downloadData=false
4448
mvnArgs=()
4549
wgetArgs=()
4650
for xx in $@
@@ -61,8 +65,10 @@ do
6165
wgetArgs+=(--no-verbose)
6266
;;
6367
--xrootd) useXrootd=true ;;
64-
--cvmfs) useCvmfs=true ;;
65-
--clara) installClara=true ;;
68+
--cvmfs) useCvmfs=true ;;
69+
--lfs) useLfs=true ;;
70+
--clara) installClara=true ;;
71+
--data) downloadData=true ;;
6672
-h|--help)
6773
echo "$usage"
6874
exit 2
@@ -71,6 +77,18 @@ do
7177
esac
7278
done
7379

80+
if $downloadData && ! $useLfs; then
81+
echo "$usage"
82+
echo "ERROR::::::::::: --data requires --lfs"
83+
exit 2
84+
fi
85+
86+
# Currently only git-lfs works from offsite:
87+
if ! [[ $(hostname) == *.jlab.org ]]; then
88+
echo "INFO: using --lfs for offsite usage"
89+
useLfs=true
90+
fi
91+
7492
src_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
7593
prefix_dir=$src_dir/coatjava
7694
clara_home=$src_dir/clara
@@ -91,8 +109,13 @@ download () {
91109
if $useXrootd; then
92110
xrdcp $1 ./
93111
ret=$?
112+
elif $useLfs; then
113+
cd $src_dir
114+
git submodule update --init etc/data/magfield
115+
if $downloadData; then git submodule update --init validation/advanced-tests/data; fi
116+
cd - > /dev/null
94117
elif $useCvmfs; then
95-
cp $1 ./
118+
cp -v $1 ./
96119
ret=$?
97120
elif command_exists wget ; then
98121
$wget $1
@@ -116,6 +139,7 @@ magfield_dir=$src_dir/etc/data/magfield
116139
if [ $cleanBuild == "no" ] && [ $downloadMaps == "yes" ]; then
117140
echo 'Retrieving field maps ...'
118141
webDir=https://clasweb.jlab.org/clas12offline/magfield
142+
if $useLfs; then webDir=${magfield_dir##$src_dir}; fi
119143
if $useXrootd; then webDir=xroot://sci-xrootd.jlab.org//osgpool/hallb/clas12/coatjava/magfield; fi
120144
if $useCvmfs; then webDir=/cvmfs/oasis.opensciencegrid.org/jlab/hallb/clas12/sw/noarch/data/magfield; fi
121145
mkdir -p $magfield_dir

etc/data/magfield

Submodule magfield added at a0e899e

install-clara

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,17 @@ function cleanup() {
5656
}
5757

5858
function build_clara {
59-
git clone --branch $clara --depth 1 https://code.jlab.org/hallb/clas12/clara-java
59+
#git clone --branch $clara --depth 1 https://code.jlab.org/hallb/clas12/clara-java
60+
git clone --depth 1 https://code.jlab.org/hallb/clas12/clara-java
6061
cd clara-java && CLARA_HOME=$1 ./gradlew deploy && cd -
6162
}
6263

64+
function build_grapes {
65+
#git clone --branch $grapes --depth 1 https://code.jlab.org/hallb/clas12/coatjava/grapes
66+
git clone --depth 1 https://code.jlab.org/hallb/clas12/coatjava/grapes
67+
cd grapes && mvn package && cd -
68+
}
69+
6370
trap cleanup EXIT
6471

6572
# Configure:
@@ -133,14 +140,14 @@ fi
133140
if ! compgen -G "$coatjava/lib/clas/coat-libs-*.jar" > /dev/null
134141
then
135142
echo -e "\nRetrieving COATJAVA version $coatjava ..."
136-
get https://clasweb.jlab.org/clas12offline/distribution/coatjava/coatjava-$coatjava.tar.gz
137-
coatjava=./coatjava
143+
get https://github.com/JeffersonLab/coatjava/releases/download/$coatjava/coatjava-$coatjava.tar.gz
144+
coatjava=./coatjava-$coatjava
138145
fi
139146
mkdir -p clara-cre/plugins/clas12/config
140147
cp -Lr $coatjava/etc $coatjava/bin $coatjava/lib* clara-cre/plugins/clas12
141148

142149
# GRAPES:
143150
echo -e "\nRetrieving GRAPES version $grapes ..."
144-
get https://clasweb.jlab.org/clas12offline/distribution/grapes/grapes-$grapes.tar.gz
145-
mv grapes-$grapes clara-cre/plugins/grapes
146-
151+
build_grapes $PWD/grapes
152+
mkdir -p clara-cre/plugins/grapes/lib/core/
153+
cp grapes/target/grapes-*core*.jar clara-cre/plugins/grapes/lib/core/

validation/advanced-tests/data

Submodule data added at cebf632

validation/advanced-tests/run-advanced-tests.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
#!/bin/bash -f
22

3-
# coatjava must already be built at ../../coatjava/
3+
# coatjava and clara must already be built at ../../coatjava/
4+
# and input data files at ./data
45

56
# set up environment
67
JAVA_OPTS="-Djava.util.logging.config.file=$PWD/../../etc/logging/debug.properties"
7-
CLARA_HOME=$PWD/clara_installation/ ; export CLARA_HOME
8+
CLARA_HOME=$PWD/../../clara/ ; export CLARA_HOME
89
COAT=$CLARA_HOME/plugins/clas12/
910

10-
# install clara
11-
../../install-clara -c ../../coatjava $CLARA_HOME
12-
[ $? -ne 0 ] && echo "clara installation error" && exit 1
13-
1411
# source coatjava environment
1512
source $COAT/libexec/env.sh
1613
classPath="${COATJAVA_CLASSPATH}:../lib/*:src/"
1714

1815
# download test files
19-
wget --no-check-certificate http://clasweb.jlab.org/clas12offline/distribution/coatjava/validation_files/twoTrackEvents_809_raw.evio.tar.gz
20-
[ $? -ne 0 ] && echo "wget validation files failure" && exit 2
21-
tar -zxvf twoTrackEvents_809_raw.evio.tar.gz
16+
#wget --no-check-certificate http://clasweb.jlab.org/clas12offline/distribution/coatjava/validation_files/twoTrackEvents_809_raw.evio.tar.gz
17+
#[ $? -ne 0 ] && echo "wget validation files failure" && exit 2
18+
#tar -zxvf twoTrackEvents_809_raw.evio.tar.gz
2219

2320
# run decoder
24-
$COAT/bin/decoder -t -0.5 -s 0.0 -i ./twoTrackEvents_809_raw.evio -o ./twoTrackEvents_809.hipo -c 2
21+
$COAT/bin/decoder -t -0.5 -s 0.0 -i ./data/twoTrackEvents_809_raw.evio -o ./twoTrackEvents_809.hipo -c 2
2522
[ $? -ne 0 ] && echo "decoder failure" && exit 3
2623

2724
# take a peek

validation/advanced-tests/run-eb-tests.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
webDir=http://clasweb.jlab.org/clas12offline/distribution/coatjava/validation_files/eb
44
webVersion=5.11-fid-tm-dc2-r11
55
webDir=$webDir/$webVersion
6+
webDir=./data/$webVersion
67

78
# coatjava must already be built at ../../coatjava/
9+
# and input test data files at ./data
810

911
# whether to use CLARA (0=no)
1012
useClara=0
@@ -121,8 +123,8 @@ then
121123
fi
122124

123125
# download test files, if necessary:
124-
wget -N --no-check-certificate $webDir/${stub}.hipo
125-
if [ $? != 0 ] ; then echo "wget validation files failure" ; exit 1 ; fi
126+
#wget -N --no-check-certificate $webDir/${stub}.hipo
127+
#if [ $? != 0 ] ; then echo "wget validation files failure" ; exit 1 ; fi
126128

127129
# update the schema dictionary: (no longer necessary now that recon-util does it)
128130
#rm -f up_${stub}.hipo
@@ -134,7 +136,7 @@ then
134136
then
135137
GEOMDBVAR=$geoDbVariation
136138
export GEOMDBVAR
137-
../../coatjava/bin/recon-util -i ${stub}.hipo -o out_${stub}.hipo -c 2
139+
../../coatjava/bin/recon-util -i ${webDir}/${stub}.hipo -o out_${stub}.hipo -c 2
138140
else
139141
echo "set inputDir $PWD/" > cook.clara
140142
echo "set outputDir $PWD/" >> cook.clara

0 commit comments

Comments
 (0)