forked from cms-sw/cms-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-igprof-pr
executable file
·55 lines (43 loc) · 2.11 KB
/
run-igprof-pr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh -ex
# Runs igprof for a pull request
# RELEASE_FORMAT: the IB to be used for the tests
# PULL_REQUEST_NUMBER: Number of the pull request to be tested
# LAST_COMMIT: latest commit of the pull request to report the status
# AUTO_POST_MESSAGE: to inform that the tests are running
# PULL_REQUEST_JOB_ID: original jobID of the Pull request
# for now this is only run for 25202
# Reset kerberos token every time you run.
aklog
kinit cmsbuild@CERN.CH -k -t ~/private/cmsbuild.keytab
export SCRAM_ARCH=$ARCHITECTURE
scram project $RELEASE_FORMAT
pushd $RELEASE_FORMAT
eval `scram run -sh`
popd
mkdir $WORKSPACE/results
if [ "X$AUTO_POST_MESSAGE" = Xtrue ]; then
rsync cmsbuild@vocms12.cern.ch:/data/sdt/SDT/jenkins-artifacts/pull-request-integration/PR-$PULL_REQUEST_NUMBER/$PULL_REQUEST_JOB_ID/testsResults.txt $WORKSPACE/results/testsResults.txt
sed -i "s/IGPROF;.*/IGPROF;RUNNING/g" $WORKSPACE/results/testsResults.txt
rsync $WORKSPACE/results/testsResults.txt cmsbuild@vocms12.cern.ch:/data/sdt/SDT/jenkins-artifacts/pull-request-integration/PR-$PULL_REQUEST_NUMBER/$PULL_REQUEST_JOB_ID/testsResults.txt
$WORKSPACE/report-pull-request-results TESTS_RUNNING -t cmsbuild --pr $PULL_REQUEST_NUMBER -c $LAST_COMMIT --pr-job-id $PULL_REQUEST_JOB_ID --add-message "Running IGProf"
fi
mkdir "$WORKSPACE/igprof-results-data"
pushd "$WORKSPACE/igprof-results-data"
runTheMatrix.py -l 25202 --command '--profile mp' 2>&1 | tee -a $WORKSPACE/igprof-results-data/runTheMatrix.log
ls
find $WORKSPACE/igprof-results-data/* -type d | while read d; do
echo "processing dir $d"
for f in $d/*.gz
do
echo "processing file $f"
OUTFILE=${f//.gz/.sql}
echo $OUTFILE
igprof-analyse -d -c $f --sqlite | sqlite3 $OUTFILE 2>&1 | tee -a $WORKSPACE/igprof-results-data/igprof-analyse.log
done
ls $d
done
popd
if [ "X$AUTO_POST_MESSAGE" = Xtrue ]; then
sed -i "s/IGPROF;.*/IGPROF;OK/g" $WORKSPACE/results/testsResults.txt
rsync $WORKSPACE/results/testsResults.txt cmsbuild@vocms12.cern.ch:/data/sdt/SDT/jenkins-artifacts/pull-request-integration/PR-$PULL_REQUEST_NUMBER/$PULL_REQUEST_JOB_ID/testsResults.txt
fi