Skip to content

Commit 1ec989d

Browse files
martenoleshahor02
authored andcommitted
Prepare QC json fetching from apricot
1 parent 7107204 commit 1ec989d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

DATA/common/gen_topo_helper_functions.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ if [[ "${GEN_TOPO_DEPLOYMENT_TYPE:-}" == "ALICE_STAGING" ]]; then
252252
else
253253
GEN_TOPO_QC_CONSUL_SERVER=alio2-cr1-hv-con01.cern.ch
254254
fi
255+
GEN_TOPO_QC_APRICOT_SERVER=`curl -s "http://${GEN_TOPO_QC_CONSUL_SERVER}:8500/v1/kv/o2/runtime/aliecs/vars/apricot_endpoint?raw"`
255256

256257
add_QC_from_consul()
257258
{
@@ -268,4 +269,19 @@ add_QC_from_consul()
268269
add_W o2-qc "--config $QC_CONFIG_ARG $2"
269270
}
270271

272+
add_QC_from_apricot()
273+
{
274+
if [[ ! -z ${GEN_TOPO_QC_JSON_FILE:-} ]]; then
275+
curl -s -o $GEN_TOPO_QC_JSON_FILE "${GEN_TOPO_QC_APRICOT_SERVER}/${1}?process=true"
276+
if [[ $? != 0 ]]; then
277+
echo "Error fetching QC JSON $1"
278+
exit 1
279+
fi
280+
QC_CONFIG_ARG="json://${GEN_TOPO_QC_JSON_FILE}"
281+
else
282+
QC_CONFIG_ARG="apricot://${GEN_TOPO_QC_APRICOT_SERVER}$1"
283+
fi
284+
add_W o2-qc "--config $QC_CONFIG_ARG $2"
285+
}
286+
271287
fi # functions.sh sourced

DATA/production/qc-workflow.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ add_QC_JSON() {
2626
echo "Error fetching QC JSON $2"
2727
exit 1
2828
fi
29+
elif [[ ${2} =~ ^apricot://.* ]]; then
30+
TMP_FILENAME=$FETCHTMPDIR/$1.$RANDOM.$RANDOM.json
31+
curl -s -o $TMP_FILENAME "${GEN_TOPO_QC_APRICOT_SERVER}/${2/apricot:\/\/o2\//}?process=true"
32+
if [[ $? != 0 ]]; then
33+
echo "Error fetching QC JSON $2"
34+
exit 1
35+
fi
2936
else
3037
TMP_FILENAME=$2
3138
fi

0 commit comments

Comments
 (0)