Skip to content

Commit

Permalink
Prepare QC json fetching from apricot
Browse files Browse the repository at this point in the history
  • Loading branch information
martenole committed May 31, 2024
1 parent 370b6e6 commit 05b3cfc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions DATA/common/gen_topo_helper_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
7 changes: 7 additions & 0 deletions DATA/production/qc-workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 05b3cfc

Please sign in to comment.