forked from fastmachinelearning/sonic-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·80 lines (71 loc) · 2.05 KB
/
setup.sh
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
module --force purge
export PATH=$PATH:$HOME/.local/bin:$HOME/bin
alias scram="/cvmfs/cms.cern.ch/common/scram"
alias scramv1="/cvmfs/cms.cern.ch/common/scramv1"
source /cvmfs/cms.cern.ch/cmsset_default.sh
ACCESS=ssh
CORES=8
BATCH=""
CMSSWVER=CMSSW_12_5_0_pre4
CMSSWVERS=(
CMSSW_12_5_0_pre4 \
CMSSW_12_0_0_pre5 \
)
ARCH=slc7_amd64_gcc900 # Hammer
# ARCH=el8_amd64_gcc10 # Purdue Analysis Facility (Geddes)
usage(){
EXIT=$1
echo "setup.sh [options]"
echo ""
echo "-B configure some settings for checkout within batch setups (default = ${BATCH})"
echo "-C choose CMSSW version (default = ${CMSSWVER}, choices=${CMSSWVERS[@]})"
echo "-a [protocol] use protocol to clone (default = ${ACCESS}, alternative = https)"
echo "-j [cores] run CMSSW compilation on # cores (default = ${CORES})"
echo "-h display this message and exit"
exit $EXIT
}
# process options
while getopts "BC:a:j:h" opt; do
case "$opt" in
B) BATCH=--upstream-only
;;
C) CMSSWVER=$OPTARG
;;
a) ACCESS=$OPTARG
;;
j) CORES=$OPTARG
;;
h) usage 0
;;
esac
done
# check options
if [ "$ACCESS" = "ssh" ]; then
ACCESS_GITLAB=ssh://[email protected]:7999/
ACCESS_CMSSW=--ssh
elif [ "$ACCESS" = "https" ]; then
ACCESS_GITHUB=https://github.com/
ACCESS_GITLAB=https://gitlab.cern.ch/
ACCESS_CMSSW=--https
else
usage 1
fi
# check CMSSW version
if [[ ! " ${CMSSWVERS[@]} " =~ " $CMSSWVER " ]]; then
echo "Unsupported CMSSW version: $CMSSWVER"
usage 1
fi
export SCRAM_ARCH=$ARCH
scram project $CMSSWVER
cd ${CMSSWVER}/src
eval `scramv1 runtime -sh`
git cms-init $ACCESS_CMSSW $BATCH
git cms-checkout-topic $ACCESS_CMSSW fastmachinelearning:${CMSSWVER}_SONIC
git cms-addpkg HeterogeneousCore/SonicTriton
git clone ${ACCESS_GITHUB}fastmachinelearning/sonic-models HeterogeneousCore/SonicTriton/data
git cms-addpkg RecoBTag/Combined
git clone ${ACCESS_GITHUB}fastmachinelearning/RecoBTag-Combined -b add_noragged RecoBTag/Combined/data
git clone ${ACCESS_GITHUB}kondratyevd/sonic-workflows
scram b -j ${CORES}