From 05b3cfc75466e72e2b2f8543ef665ded71a8f91b Mon Sep 17 00:00:00 2001 From: Ole Schmidt Date: Fri, 31 May 2024 15:19:13 +0200 Subject: [PATCH] Prepare QC json fetching from apricot --- DATA/common/gen_topo_helper_functions.sh | 17 +++++++++++++++++ DATA/production/qc-workflow.sh | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/DATA/common/gen_topo_helper_functions.sh b/DATA/common/gen_topo_helper_functions.sh index 6efe2d7f8..e56667d1c 100755 --- a/DATA/common/gen_topo_helper_functions.sh +++ b/DATA/common/gen_topo_helper_functions.sh @@ -249,8 +249,10 @@ add_W() # Add binarry to workflow command USAGE: add_W [BINARY] [COMMAND_LINE_OP if [[ "${GEN_TOPO_DEPLOYMENT_TYPE:-}" == "ALICE_STAGING" ]]; then GEN_TOPO_QC_CONSUL_SERVER=ali-staging.cern.ch + GEN_TOPO_QC_APRICOT_SERVER=alio2-cr1-hv-mvs00.cern.ch else GEN_TOPO_QC_CONSUL_SERVER=alio2-cr1-hv-con01.cern.ch + GEN_TOPO_QC_APRICOT_SERVER=alio2-cr1-hv-aliecs.cern.ch fi add_QC_from_consul() @@ -268,4 +270,19 @@ add_QC_from_consul() add_W o2-qc "--config $QC_CONFIG_ARG $2" } +add_QC_from_apricot() +{ + if [[ ! -z ${GEN_TOPO_QC_JSON_FILE:-} ]]; then + curl -s -o $GEN_TOPO_QC_JSON_FILE "http://${GEN_TOPO_QC_APRICOT_SERVER}:32188/${1}?raw" + if [[ $? != 0 ]]; then + echo "Error fetching QC JSON $1" + exit 1 + fi + QC_CONFIG_ARG="json://${GEN_TOPO_QC_JSON_FILE}" + else + QC_CONFIG_ARG="apricot://${GEN_TOPO_QC_APRICOT_SERVER}:32188$1" + fi + add_W o2-qc "--config $QC_CONFIG_ARG $2" +} + fi # functions.sh sourced diff --git a/DATA/production/qc-workflow.sh b/DATA/production/qc-workflow.sh index 45d06d2c3..4337fe38b 100755 --- a/DATA/production/qc-workflow.sh +++ b/DATA/production/qc-workflow.sh @@ -26,6 +26,13 @@ add_QC_JSON() { echo "Error fetching QC JSON $2" exit 1 fi + elif [[ ${2} =~ ^apricot://.* ]]; then + TMP_FILENAME=$FETCHTMPDIR/$1.$RANDOM.$RANDOM.json + curl -s -o $TMP_FILENAME "http://${GEN_TOPO_QC_APRICOT_SERVER}:32188/${2/apricot:\/\/o2\//}?raw" + if [[ $? != 0 ]]; then + echo "Error fetching QC JSON $2" + exit 1 + fi else TMP_FILENAME=$2 fi