diff --git a/DATA/common/gen_topo_helper_functions.sh b/DATA/common/gen_topo_helper_functions.sh index 6efe2d7f8..e7fc3fa68 100755 --- a/DATA/common/gen_topo_helper_functions.sh +++ b/DATA/common/gen_topo_helper_functions.sh @@ -252,6 +252,7 @@ if [[ "${GEN_TOPO_DEPLOYMENT_TYPE:-}" == "ALICE_STAGING" ]]; then else GEN_TOPO_QC_CONSUL_SERVER=alio2-cr1-hv-con01.cern.ch fi +GEN_TOPO_QC_APRICOT_SERVER=`curl -s "http://${GEN_TOPO_QC_CONSUL_SERVER}:8500/v1/kv/o2/runtime/aliecs/vars/apricot_endpoint?raw"` add_QC_from_consul() { @@ -268,4 +269,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 "${GEN_TOPO_QC_APRICOT_SERVER}/${1}?process=true" + 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}$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 3e47089f7..00d2d4952 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 "${GEN_TOPO_QC_APRICOT_SERVER}/${2/apricot:\/\/o2\//}?process=true" + if [[ $? != 0 ]]; then + echo "Error fetching QC JSON $2" + exit 1 + fi else TMP_FILENAME=$2 fi