diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5fc85d2d94c97ca3f9474ba7707bc04a75c01f2a..58c30aacc59d206caaa69e94d7b3b1f16a91381a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,3 +42,6 @@ summary: needs: ["dis:results", "dvcs:results", "dvmp:results"] script: - echo "All benchmarks passed" + artifacts: + reports: + junit: ["results/dvcs/report2.xml"] diff --git a/config/env.sh b/config/env.sh index 5abe41947886239dabd08153fe89e1353e1d26fa..b07931e6c02443307a1570a466c1b64e1733822b 100755 --- a/config/env.sh +++ b/config/env.sh @@ -36,7 +36,7 @@ echo "JUGGLER_DETECTOR: ${JUGGLER_DETECTOR}" ## Number of events that will be processed by the reconstruction if [ ! -n "${JUGGLER_N_EVENTS}" ] ; then - export JUGGLER_N_EVENTS=100 + export JUGGLER_N_EVENTS=10 fi echo "JUGGLER_N_EVENTS: ${JUGGLER_N_EVENTS}" diff --git a/dvcs/config.yml b/dvcs/config.yml index 1255c602126617659534258fb03ff646161f25b3..0bd08d37a8510efd65e100c5b57d76a311bf415a 100644 --- a/dvcs/config.yml +++ b/dvcs/config.yml @@ -3,7 +3,7 @@ dvcs:process: timeout: 1 hour needs: ["detector"] script: - - echo "dvcd benchmark" + - bash dvcs/dvcs.sh artifacts: paths: - results @@ -13,3 +13,9 @@ dvcs:results: needs: ["dvcs:process"] script: - echo "All DVCS benchmarks successful" + artifacts: + paths: + - results + reports: + junit: ["results/dvcs/report.xml"] + diff --git a/dvcs/dvcs.sh b/dvcs/dvcs.sh index 32c1816da56dc81c73a46f4abd28842b4dd07d64..ebab4c723d52217814fd939eec700c88319fa62a 100644 --- a/dvcs/dvcs.sh +++ b/dvcs/dvcs.sh @@ -1,18 +1,5 @@ #!/bin/bash -if [[ ! -n "${JUGGLER_DETECTOR}" ]] ; then - export JUGGLER_DETECTOR="topside" -fi - -if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then - export JUGGLER_N_EVENTS=100 -fi - -# only used when running locally (not in CI) -if [[ ! -n "${JUGGLER_INSTALL_PREFIX}" ]] ; then - export JUGGLER_INSTALL_PREFIX="/usr/local" -fi - # these variables might not need exported. export JUGGLER_FILE_NAME_TAG="dvcs" @@ -23,18 +10,15 @@ echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}" echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}" echo "JUGGLER_FILE_NAME_TAG = ${JUGGLER_FILE_NAME_TAG}" -### Build the detector constructors. -git clone https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git -git clone https://eicweb.phy.anl.gov/EIC/detectors/accelerator.git -pushd ${JUGGLER_DETECTOR} -ln -s ../accelerator/eic -popd -mkdir ${JUGGLER_DETECTOR}/build -pushd ${JUGGLER_DETECTOR}/build -cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j30 install -popd +## To run the reconstruction, we need the following global variables: +## - JUGGLER_INSTALL_PREFIX: Install prefix for Juggler (simu/recon) +## - JUGGLER_DETECTOR: the detector package we want to use for this benchmark +## - DETECTOR_PATH: full path to the detector definitions +## +## You can ready config/env.sh for more in-depth explanations of the variables +## and how they can be controlled. +source config/env.sh -pushd ${JUGGLER_DETECTOR} curl -o test_proton_dvcs_eic.hepmc "https://eicweb.phy.anl.gov/api/v4/projects/345/jobs/artifacts/master/raw/data/test_proton_dvcs_eic.hepmc?job=compile" if [[ "$?" -ne "0" ]] ; then @@ -42,33 +26,28 @@ if [[ "$?" -ne "0" ]] ; then exit 1 fi - ## run geant4 simulations npsim --runType batch \ --part.minimalKineticEnergy 1000*GeV \ - -v WARNING \ + -v ERROR \ --numberOfEvents ${JUGGLER_N_EVENTS} \ - --compactFile ${JUGGLER_DETECTOR}.xml \ + --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \ --inputFiles test_proton_dvcs_eic.hepmc \ --outputFile ${JUGGLER_SIM_FILE} if [[ "$?" -ne "0" ]] ; then - echo "ERROR running script" + echo "ERROR running npsim" exit 1 fi # Need to figure out how to pass file name to juggler from the commandline xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \ - gaudirun.py ../options/tracker_reconstruction.py + gaudirun.py options/tracker_reconstruction.py if [[ "$?" -ne "0" ]] ; then echo "ERROR running juggler" exit 1 fi -ls -l -popd -pwd mkdir -p results/dvcs - echo "STAND-IN FOR ANALYSIS SCRIPT" #root -b -q "dis/scripts/rec_dis_electrons.cxx(\"${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}\")" #if [[ "$?" -ne "0" ]] ; then @@ -76,7 +55,16 @@ echo "STAND-IN FOR ANALYSIS SCRIPT" # exit 1 #fi +# copy data if it is not too big if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then -cp ${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE} results/dvcs/. +cp ${JUGGLER_REC_FILE} results/dvcs/. fi +# Collect the results +cp dvcs/report.xml results/dvcs/. +cp dvcs/report2.xml results/dvcs/. + + + + + diff --git a/dvcs/report.xml b/dvcs/report.xml new file mode 100644 index 0000000000000000000000000000000000000000..2ba9c6e484d8b0ce7c0c7164759f22f0d7d82d60 --- /dev/null +++ b/dvcs/report.xml @@ -0,0 +1,10 @@ +<testsuites> + <testsuite name="DVCS" tests="3" failures="1"> + <testcase classname="foo1" name="ASuccessfulTest" time="10.0"/> + <testcase classname="foo2" name="AnotherSuccessfulTest" time="20.0"/> + <testcase classname="foo3" name="AFailingTest" time="30.0"> + <failure type="NotEnoughFoo"> details about failure </failure> + </testcase> + </testsuite> +</testsuites> + diff --git a/dvcs/report2.xml b/dvcs/report2.xml new file mode 100644 index 0000000000000000000000000000000000000000..f437ef44d7b01cb33b69259fead289a20fc82072 --- /dev/null +++ b/dvcs/report2.xml @@ -0,0 +1,12 @@ +<testsuite tests="3"> + <testcase time="1.00" classname="bar1" name="ASuccessfulTest2"/> + <testcase time="2.00" classname="bar2" name="AnotherSuccessfulTest2"> + <!-- + <system-out>[[ATTACHMENT|/absolute/path/to/some/file]]</system-out> + --> + </testcase> + <testcase time="3.00" classname="bar3" name="AFailingTest2"> + <failure type="NotEnoughFoo"> MORE details about failure </failure> + </testcase> +</testsuite> + diff --git a/options/tracker_reconstruction.py b/options/tracker_reconstruction.py index a3bc67cb9249b8656d75c0fe1921ad3b82f30dea..bcaa986e42ed93f350412ba6e5b2224ccc25485d 100644 --- a/options/tracker_reconstruction.py +++ b/options/tracker_reconstruction.py @@ -12,7 +12,10 @@ if "JUGGLER_DETECTOR" in os.environ : input_sim_file = str(os.environ["JUGGLER_SIM_FILE"]) output_rec_file = str(os.environ["JUGGLER_REC_FILE"]) n_events = str(os.environ["JUGGLER_N_EVENTS"]) -detector_path = str(os.environ["JUGGLER_DETECTOR_PATH"]) + +detector_path = detector_name +if "DETECTOR_PATH" in os.environ : + detector_path = str(os.environ["DETECTOR_PATH"]) geo_service = GeoSvc("GeoSvc", detectors=["{}/{}.xml".format(detector_path, detector_name)]) @@ -205,3 +208,4 @@ ApplicationMgr( OutputLevel=DEBUG ) +