Skip to content
Snippets Groups Projects
.gitlab-ci.yml 3.95 KiB
Newer Older
Whitney Armstrong's avatar
Whitney Armstrong committed
image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:latest

workflow:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - if: '$CI_PIPELINE_SOURCE == "web"'
    - if: '$CI_PIPELINE_SOURCE == "webide"'
    - if: '$CI_COMMIT_BRANCH == "master"'
    - if: '$CI_COMMIT_TAG'

default:
  before_script:
    - mkdir -p images && mkdir -p doc/
    - 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_INSTALL_PREFIX=/usr/local && make -j20 && make install  && cd .. && ln -s eic_ip6/ip6 
Whitney Armstrong's avatar
Whitney Armstrong committed
    - mkdir build && cd build && cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j20 && make install  && cd ..
  artifacts:
    paths:
      - images/
      - doc/
    reports:
      dotenv: juggler.env

stages:
  - config
  - build
  - docs
  - test 
  - finalize 
  - deploy

env:
  stage: config 
  script:
Jihee Kim's avatar
Jihee Kim committed
    - export JUGGLER_DETECTOR="reference_detector"
Whitney Armstrong's avatar
Whitney Armstrong committed
    - |
      if [[ "x${CI_PIPELINE_SOURCE}" == "xmerge_request_event"  || "$CI_COMMIT_BRANCH" == "master" ]]; then
        export JUGGLER_DETECTOR_VERSION="${CI_COMMIT_REF_NAME}"
        echo "BEAMLINE_CONFIG          = ${BEAMLINE_CONFIG}"
        echo "BEAMLINE_CONFIG_VERSION  = ${BEAMLINE_CONFIG_VERSION}"
Whitney Armstrong's avatar
Whitney Armstrong committed
        echo "JUGGLER_DETECTOR         = ${JUGGLER_DETECTOR}"
        echo "JUGGLER_DETECTOR_VERSION = ${CI_COMMIT_REF_NAME}"
        echo "JUGGLER_DETECTOR_VERSION=$CI_COMMIT_REF_NAME" >> juggler.env
        echo "JUGGLER_DETECTOR=$JUGGLER_DETECTOR" >> juggler.env
        echo "BEAMLINE_CONFIG=$BEAMLINE_CONFIG" >> juggler.env
        echo "BEAMLINE_CONFIG_VERSION=$BEAMLINE_CONFIG_VERSION" >> juggler.env
Whitney Armstrong's avatar
Whitney Armstrong committed
      fi
  artifacts:
    reports:
      dotenv: juggler.env


compile:
  stage: build
  needs:
    - ["env"]
  script:
    - mkdir -p build && cd build && cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j20 && make install  && cd ..
Whitney Armstrong's avatar
Whitney Armstrong committed
    - echo "Build successful."

.views:
  stage: docs
  needs:
    - ["compile"]
  artifacts:
    paths:
      - images/
      - doc/

include:
  - local: 'views/view1.yml'
  - local: 'views/view2.yml'
  - local: 'views/view3.yml'
  - local: 'views/view6.yml'
  - local: 'views/view7.yml'
  - local: 'views/config.yml'

report:
  stage: finalize
  needs: 
    - view_01
    - dawn_view_02:detector
    - dawn_view_03:detector
Whitney Armstrong's avatar
Whitney Armstrong committed
    - dump_constants
Whitney Armstrong's avatar
Whitney Armstrong committed
  artifacts:
    paths:
      - images/
      - doc/
  script:
    - pip3 install jinja2 &&  ls -lrth
    - ./bin/make_images > doc/dawn_views.md

Whitney Armstrong's avatar
Whitney Armstrong committed
dump_constants:
  stage: test
  needs: 
    - ["compile"]
  script:
    - npdet_info dump reference_detector.xml  | tee doc/constants.out 
Whitney Armstrong's avatar
Whitney Armstrong committed

overlap_check:
  stage: test
  needs: 
    - ["compile"]
  script:
Jihee Kim's avatar
Jihee Kim committed
    - checkOverlaps -c reference_detector.xml  | tee doc/overlap_check.out 
Whitney Armstrong's avatar
Whitney Armstrong committed
    - echo "$(cat doc/overlap_check.out | grep ovlp | wc -l) overlaps..."
    - if [[ "$(cat doc/overlap_check.out | grep ovlp | wc -l)" -gt "1" ]] ; then echo "Overlaps exist!" && false ; fi

detector:config_testing:
Whitney Armstrong's avatar
Whitney Armstrong committed
  stage: test
  needs: 
    - ["compile"]
  script:
Jihee Kim's avatar
Jihee Kim committed
    - checkOverlaps -c reference_detector.xml  | tee doc/overlap_check.out | wc -l
Whitney Armstrong's avatar
Whitney Armstrong committed
    - cat doc/overlap_check.out
  allow_failure: true

benchmarks:reconstruction:
  stage: deploy
  variables:
    JUGGLER_DETECTOR: "$JUGGLER_DETECTOR"
    JUGGLER_DETECTOR_VERSION: "$JUGGLER_DETECTOR_VERSION"
    BEAMLINE_CONFIG: "$BEAMLINE_CONFIG"
    BEAMLINE_CONFIG_VERSION: "$BEAMLINE_CONFIG_VERSION"
  trigger:
    project: EIC/benchmarks/reconstruction_benchmarks
    strategy: depend
  needs: ["env","overlap_check","report"]
  

benchmarks:physics:
  stage: deploy
  variables:
    JUGGLER_DETECTOR: "$JUGGLER_DETECTOR"
    JUGGLER_DETECTOR_VERSION: "$JUGGLER_DETECTOR_VERSION"
    BEAMLINE_CONFIG: "$BEAMLINE_CONFIG"
    BEAMLINE_CONFIG_VERSION: "$BEAMLINE_CONFIG_VERSION"
  trigger:
    project: EIC/benchmarks/physics_benchmarks
    strategy: depend
  needs: ["env","overlap_check","report"]
Whitney Armstrong's avatar
Whitney Armstrong committed