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

Resolve "Use the common bench scripts"

parent 13fbf73d
No related branches found
No related tags found
No related merge requests found
...@@ -10,40 +10,39 @@ workflow: ...@@ -10,40 +10,39 @@ workflow:
default: default:
before_script: before_script:
- mkdir -p images && mkdir -p doc/ - source .local/bin/env.sh
- git clone https://eicweb.phy.anl.gov/EIC/detectors/accelerator.git
&& ln -s accelerator/eic
- git clone https://eicweb.phy.anl.gov/EIC/detectors/ip6.git eic_ip6
&& mkdir ip6_build
&& cd ip6_build
&& cmake ../eic_ip6/. -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=/usr/local
&& make -j20
&& make install
&& cd ..
&& ln -s eic_ip6/ip6 || exit 1
- mkdir build
&& cd build
&& cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_CXX_STANDARD=17
&& make -j20
&& make install
&& cd .. || exit 1
artifacts: artifacts:
expire_in: 1 week
paths: paths:
- images/ - .local/detector
- doc/ - .local/lib
- .local/bin
- .local/include
- .local/share
- results
- config
- images
- doc
- juggler.env
reports: reports:
dotenv: juggler.env dotenv: juggler.env
stages: stages:
- config - config
- initialize
- build - build
- docs - docs
- test - test
- collect
- finalize - finalize
- deploy - deploy
env: common:setup:
stage: config stage: config
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
before_script:
- git clone https://eicweb.phy.anl.gov/EIC/benchmarks/common_bench.git setup
script: script:
- export JUGGLER_DETECTOR="reference_detector" - export JUGGLER_DETECTOR="reference_detector"
- | - |
...@@ -56,15 +55,23 @@ env: ...@@ -56,15 +55,23 @@ env:
echo "JUGGLER_DETECTOR_VERSION=$CI_COMMIT_REF_NAME" >> juggler.env echo "JUGGLER_DETECTOR_VERSION=$CI_COMMIT_REF_NAME" >> juggler.env
echo "JUGGLER_DETECTOR=$JUGGLER_DETECTOR" >> juggler.env echo "JUGGLER_DETECTOR=$JUGGLER_DETECTOR" >> juggler.env
fi fi
artifacts: - source setup/bin/env.sh && ./setup/bin/install_common.sh
reports:
dotenv: juggler.env
common:detector:
stage: initialize
needs: ["common:setup"]
script:
- source .local/bin/env.sh && build_detector.sh
- mkdir_local_data_link sim_output
- mkdir -p results
- mkdir -p config
- mkdir -p doc
- print_env.sh
compile: compile:
stage: build stage: build
needs: needs:
- ["env"] - ["common:detector"]
script: script:
- mkdir -p build && cd build && cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j20 && make install && cd .. - mkdir -p build && cd build && cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j20 && make install && cd ..
- echo "Build successful." - echo "Build successful."
...@@ -72,11 +79,7 @@ compile: ...@@ -72,11 +79,7 @@ compile:
.views: .views:
stage: docs stage: docs
needs: needs:
- ["compile"] - ["common:detector"]
artifacts:
paths:
- images/
- doc/
include: include:
- local: 'views/view1.yml' - local: 'views/view1.yml'
...@@ -98,11 +101,12 @@ report: ...@@ -98,11 +101,12 @@ report:
- view_03 - view_03
- view_06 - view_06
- view_07 - view_07
- view_11
- view_12
- view_13
- view_14
- view_15
- dump_constants - dump_constants
artifacts:
paths:
- images/
- doc/
script: script:
- pip3 install jinja2 && ls -lrth - pip3 install jinja2 && ls -lrth
- ./bin/make_images > doc/dawn_views.md - ./bin/make_images > doc/dawn_views.md
...@@ -110,28 +114,37 @@ report: ...@@ -110,28 +114,37 @@ report:
dump_constants: dump_constants:
stage: test stage: test
needs: needs:
- ["compile"] - ["common:detector"]
script: script:
- npdet_info dump reference_detector.xml | tee doc/constants.out - npdet_info dump ${DETECTOR_PATH}/reference_detector.xml | tee doc/constants.out
overlap_check: overlap_check:
stage: test stage: test
needs: needs:
- ["compile"] - ["common:detector"]
script: script:
- checkOverlaps -c reference_detector.xml | tee doc/overlap_check.out - checkOverlaps -c ${DETECTOR_PATH}/reference_detector.xml | tee doc/overlap_check.out
- echo "$(cat doc/overlap_check.out | grep ovlp | wc -l) overlaps..." - echo "$(cat doc/overlap_check.out | grep ovlp | wc -l) overlaps..."
- if [[ "$(cat doc/overlap_check.out | grep ovlp | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" && false ; fi - if [[ "$(cat doc/overlap_check.out | grep ovlp | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" && false ; fi
detector:config_testing: detector:config_testing:
stage: test stage: test
needs: needs:
- ["compile"] - ["common:detector"]
script: script:
- checkOverlaps -c reference_detector.xml | tee doc/overlap_check.out | wc -l - checkOverlaps -c ${DETECTOR_PATH}/reference_detector.xml | tee doc/overlap_check.out | wc -l
- cat doc/overlap_check.out - cat doc/overlap_check.out
allow_failure: true allow_failure: true
#benchmarks:reconstruction:
# stage: deploy
# variables:
# JUGGLER_DETECTOR: "$JUGGLER_DETECTOR"
# JUGGLER_DETECTOR_VERSION: "$JUGGLER_DETECTOR_VERSION"
# trigger:
# project: EIC/benchmarks/reconstruction_benchmarks
# strategy: depend
# needs: ["env","overlap_check","report"]
#benchmarks:reconstruction: #benchmarks:reconstruction:
# stage: deploy # stage: deploy
# variables: # variables:
......
...@@ -30,20 +30,21 @@ Here is how to begin: ...@@ -30,20 +30,21 @@ Here is how to begin:
3. Create a WIP (or draft) merge request and look at the CI output for debugging. Then go to back to 2 if changes are needed. 3. Create a WIP (or draft) merge request and look at the CI output for debugging. Then go to back to 2 if changes are needed.
4. Remove the WIP/Draft part of the merge request if you would like to see your changes merged into the master. 4. Remove the WIP/Draft part of the merge request if you would like to see your changes merged into the master.
### Compiling See:
- [Talk at computing round table](https://indico.jlab.org/event/420/#17-automated-workflow-for-end)
### Compiling (avoid it)
First, see if the use case above is best for you. It most likely is and can save a lot of time for newcomers. First, see if the use case above is best for you. It most likely is and can save a lot of time for newcomers.
To run the simulation locally, we suggest using the singularity image. To run the simulation locally, we suggest using the singularity image.
More details can be found at the links below: More details can be found at the links below:
- https://dd4hep.web.cern.ch/dd4hep/page/beginners-guide/
- https://eic.phy.anl.gov/tutorials/eic_tutorial/ - https://eic.phy.anl.gov/tutorials/eic_tutorial/
- https://eicweb.phy.anl.gov/containers/eic_container/ - https://eicweb.phy.anl.gov/containers/eic_container/
Related useful links Related useful links
-------------------- --------------------
......
...@@ -35,7 +35,7 @@ SKIP_EVENTS=0 ...@@ -35,7 +35,7 @@ SKIP_EVENTS=0
DETECTOR_ONLY=0 DETECTOR_ONLY=0
FILE_TAG="view" FILE_TAG="view"
DAWN_RUN_DIR="scripts/view1" DAWN_RUN_DIR="scripts/view1"
DETECTOR_FILE="reference_detector.xml" DETECTOR_FILE="${DETECTOR_PATH}/reference_detector.xml"
POSITIONAL=() POSITIONAL=()
while [[ $# -gt 0 ]] while [[ $# -gt 0 ]]
...@@ -97,7 +97,9 @@ rm -f *.prim ...@@ -97,7 +97,9 @@ rm -f *.prim
if [ "${DETECTOR_ONLY}" -eq "1" ] ; then if [ "${DETECTOR_ONLY}" -eq "1" ] ; then
./scripts/run_detector_simulation.py -i scripts/input_data/few_events.hepmc \ ./scripts/run_detector_simulation.py \
--compact ${DETECTOR_PATH}/reference_detector.xml \
-i scripts/input_data/few_events.hepmc \
-o derp.root -n 1 \ -o derp.root -n 1 \
--ui csh --vis -b -m macro/dawn_picture.mac & --ui csh --vis -b -m macro/dawn_picture.mac &
...@@ -113,7 +115,9 @@ kill %1 ...@@ -113,7 +115,9 @@ kill %1
else else
echo " Running simulation for tracks" echo " Running simulation for tracks"
./scripts/run_detector_simulation.py -i scripts/input_data/few_events.hepmc \ ./scripts/run_detector_simulation.py \
--compact ${DETECTOR_PATH}/reference_detector.xml \
-i scripts/input_data/few_events.hepmc \
-o derp.root -s ${SKIP_EVENTS} -n 1 \ -o derp.root -s ${SKIP_EVENTS} -n 1 \
--ui csh --vis -b -m macro/dawn_picture2.mac & --ui csh --vis -b -m macro/dawn_picture2.mac &
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment