Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed Docker image for GitLab CI pipeline, cmake tweaks #111

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
4eb90c4
Changed Docker image for GitLab CI pipeline
lobis Nov 9, 2021
db7b0b9
Merge branch 'master' into gitlab-ci-dockerimage
lobis Feb 3, 2022
d5a579c
added new docker image
lobis Feb 3, 2022
b416e14
Updated Garfield in CMake
lobis Feb 3, 2022
39e6571
Checking if GARFIELD_INSTALL exist and replacing GARFIELD_HOME in case
juanangp Feb 3, 2022
f56b2b7
Compatibility with newer versions of Garfield
lobis Feb 3, 2022
53b788f
Merge remote-tracking branch 'origin/gitlab-ci-dockerimage' into gitl…
lobis Feb 3, 2022
c4dc93f
Added back "FindGarfield.cmake" for backwards compatibility
lobis Feb 3, 2022
de05eb6
Removed FindGarfield.cmake macro, its already on the Garfield install…
lobis Feb 9, 2022
15df373
Formatted macros
lobis Feb 9, 2022
9f3cea1
formatting
lobis Feb 9, 2022
fd407b9
Removed old FindROOT.cmake macro (https://github.com/rest-for-physics…
lobis Feb 10, 2022
47d7837
Update .gitlab-ci.yml
lobis Feb 14, 2022
39ea28d
Update .gitlab-ci.yml
lobis Feb 14, 2022
af54836
updated cmake for new find_package macro to find root
lobis Feb 14, 2022
f310a71
updated libs
lobis Feb 14, 2022
b6fc67a
fixing root libs linking
lobis Feb 14, 2022
891522c
new way to define cint executable
lobis Feb 14, 2022
3a8ac88
Adding a new pipeline job to check restRoot loading using macros
jgalan Feb 14, 2022
96af18d
set job to debug level to see output
lobis Feb 16, 2022
766a627
more debug output
lobis Feb 16, 2022
43b1135
temporary debug exit
lobis Feb 16, 2022
b806090
more debug
lobis Feb 16, 2022
01f7d13
manually added quit (-q) to not start app.run() and avoid getting stu…
lobis Feb 16, 2022
b55f8c1
Merge branch 'master' into gitlab-ci-dockerimage
lobis Feb 16, 2022
0932efc
Merge branch 'master' into gitlab-ci-dockerimage
jgalan Feb 16, 2022
a1be228
restRoot dummy update
lobis Feb 16, 2022
2a19644
debug pipeline
lobis Feb 16, 2022
04aeb42
minor update to pipeline macro
lobis Feb 18, 2022
b2a6435
merge master action, fixed bad bracket
lobis Feb 18, 2022
1182eaa
removed -q flag, not processing macros...
lobis Feb 18, 2022
f09e254
fix small bug in macro
lobis Feb 18, 2022
3a0e9f5
Merge branch 'master' into gitlab-ci-dockerimage
jgalan Feb 18, 2022
c9ec71f
Merge branch 'master' into gitlab-ci-dockerimage
jgalan Feb 18, 2022
d8273d8
updated action for debugging
lobis Feb 18, 2022
c4bb93c
Merge branch 'gitlab-ci-dockerimage' of github.com:rest-for-physics/f…
jgalan Feb 18, 2022
a0c6c5c
Dummy commit
jgalan Feb 18, 2022
288adee
fix action
lobis Feb 18, 2022
c6d223b
action container version
lobis Feb 18, 2022
9483f33
added new root test
lobis Feb 18, 2022
23bb3d1
set runner tu ubuntu-latest
lobis Feb 18, 2022
b5fd664
update action runner
lobis Feb 18, 2022
3fb3ba9
update action
lobis Feb 18, 2022
ea87121
updated action
lobis Feb 18, 2022
a61cfdd
changed runner
lobis Feb 18, 2022
db555d1
changed action dockerimage
lobis Feb 18, 2022
4fbc7db
Update .gitlab-ci.yml
lobis Mar 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 42 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@ name: Build and Test
on:
workflow_dispatch:

env:
DOCKER_IMAGE: ghcr.io/lobis/root-geant4-garfield:cpp17_ROOT-v6-25-01_Geant4-v10.4.3_Garfield-4.0
REST_PATH: /rest/install

jobs:
Check-Image:
runs-on: self-hosted
runs-on: ubuntu-latest
container:
image: ghcr.io/lobis/root-geant4-garfield:cpp17_ROOT-v6-20-06_Geant4-v10.4.3_Garfield-4.0
image: ghcr.io/lobis/root-geant4-garfield:cpp17_ROOT-v6-25-01_Geant4-v10.4.3_Garfield-4.0

steps:
- name: Check ROOT is available in non-interactive shell
run: |
root-config --version
root-config --prefix
root-config --cflags
root -q
- name: Check Geant4 is available in non-interactive shell
run: |
geant4-config --version
Expand Down Expand Up @@ -43,31 +48,55 @@ jobs:
MediumMagboltz gas;
return 0;' -q

Build:
Build-and-Install:
needs: Check-Image
runs-on: self-hosted
runs-on: ubuntu-latest
container:
image: ghcr.io/lobis/root-geant4-garfield:cpp17_ROOT-v6-20-06_Geant4-v10.4.3_Garfield-4.0
env:
REST_PATH: /rest/install
image: ghcr.io/lobis/root-geant4-garfield:cpp17_ROOT-v6-25-01_Geant4-v10.4.3_Garfield-4.0

steps:
- uses: actions/checkout@v2

- name: Pull Submodules
run: yes | python3 pull-submodules.py --clean

- name: Build
- name: Build and Install
run: |
mkdir -p build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${{ env.REST_PATH } -DREST_WELCOME=OFF -DREST_GARFIELD=ON -DREST_G4=ON -DRESTLIB_DETECTOR=ON -DRESTLIB_RAW=ON -DRESTLIB_TRACK=ON
cmake .. -DCMAKE_INSTALL_PREFIX=${{ env.REST_PATH }} -DREST_WELCOME=OFF -DREST_GARFIELD=ON -DREST_G4=ON -DRESTLIB_DETECTOR=ON -DRESTLIB_RAW=ON -DRESTLIB_TRACK=ON
make -j$(nproc)
make install

- uses: actions/upload-artifact@master
with:
name: framework-install
path: ${{ env.REST_PATH }}

Basic-Checks:
needs: Build-and-Install
runs-on: ubuntu-latest
container:
image: ghcr.io/lobis/root-geant4-garfield:cpp17_ROOT-v6-25-01_Geant4-v10.4.3_Garfield-4.0

steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@master
with:
name: framework-install
path: ${{ env.REST_PATH }}

- name: REST config
run: |
${REST_PATH}/bin/rest-config --version
${REST_PATH}/bin/rest-config --libs
${REST_PATH}/bin/rest-config --flags
${REST_PATH}/bin/rest-config --commit
. ${{ env.REST_PATH }}/thisREST.sh
rest-config --version
rest-config --libs
rest-config --flags
rest-config --commit

- name: RestRoot
run: |
. ${{ env.REST_PATH }}/thisREST.sh
cd /pipeline/analysistree/
restRoot -b -q simpleTree.cpp
103 changes: 56 additions & 47 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
#image: lobis/root-geant4-garfieldpp:cxx14_ROOTv6-25-01_Geant4v10.4.3
image: nkx1231/root6-geant4-garfield:0.6
image: ghcr.io/lobis/root-geant4-garfield:cpp17_ROOT-v6-26-00_Geant4-v10.4.3_Garfield-af4a1451
# image: nkx1231/root6-geant4-garfield:0.6

variables:
# GIT_SUBMODULE_STRATEGY: recursive

stages:
# Basic checks to verify correctness of code
# Basic checks to verify correctness of code
- pre-build

# Project compilation validation
# Project compilation validation
- build

# REST libraries installed as sub-modules
# REST libraries installed as sub-modules
- libraries

# Basic validation tests of installation
# Basic validation tests of installation
- install

# Basic core validation tests
# Basic core validation tests
- core

# Stage dedicated to validate metadata classes. gas, readout, g4Metadata, etc
# Stage dedicated to validate metadata classes. gas, readout, g4Metadata, etc
- metadata

# Stage to validate restG4 package examples
# Stage to validate restG4 package examples
- restG4

# Stage to validate data chain processing constructions (TREX-DM data, PandaX-III topology, etc).
# Stage to validate data chain processing constructions (TREX-DM data, PandaX-III topology, etc).
- restManager_process

# Stage to validate tasks or executions over preprocessed data filesx
# Stage to validate tasks or executions over preprocessed data filesx
- postProcessing

# Stage to validate other restManager tasks (metadata generation, script loading, etc).
# Stage to validate other restManager tasks (metadata generation, script loading, etc).
- restManager_generate

# Scripts to launch more complete tests. TRestGas file generation, Geant4 physics validation, etc.
# Scripts to launch more complete tests. TRestGas file generation, Geant4 physics validation, etc.
- deploy

before_script:
- pwd
- export USER="test"
# - export GIT_SSL_NO_VERIFY=1
# - export GIT_SSL_NO_VERIFY=1
- echo $CI_SERVER_HOST
- echo $CRONJOB
# We redefine the HOME
# We redefine the HOME
- export HOME=${CI_PROJECT_DIR}/install_latest/
- if [ -d $HOME/.rest ]; then rm -Rf $HOME/.rest; fi
- if [ -f "/opt/root/install/bin/thisroot.sh" ]; then source /opt/root/install/bin/thisroot.sh; fi
Expand All @@ -54,9 +54,12 @@ before_script:
- if [ -d "/opt/garfieldpp/install" ]; then export GARFIELD_HOME=/opt/garfieldpp/install; fi
- if [ -d "/opt/garfieldpp/install" ]; then export HEED_DATABASE=$GARFIELD_HOME/Heed/heed++/database; fi
- if [ -d "/opt/garfieldpp/install" ]; then export LD_LIBRARY_PATH=$GARFIELD_HOME/lib:$LD_LIBRARY_PATH; fi
- ls $GARFIELD_HOME
- if [[ -v GARFIELD_INSTALL ]]; then export GARFIELD_HOME=$GARFIELD_INSTALL; fi
- echo $GARFIELD_HOME
- echo $GARFIELD_INSTALL
- python3 --version
- apt update && apt install -y wget
- root -q

clang-format:
stage: pre-build
Expand All @@ -73,11 +76,11 @@ clang-format:
- $CRONJOB == "YES"

validateCode:
stage: pre-build
script:
- cd ${CI_PROJECT_DIR}/
- python3 pull-submodules.py --force --dontask
- python3 pipeline/validateProcesses.py source/libraries/
stage: pre-build
script:
- cd ${CI_PROJECT_DIR}/
- python3 pull-submodules.py --force --dontask
- python3 pipeline/validateProcesses.py source/libraries/

#axionLib:
# stage: libraries
Expand Down Expand Up @@ -124,7 +127,7 @@ build_latest:
- if [ -d ${CI_PROJECT_DIR}/install_latest ]; then rm -Rf ${CI_PROJECT_DIR}/install_latest; fi
- cmake ${CI_PROJECT_DIR} -DREST_WELCOME=OFF -DREST_GARFIELD=ON -DREST_G4=ON -DRESTLIB_DETECTOR=ON -DRESTLIB_RAW=ON -DRESTLIB_TRACK=ON -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/install_latest
- make install -j2
# - . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
# - . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
artifacts:
paths:
- ${CI_PROJECT_DIR}/install_latest
Expand All @@ -137,14 +140,14 @@ build_latest:
# - cd ${CI_PROJECT_DIR}/
# - python3 pull-submodules.py --force --dontask --latest
# - if [ -d ${CI_PROJECT_DIR}/build_latest2 ]; then rm -Rf ${CI_PROJECT_DIR}/build_latest2; fi
# - mkdir ${CI_PROJECT_DIR}/build_latest2 && cd ${CI_PROJECT_DIR}/build_latest2/
# - if [ -d ${CI_PROJECT_DIR}/install_latest2 ]; then rm -Rf ${CI_PROJECT_DIR}/install_latest2; fi
# - cmake ${CI_PROJECT_DIR} -DREST_WELCOME=OFF -DREST_GARFIELD=ON -DREST_G4=ON -DRESTLIB_DETECTOR=ON -DRESTLIB_RAW=ON -DRESTLIB_TRACK=ON -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/install_latest2
# - make install -j2
# - . ${CI_PROJECT_DIR}/install_latest2/thisREST.sh
# except:
# variables:
# - $CRONJOB == "YES"
# - mkdir ${CI_PROJECT_DIR}/build_latest2 && cd ${CI_PROJECT_DIR}/build_latest2/
# - if [ -d ${CI_PROJECT_DIR}/install_latest2 ]; then rm -Rf ${CI_PROJECT_DIR}/install_latest2; fi
# - cmake ${CI_PROJECT_DIR} -DREST_WELCOME=OFF -DREST_GARFIELD=ON -DREST_G4=ON -DRESTLIB_DETECTOR=ON -DRESTLIB_RAW=ON -DRESTLIB_TRACK=ON -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/install_latest2
# - make install -j2
# - . ${CI_PROJECT_DIR}/install_latest2/thisREST.sh
# except:
# variables:
# - $CRONJOB == "YES"

#build_nkx:
# image: nkx1231/root6-geant4-garfield:0.6
Expand All @@ -170,6 +173,12 @@ loadRESTLibs:
- . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
- restRoot -b -q

loadRESTMacros:
type: install
script:
- . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
- restRoot -m 1 -b -q -v 3

listRESTMacros:
type: install
script:
Expand Down Expand Up @@ -202,24 +211,24 @@ listRESTMacros:
expire_in: 1 day

LoadGas:
type: metadata
type: metadata
script:
- . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/metadata/gas/
- restRoot -b -q LoadGasFromServerAndValidate.C
only:
variables:
- $CI_SERVER_HOST == "lfna.unizar.es"
variables:
- $CI_SERVER_HOST == "lfna.unizar.es"

GenerateGas:
type: metadata
type: metadata
script:
- . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/metadata/gas/
- restRoot -b -q GenerateDummyGas.C
only:
variables:
- $CI_SERVER_HOST == "lfna.unizar.es"
variables:
- $CI_SERVER_HOST == "lfna.unizar.es"

AnalysisTree:
type: core
Expand All @@ -229,17 +238,17 @@ AnalysisTree:
- restRoot -b -q simpleTree.cpp

GenerateReadout:
type: metadata
type: metadata
script:
- . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/metadata/readout/
- restManager --c generateReadout.rml --o readout.root
- restRoot -b -q PrintReadout.C'("readout.root")' > /dev/null
# We need to introduce basic validation here
# - diff validation.txt print.txt
# We need to introduce basic validation here
# - diff validation.txt print.txt

BasicReadout:
type: metadata
type: metadata
script:
- . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
- cd ${CI_PROJECT_DIR}/projects/basic-readouts/
Expand All @@ -260,7 +269,7 @@ testMeta:
- ${CI_PROJECT_DIR}/install_latest/examples/meta.root
expire_in: 1 day

trexDM_data_latest:
trexDM_data_latest:
type: restManager_process
script:
- . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
Expand All @@ -279,7 +288,7 @@ trexDM_data_latest:
- ${CI_PROJECT_DIR}/pipeline/trex/Hits_01928.root
expire_in: 1 day

pandaXIII_Topological:
pandaXIII_Topological:
type: restManager_process
script:
- . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
Expand All @@ -293,7 +302,7 @@ pandaXIII_Topological:
- ${CI_PROJECT_DIR}/pipeline/pandaxiii_MC/trackParameter.png
expire_in: 1 week

pandaXIII_Topological_fromG4:
pandaXIII_Topological_fromG4:
type: restManager_process
script:
- . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
Expand All @@ -307,7 +316,7 @@ pandaXIII_Topological_fromG4:
- ${CI_PROJECT_DIR}/pipeline/pandaxiii_MC/testOutput.root
expire_in: 1 week

pandaXIII_data:
pandaXIII_data:
type: restManager_process
script:
- . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
Expand All @@ -319,16 +328,16 @@ pandaXIII_data:
paths:
- ${CI_PROJECT_DIR}/pipeline/pandaxiii_data/TriggerRate.png
expire_in: 1 week
EventSelection:

EventSelection:
type: restManager_process
script:
- . ${CI_PROJECT_DIR}/install_latest/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/selection
- restManager --c g4Analysis.rml --f "${CI_PROJECT_DIR}/install_latest/examples/restG4/01.NLDBD/Run00001_NLDBD_Test.root"
- restManager --c g4OnSelection.rml --f Run00001_NLDBD_Test_g4Analysis.root
- restRoot -b -q Validate.C'("Run00001_NLDBD_Test_EvSelection.root")'

artifacts:
paths:
- ${CI_PROJECT_DIR}/pipeline/selection/IDs.txt
Expand Down
34 changes: 20 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,26 @@ set(CMAKE_MACOSX_RPATH 1)

# ROOT libs and includes

find_package(ROOT REQUIRED)
set(ROOT_REQUIRED_LIBRARIES Core RIO Geom Gdml Minuit Spectrum)
# Switch to enable ROOT Eve functionality.
if (NOT DEFINED REST_EVE)
set(REST_EVE ON)
endif ()
if (${REST_EVE} MATCHES "ON")
add_definitions(-DUSE_Eve)
list(APPEND rest_features "Eve")
set(ROOT_REQUIRED_LIBRARIES ${ROOT_REQUIRED_LIBRARIES} Eve RGL)
else ()
set(excludes ${excludes} TRestEveEventViewer)
endif (${REST_EVE} MATCHES "ON")

find_package(ROOT REQUIRED COMPONENTS ${ROOT_REQUIRED_LIBRARIES})

message(STATUS "ROOT LIBRARIES: ${ROOT_LIBRARIES}")

set(external_libs "${external_libs};${ROOT_LIBRARIES}")

set(ROOTCINT_EXECUTABLE ${ROOT_rootcint_CMD})

execute_process(COMMAND root-config --has-cxx20 OUTPUT_VARIABLE HASCXX20)
execute_process(COMMAND root-config --has-cxx17 OUTPUT_VARIABLE HASCXX17)
Expand All @@ -76,19 +95,6 @@ elseif (${HASCXX11} MATCHES "yes")
endif ()

set(external_include_dirs ${external_include_dirs} ${ROOT_INCLUDE_DIRS})
set(external_libs ${external_libs} "${ROOT_LIBRARIES} -lGui -lGeom -lGdml -lMinuit -lSpectrum")

# Switch to enable ROOT Eve functionality.
if (NOT DEFINED REST_EVE)
set(REST_EVE ON)
endif ()
if (${REST_EVE} MATCHES "ON")
add_definitions(-DUSE_Eve)
list(APPEND rest_features "Eve")
set(external_libs "${external_libs} -lEve -lRGL")
else ()
set(excludes ${excludes} TRestEveEventViewer)
endif (${REST_EVE} MATCHES "ON")

# This is to enable linking of SQL libraries. I.e. for process TRestSQLToAnalysisProccess.
if (NOT DEFINED SQL)
Expand Down
Loading