Skip to content
Snippets Groups Projects
Commit 9989c7e9 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Fix to be generic and common to all detectors again.

parent 743ccd6b
No related branches found
No related tags found
1 merge request!73Fix to be generic and common to all detectors again.
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
## Overview ## Overview
Code common to: Code common to:
- `detector_benchmarks` - [`detector_benchmarks`](https://eicweb.phy.anl.gov/eic/benchmarks/detector_benchmarks/)
- `reconstruction_benchmarks` - [`reconstruction_benchmarks`](https://eicweb.phy.anl.gov/eic/benchmarks/reconstruction_benchmarks/)
- `physics_benchmarks` - [`physics_benchmarks`](https://eicweb.phy.anl.gov/eic/benchmarks/physics_benchmarks/)
## Usage ## Usage
......
...@@ -48,6 +48,33 @@ fi ...@@ -48,6 +48,33 @@ fi
rm -rf "${DETECTOR}/.git" rm -rf "${DETECTOR}/.git"
popd popd
if [ "${BEAMLINE}" ]; then
pushd ${DETECTOR_PREFIX}
## We need an up-to-date copy of the detector
## start clean to avoid issues...
if [ -d "${BEAMLINE}" ]; then
echo "cleaning up ${BEAMLINE}"
mv "${BEAMLINE}" "$(mktemp)-${BEAMLINE}"
fi
echo "Fetching ${BEAMLINE}"
if [ -n "${BEAMLINE_DEPLOY_TOKEN_USERNAME:-}" -a -n "${BEAMLINE_DEPLOY_TOKEN_PASSWORD:-}" ]; then
DEPLOY_TOKEN="${BEAMLINE_DEPLOY_TOKEN_USERNAME}:${BEAMLINE_DEPLOY_TOKEN_PASSWORD}@"
echo "Deploy token for ${BEAMLINE_DEPLOY_TOKEN_USERNAME} is masked in the next line."
else
DEPLOY_TOKEN=""
fi
echo "git clone -b ${BEAMLINE_VERSION} --depth 1 ${BEAMLINE_REPOSITORYURL:-https://eicweb.phy.anl.gov/EIC/detectors/${BEAMLINE}.git} ${BEAMLINE}"
git clone -b ${BEAMLINE_VERSION} --depth 1 ${BEAMLINE_REPOSITORYURL:-https://${DEPLOY_TOKEN}eicweb.phy.anl.gov/EIC/detectors/${BEAMLINE}.git} ${BEAMLINE}
[[ "$?" == "0" ]] || exit 1
rm -rf "${BEAMLINE}/.git"
ln -s -f ${DETECTOR_PREFIX}/${BEAMLINE}/${BEAMLINE} ${DETECTOR_PATH}/${BEAMLINE}
[[ "$?" == "0" ]] || exit 1
popd
fi
## ============================================================================= ## =============================================================================
## Step 2: Compile and install the detector definition ## Step 2: Compile and install the detector definition
echo "Building and installing the ${DETECTOR} package" echo "Building and installing the ${DETECTOR} package"
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
## The script defines the following environment variables that are meant to ## The script defines the following environment variables that are meant to
## be overriden by the Gitlab continuous integration (CI) ## be overriden by the Gitlab continuous integration (CI)
## ##
## - BEAMLINE: compact detector files for the interaciton point beamline
## - BEAMLINE_VERSION: compact detector files for the interaciton point beamline
## - DETECTOR: detector package to be used for the benchmark ## - DETECTOR: detector package to be used for the benchmark
## - DETECTOR_CONFIG: detector package config to be used for the benchmark ## - DETECTOR_CONFIG: detector package config to be used for the benchmark
## - DETECTOR_VERSION: detector package to be used for the benchmark ## - DETECTOR_VERSION: detector package to be used for the benchmark
...@@ -44,7 +46,10 @@ if [ ! -n "${DETECTOR_VERSION}" ] ; then ...@@ -44,7 +46,10 @@ if [ ! -n "${DETECTOR_VERSION}" ] ; then
fi fi
if [ ! -n "${DETECTOR_REPOSITORYURL}" ] ; then if [ ! -n "${DETECTOR_REPOSITORYURL}" ] ; then
export DETECTOR_REPOSITORYURL="https://github.com/eic/${DETECTOR}.git" export DETECTOR_REPOSITORYURL="https://eicweb.phy.anl.gov/EIC/detectors/${DETECTOR}.git"
if [ "${DETECTOR}" == "epic" ] ; then
export DETECTOR_REPOSITORYURL="https://github.com/eic/${DETECTOR}.git"
fi
fi fi
## Number of events that will be processed by the reconstruction ## Number of events that will be processed by the reconstruction
...@@ -53,6 +58,20 @@ if [ ! -n "${BENCHMARK_N_EVENTS}" ] ; then ...@@ -53,6 +58,20 @@ if [ ! -n "${BENCHMARK_N_EVENTS}" ] ; then
fi fi
export JUGGLER_N_EVENTS=${BENCHMARK_N_EVENTS} export JUGGLER_N_EVENTS=${BENCHMARK_N_EVENTS}
# optionally use a BEAMLINE repository
if [ "${BEAMLINE}" ] ; then
if [ ! -n "${BEAMLINE_VERSION}" ] ; then
export BEAMLINE_VERSION="master"
fi
if [ ! -n "${BEAMLINE_REPOSITORYURL}" ] ; then
export BEAMLINE_REPOSITORYURL="https://eicweb.phy.anl.gov/EIC/detectors/${BEAMLINE}.git"
fi
fi
## Maximum number of threads or processes a single pipeline should use ## Maximum number of threads or processes a single pipeline should use
## (this is not enforced, but the different pipeline scripts should use ## (this is not enforced, but the different pipeline scripts should use
## this to guide the number of parallel processes or threads they ## this to guide the number of parallel processes or threads they
...@@ -109,6 +128,9 @@ echo "DETECTOR=${DETECTOR}" >> .env ...@@ -109,6 +128,9 @@ echo "DETECTOR=${DETECTOR}" >> .env
echo "DETECTOR_CONFIG=${DETECTOR_CONFIG}" >> .env echo "DETECTOR_CONFIG=${DETECTOR_CONFIG}" >> .env
echo "DETECTOR_VERSION=${DETECTOR_VERSION}" >> .env echo "DETECTOR_VERSION=${DETECTOR_VERSION}" >> .env
echo "DETECTOR_REPOSITORYURL=${DETECTOR_REPOSITORYURL}" >> .env echo "DETECTOR_REPOSITORYURL=${DETECTOR_REPOSITORYURL}" >> .env
echo "BEAMLINE=${BEAMLINE}" >> .env
echo "BEAMLINE_VERSION=${BEAMLINE_VERSION}" >> .env
echo "BEAMLINE_REPOSITORYURL=${BEAMLINE_REPOSITORYURL}" >> .env
echo "BENCHMARK_N_EVENTS=${BENCHMARK_N_EVENTS}" >> .env echo "BENCHMARK_N_EVENTS=${BENCHMARK_N_EVENTS}" >> .env
echo "BENCHMARK_N_THREADS=${BENCHMARK_N_THREADS}" >> .env echo "BENCHMARK_N_THREADS=${BENCHMARK_N_THREADS}" >> .env
echo "BENCHMARK_RNG_SEED=${BENCHMARK_RNG_SEED}" >> .env echo "BENCHMARK_RNG_SEED=${BENCHMARK_RNG_SEED}" >> .env
......
...@@ -4,6 +4,9 @@ echo "JUGGLER_TAG: ${JUGGLER_TAG}" ...@@ -4,6 +4,9 @@ echo "JUGGLER_TAG: ${JUGGLER_TAG}"
echo "DETECTOR: ${DETECTOR}" echo "DETECTOR: ${DETECTOR}"
echo "DETECTOR_CONFIG: ${DETECTOR_CONFIG}" echo "DETECTOR_CONFIG: ${DETECTOR_CONFIG}"
echo "DETECTOR_VERSION: ${DETECTOR_VERSION}" echo "DETECTOR_VERSION: ${DETECTOR_VERSION}"
echo "BEAMLINE: ${BEAMLINE}"
echo "BEAMLINE_CONFIG: ${BEAMLINE_CONFIG}"
echo "BEAMLINE_VERSION: ${BEAMLINE_VERSION}"
echo "DETECTOR_PREFIX: ${DETECTOR_PREFIX}" echo "DETECTOR_PREFIX: ${DETECTOR_PREFIX}"
echo "DETECTOR_PATH: ${DETECTOR_PATH}" echo "DETECTOR_PATH: ${DETECTOR_PATH}"
echo "BENCHMARK_N_EVENTS: ${BENCHMARK_N_EVENTS}" echo "BENCHMARK_N_EVENTS: ${BENCHMARK_N_EVENTS}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment