Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare QC json fetching from apricot #1655

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions DATA/common/gen_topo_helper_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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
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 "${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
Expand Down