Skip to content
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
24 changes: 14 additions & 10 deletions DATA/common/gen_topo_helper_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,18 @@ add_W() # Add binarry to workflow command USAGE: add_W [BINARY] [COMMAND_LINE_OP
WORKFLOW+=$WFADD
}

if [[ "${GEN_TOPO_DEPLOYMENT_TYPE:-}" == "ALICE_STAGING" ]]; then
GEN_TOPO_QC_CONSUL_SERVER=ali-staging.cern.ch
else
GEN_TOPO_QC_CONSUL_SERVER=alio2-cr1-hv-con01.cern.ch
if [[ ${EPNSYNCMODE:-0} == 1 && "${WORKFLOW_PARAMETERS:-}" =~ (^|,)"QC"(,|$) ]]; then
if [[ "${GEN_TOPO_DEPLOYMENT_TYPE:-}" == "ALICE_STAGING" ]]; then
GEN_TOPO_QC_CONSUL_SERVER=ali-staging.cern.ch
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"`
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()
{
[[ ${EPNSYNCMODE:-0} == 1 ]] || { echo "Error fetching QC JSON $1: consul server only set for EPNSYNCMODE == 1 " 1>&2 && exit 1; }
if [[ ! -z ${GEN_TOPO_QC_JSON_FILE:-} ]]; then
curl -s -o $GEN_TOPO_QC_JSON_FILE "http://${GEN_TOPO_QC_CONSUL_SERVER}:8500/v1/kv${1}?raw"
if [[ $? != 0 ]]; then
Expand All @@ -276,12 +279,13 @@ add_QC_from_consul()

add_QC_from_apricot()
{
[[ ${EPNSYNCMODE:-0} == 1 ]] || { echo "Error fetching QC JSON $1: apricot server only set for EPNSYNCMODE == 1 " 1>&2 && exit 1; }
if [[ ! -z ${GEN_TOPO_QC_JSON_FILE:-} ]]; then
if [[ ${1} =~ "?" ]]; then
curl -s -o $GEN_TOPO_QC_JSON_FILE "${GEN_TOPO_QC_APRICOT_SERVER}/${1}\&process=true"
else
curl -s -o $GEN_TOPO_QC_JSON_FILE "${GEN_TOPO_QC_APRICOT_SERVER}/${1}?process=true"
fi
if [[ ${1} =~ "?" ]]; then
curl -s -o $GEN_TOPO_QC_JSON_FILE "${GEN_TOPO_QC_APRICOT_SERVER}/${1}\&process=true"
else
curl -s -o $GEN_TOPO_QC_JSON_FILE "${GEN_TOPO_QC_APRICOT_SERVER}/${1}?process=true"
fi
if [[ $? != 0 ]]; then
echo "Error fetching QC JSON $1"
exit 1
Expand Down
16 changes: 9 additions & 7 deletions DATA/production/qc-workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@ OUTPUT_SUFFIX=

add_QC_JSON() {
if [[ ${2} =~ ^consul://.* ]]; then
[[ $EPNSYNCMODE == 1 ]] || { echo "Error fetching QC JSON $2: consul server is used for EPNSYNCMODE == 1 only" 1>&2 && exit 1; }
TMP_FILENAME=$FETCHTMPDIR/$1.$RANDOM.$RANDOM.json
curl -s -o $TMP_FILENAME "http://${GEN_TOPO_QC_CONSUL_SERVER}:8500/v1/kv/${2/consul:\/\//}?raw"
if [[ $? != 0 ]]; then
echo "Error fetching QC JSON $2"
echo "Error fetching QC JSON $2" 1>&2
exit 1
fi
elif [[ ${2} =~ ^apricot://.* ]]; then
[[ $EPNSYNCMODE == 1 ]] || { echo "Error fetching QC JSON $2: apricot server is used for EPNSYNCMODE == 1 only" 1>&2 && exit 1; }
TMP_FILENAME=$FETCHTMPDIR/$1.$RANDOM.$RANDOM.json
if [[ ${2} =~ "?" ]]; then
curl -s -o $TMP_FILENAME "${GEN_TOPO_QC_APRICOT_SERVER}/${2/apricot:\/\/o2\//}\&run_type=${RUNTYPE:-}\&beam_type=${BEAMTYPE:-}\&process=true"
else
curl -s -o $TMP_FILENAME "${GEN_TOPO_QC_APRICOT_SERVER}/${2/apricot:\/\/o2\//}?run_type=${RUNTYPE:-}\&beam_type=${BEAMTYPE:-}\&process=true"
fi
if [[ ${2} =~ "?" ]]; then
curl -s -o $TMP_FILENAME "${GEN_TOPO_QC_APRICOT_SERVER}/${2/apricot:\/\/o2\//}\&run_type=${RUNTYPE:-}\&beam_type=${BEAMTYPE:-}\&process=true"
else
curl -s -o $TMP_FILENAME "${GEN_TOPO_QC_APRICOT_SERVER}/${2/apricot:\/\/o2\//}?run_type=${RUNTYPE:-}\&beam_type=${BEAMTYPE:-}\&process=true"
fi

if [[ $? != 0 ]]; then
echo "Error fetching QC JSON $2"
echo "Error fetching QC JSON $2" 1>&2
exit 1
fi
else
Expand Down