Skip to content

Commit

Permalink
Add option to run hlt p2 timing script for PRs (#2240)
Browse files Browse the repository at this point in the history
* Add option to run hlt p2 timing script for PRs

* Changes from review

* Changes from review; put logs and resource files in correct dirs

* send_jenkins_artifacts takes directory, not file(s)

* Changes from review

* Fix

* Changes from review

* jenkins jobs drops every thing afetr first -

* Update run-pr-hlt-p2-timing.sh

* Update run-pr-hlt-p2-timing.sh

* Update run-pr-hlt-p2-timing.sh

* Update run-pr-hlt-p2-timing.sh

* Update test_multiple_prs.sh

* set order for report/failed

* Update run-pr-hlt-p2-timing.sh

* Update run-pr-hlt-p2-timing.sh

* looks like + in url is not working

* Update pr_testing/run-pr-hlt-p2-timing.sh

* cleanup; only upload json file to hlt-p2-timing area

* run hlt-p2 test in separate dir so that we do not upload every thing

---------

Co-authored-by: Malik Shahzad Muzaffar <[email protected]>
  • Loading branch information
iarspider and smuzaffar authored May 24, 2024
1 parent 9989b7e commit bab0431
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
40 changes: 40 additions & 0 deletions pr_testing/run-pr-hlt-p2-timing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash -ex
source $WORKSPACE/cms-bot/pr_testing/setup-pr-test-env.sh

PR_REPO_NUM=$(echo $PULL_REQUEST | sed 's|^.*/||;s|#||')
UPLOAD_PATH="${CMSSW_VERSION}-${PR_REPO_NUM}/${ARCHITECTURE}/${BUILD_NUMBER}"
# Report test started
mark_commit_status_all_prs 'hlt-p2-timing' 'pending' -u "${BUILD_URL}" -d "Running"

# Do work
HLT_P2_SCRIPT="src/HLTrigger/Configuration/python/HLT_75e33/test/runHLTTiming.sh"
if [ -e ${CMSSW_BASE}/${HLT_P2_SCRIPT} ] ; then
HLT_P2_SCRIPT="${CMSSW_BASE}/${HLT_P2_SCRIPT}"
else
HLT_P2_SCRIPT="${CMSSW_RELEASE_BASE}/${HLT_P2_SCRIPT}"
fi

mkdir -p ${RESULTS_DIR} $WORKSPACE/json_upload $WORKSPACE/rundir
pushd $WORKSPACE/rundir
export LOCALRT=${WORKSPACE}/${CMSSW_VERSION}
timeout $TIMEOUT ${HLT_P2_SCRIPT} 2>&1 | tee ${RESULTS_DIR}/hlt-p2-timing.log
popd

# Upload results
source $WORKSPACE/cms-bot/jenkins-artifacts
touch ${RESULTS_DIR}/15-hlt-p2-timing-report.res ${RESULTS_DIR}/15-hlt-p2-timing-failed.res
if [ -f $WORKSPACE/rundir/Phase2Timing_resources.json ] ; then
CHART_URL="https://cmssdt.cern.ch/circles/web/piechart.php?data_name=hlt-p2-timing&resource=time_thread&filter=${CMSSW_VERSION}&dataset=${UPLOAD_PATH}/Phase2Timing_resources"
echo "HLT_P2_TIMING;SUCCESS,HLT Phase 2 timing Test,See Chart,${CHART_URL}" >> ${RESULTS_DIR}/hlt-p2-timing.txt
echo "\n* **HLT P2 Timing**: [chart](${CHART_URL})" > ${RESULTS_DIR}/15-hlt-p2-timing-report.res

mv $WORKSPACE/rundir/Phase2Timing*.json $WORKSPACE/json_upload
send_jenkins_artifacts $WORKSPACE/json_upload hlt-p2-timing/${UPLOAD_PATH}
mark_commit_status_all_prs 'hlt-p2-timing' 'success' -u "${BUILD_URL}" -d "HLT Phase2 timing data collected"
else
echo "HLT_P2_TIMING;ERROR,HLT Phase 2 timing Test,See Logs,hlt-p2-timing.log" >> ${RESULTS_DIR}/hlt-p2-timing.txt
echo "HLTP2Timing" > ${RESULTS_DIR}/15-hlt-p2-timing-failed.res
mark_commit_status_all_prs 'hlt-p2-timing' 'error' -u "${BUILD_URL}" -d "HLT Phase2 timing script failed"
fi
rm -rf $WORKSPACE/json_upload $WORKSPACE/rundir
prepare_upload_results
15 changes: 15 additions & 0 deletions pr_testing/test_multiple_prs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ DO_COMPARISON=false
DO_MB_COMPARISON=false
DO_DAS_QUERY=false
DO_CRAB_TESTS=false
DO_HLT_P2_TIMING=false
[ $(echo ${ARCHITECTURE} | grep "_amd64_" | wc -l) -gt 0 ] && DO_COMPARISON=true
[ $(echo ${RELEASE_FORMAT} | grep 'SAN_X' | wc -l) -gt 0 ] && DO_COMPARISON=false
BUILD_VERBOSE=true
Expand Down Expand Up @@ -1157,11 +1158,20 @@ if [ "X$BUILD_OK" = Xtrue -a "$RUN_TESTS" = "true" ]; then
DO_GPU_TESTS=true
mark_commit_status_all_prs 'unittests/gpu' 'pending' -u "${BUILD_URL}" -d "Waiting for tests to start"
fi
if [ $(echo ${ENABLE_BOT_TESTS} | tr ',' ' ' | tr ' ' '\n' | grep '^HLT_P2_TIMING$' | wc -l) -gt 0 ] ; then
if [ $(echo ${ARCHITECTURE} | grep "_amd64_" | wc -l) -gt 0 ] ; then
if [ -e ${CMSSW_RELEASE_BASE}/src/HLTrigger/Configuration/python/HLT_75e33/test/runHLTTiming.sh ]; then
DO_HLT_P2_TIMING=true
mark_commit_status_all_prs 'hlt-p2-timing' 'pending' -u "${BUILD_URL}" -d "Waiting for tests to start"
fi
fi
fi
else
DO_TESTS=false
DO_SHORT_MATRIX=false
DO_ADDON_TESTS=false
DO_CRAB_TESTS=false
DO_HLT_P2_TIMING=false
fi

REPORT_OPTS="--report-url ${PR_RESULT_URL} $NO_POST"
Expand Down Expand Up @@ -1327,4 +1337,9 @@ if [ "${DO_PROFILING}" = "true" ] ; then
echo "PROFILING_WORKFLOWS=${wf}" >> $WORKSPACE/run-profiling-$wf.prop
done
fi

if [ "${DO_HLT_P2_TIMING}" = "true" ] ; then
cp $WORKSPACE/test-env.txt $WORKSPACE/run-hlt_p2_timing.prop
fi

rm -f $WORKSPACE/test-env.txt
2 changes: 1 addition & 1 deletion process_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def format(s, **kwds):
ALL_CHECK_FUNCTIONS = None
EXTRA_RELVALS_TESTS = ["threading", "gpu", "high-stats", "nano"]
EXTRA_RELVALS_TESTS_OPTS = "_" + "|_".join(EXTRA_RELVALS_TESTS)
EXTRA_TESTS = "|".join(EXTRA_RELVALS_TESTS) + "|profiling|none"
EXTRA_TESTS = "|".join(EXTRA_RELVALS_TESTS) + "|hlt_p2_timing|profiling|none"
SKIP_TESTS = "|".join(["static", "header"])
ENABLE_TEST_PTRN = "enable(_test(s|)|)"
JENKINS_NODES = "[a-zA-Z0-9_|&\s()-]+"
Expand Down

0 comments on commit bab0431

Please sign in to comment.