diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 40a2f9aa4b77303114828c2f0a889cea667d1df3..755d435fc8e4e8a6353bdeeb4a0a4fe44df8aca3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,8 @@ default: stages: - data_init - - detectors + - benchmarks + # - simulate #- others get_data: @@ -24,42 +25,73 @@ get_data: - git clone https://eicweb.phy.anl.gov/EIC/datasets.git datasets - ln -s datasets/data - mkdir -p results - # artifacts: - # paths: - # - datasets -track_test1: - stage: detectors +generate_config: + stage: data_init tags: - sodium script: - - bash trackers/dummy_test.sh - allow_failure: true + - ./bin/gen_ci_config -p track_test_ -i trackers > results/trackers_config.yml + - ./bin/gen_ci_config -p cal_test_ -i calorimeters > results/calorimeters_config.yml + - ./bin/gen_ci_config -p pid_test_ -i pid > results/pid_config.yml -cal_test1: - stage: detectors - tags: - - sodium - script: - - bash calorimeters/dummy_test.sh - allow_failure: true +calorimeters-pipeline: + stage: benchmarks + trigger: + include: + - artifact: results/calorimeters_config.yml + job: generate-config -cal_test2: - stage: detectors - tags: - - sodium - script: - - root -b -q calorimeters/zdc_neutrons_reader.cxx - allow_failure: true +trackers-pipeline: + stage: benchmarks + trigger: + include: + - artifact: results/trackers_config.yml + job: generate-config +pid-pipeline: + stage: benchmarks + trigger: + include: + - artifact: results/pid_config.yml + job: generate-config -pid_test1: - stage: detectors - tags: - - sodium - script: - - bash pid/dummy_test.sh - allow_failure: true + # artifacts: + # paths: + # - datasets + + #track_test1: + # stage: detectors + # tags: + # - sodium + # script: + # - bash trackers/dummy_test.sh + # allow_failure: true + # + #cal_test1: + # stage: detectors + # tags: + # - sodium + # script: + # - bash calorimeters/dummy_test.sh + # allow_failure: true + # + #cal_test2: + # stage: detectors + # tags: + # - sodium + # script: + # - root -b -q calorimeters/zdc_neutrons_reader.cxx + # allow_failure: true + + + #pid_test1: + # stage: detectors + # tags: + # - sodium + # script: + # - bash pid/dummy_test.sh + # allow_failure: true #pages: diff --git a/bin/gen_ci_config b/bin/gen_ci_config new file mode 100755 index 0000000000000000000000000000000000000000..1cb482d658f44f3de2b73ffed9421a0d49a0a9dd --- /dev/null +++ b/bin/gen_ci_config @@ -0,0 +1,86 @@ +#!/bin/bash +set -o nounset +set -o errexit + +CI_TAG=sodium +BENCHMARK_SCRIPT_DIR=. +CI_JOB_PREFIX=cal_test_ + +function print_the_help { + echo "USAGE: $0 [-t <runner_tag>] " + echo " OPTIONS: " + echo " -i,--input Input scripts directory " + echo " -t,--tag Gitlab Runner tag" + echo " -p,--prefix job name prefix" + exit +} + +POSITIONAL=() +while [[ $# -gt 0 ]] +do + key="$1" + case $key in + -h|--help) + shift # past argument + print_the_help + ;; + -i|--input) + BENCHMARK_SCRIPT_DIR="$2" + shift # past argument + shift # past value + ;; + -t|--tag) + CI_TAG="$2" + shift # past argument + shift # past value + ;; + -p|--prefix) + CI_JOB_PREFIX="$2" + shift # past argument + shift # past value + ;; + *) # unknown option + #POSITIONAL+=("$1") # save it in an array for later + echo "unknown option $1" + print_the_help + shift # past argument + ;; + esac +done +set -- "${POSITIONAL[@]}" # restore positional parameters + +shopt -s nullglob +ifile=0 + +for script_name in ${BENCHMARK_SCRIPT_DIR}/*.sh +do + filename=$(basename ${script_name}) + filename_noext="${filename%%.*}" + ifile=$((ifile+1)) + cat <<EOF +${CI_JOB_PREFIX}${ifile}_${filename_noext}: + tags: + - ${CI_TAG} + script: + - bash ${script_name} + allow_failure: true + +EOF +done + +for script_name in ${BENCHMARK_SCRIPT_DIR}/*.cxx +do + filename=$(basename ${script_name}) + filename_noext="${filename%%.*}" + ifile=$((ifile+1)) + cat <<EOF +${CI_JOB_PREFIX}${ifile}_${filename_noext}: + tags: + - ${CI_TAG} + script: + - root -b -q ${script_name} + allow_failure: true + +EOF +done + diff --git a/calorimeters/dummy_test2.sh b/calorimeters/dummy_test2.sh new file mode 100644 index 0000000000000000000000000000000000000000..bfca0dfaacf2a614c15e30aa32c82f8fecfa62eb --- /dev/null +++ b/calorimeters/dummy_test2.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +echo "Calorimeter Dummy Test 2..." +echo "passes." + +exit 0 diff --git a/calorimeters/gen_ci_config b/calorimeters/gen_ci_config deleted file mode 100755 index a6686320c3ca4755e6b091b0a5e60aca674e4c5f..0000000000000000000000000000000000000000 --- a/calorimeters/gen_ci_config +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -set -o nounset -set -o errexit - -CI_TAG=sodium - -function print_the_help { - echo "USAGE: $0 [-t <runner_tag>] " - echo " OPTIONS: " - echo " -t,--tag Gitlab Runner tag" - exit -} - -POSITIONAL=() -while [[ $# -gt 0 ]] -do - key="$1" - case $key in - -h|--help) - shift # past argument - print_the_help - ;; - -t|--tag) - CI_TAG="$2" - shift # past argument - shift # past value - ;; - *) # unknown option - #POSITIONAL+=("$1") # save it in an array for later - echo "unknown option $1" - print_the_help - shift # past argument - ;; - esac -done -set -- "${POSITIONAL[@]}" # restore positional parameters - -cat <<EOF -cal_test1: - stage: detectors - tags: - - ${CI_TAG} - script: - - bash calorimeters/dummy_test.sh - allow_failure: true - -cal_test2: - stage: detectors - tags: - - ${CI_TAG} - script: - - root -b -q calorimeters/zdc_neutrons_reader.cxx - allow_failure: true - -EOF