1 |
slacapra |
1.1 |
#! /bin/sh
|
2 |
|
|
#
|
3 |
|
|
# Stefano Lacaprara <lacaprara@pd.infn.it> INFN Padova
|
4 |
|
|
#
|
5 |
|
|
# Initialization script for Crab and Boss
|
6 |
slacapra |
1.2 |
# Please read carefully the documentation (in INSTALL) before running this
|
7 |
|
|
# script! You might want _not_ to run it at all, or have your sys admin do it
|
8 |
|
|
# for you. Repeat: read the INSTALL file
|
9 |
slacapra |
1.1 |
#
|
10 |
slacapra |
1.2 |
# 25-Oct-2005
|
11 |
slacapra |
1.1 |
|
12 |
|
|
if [ -z "$CRABDIR" ]; then
|
13 |
|
|
echo "You must source crab.(c)sh before running this script"
|
14 |
|
|
exit 1
|
15 |
|
|
fi
|
16 |
|
|
|
17 |
|
|
BACKEND=SQLite
|
18 |
|
|
BOSSDBPATH=${HOME}/boss
|
19 |
|
|
BOSSDBNAME=bossCrab
|
20 |
|
|
|
21 |
|
|
# I have to configure BOSS
|
22 |
|
|
|
23 |
slacapra |
1.2 |
CONFSCRIPT=${BOSSDIR}/BossConfig.clad
|
24 |
slacapra |
1.1 |
cat > $CONFSCRIPT <<EOF
|
25 |
|
|
# This is the BOSS configuration file
|
26 |
|
|
|
27 |
|
|
[
|
28 |
|
|
# BOSS temporary directory (where files are extracted from DB)
|
29 |
|
|
BOSS_TMP_DIR = "/tmp";
|
30 |
|
|
# BOSS update interval
|
31 |
|
|
BOSS_MIN_UPD_INT = 5; # at most one update every BOSS_MIN_UPD_INT sec.
|
32 |
|
|
BOSS_MAX_UPD_INT = 30; # at least one update every BOSS_MAX_UPD_INT sec.
|
33 |
|
|
# Maximum retries after post-process finishes before killing RTUpdator
|
34 |
|
|
# (waits BOSS_UPD_INTERVAL*BOSS_MAX_RETRY seconds)
|
35 |
|
|
BOSS_MAX_RETRY = 3;
|
36 |
|
|
# Boss Database Backend
|
37 |
|
|
DB_BACKEND = "${BACKEND}";
|
38 |
|
|
]
|
39 |
|
|
EOF
|
40 |
|
|
|
41 |
|
|
## I must create ${BACKEND}Config.clad
|
42 |
|
|
|
43 |
|
|
# SQLlite
|
44 |
|
|
if [ "${BACKEND}" == "SQLite" ]; then
|
45 |
|
|
|
46 |
|
|
if [ ! -d ${BOSSDBPATH} ]; then
|
47 |
|
|
echo "creating ${BOSSDBPATH} directory"
|
48 |
|
|
mkdir ${BOSSDBPATH}
|
49 |
|
|
else
|
50 |
|
|
echo "Directory ${BOSSDBPATH} Already exist. Stoppping"
|
51 |
|
|
exit 1
|
52 |
|
|
fi
|
53 |
slacapra |
1.2 |
CONFSCRIPT=${BOSSDIR}/SQLiteConfig.clad
|
54 |
slacapra |
1.1 |
cat > $CONFSCRIPT <<EOF
|
55 |
|
|
# This is the BOSS SQLite database configuration file
|
56 |
|
|
[
|
57 |
|
|
SQLITE_DB_PATH = "${BOSSDBPATH}/";
|
58 |
|
|
DB_NAME = "${BOSSDBNAME}";
|
59 |
|
|
]
|
60 |
|
|
EOF
|
61 |
|
|
|
62 |
|
|
fi # Backend SQLite
|
63 |
|
|
|
64 |
|
|
# MySQL
|
65 |
|
|
if [ "${BACKEND}" == "MySQL" ]; then
|
66 |
|
|
HOST=`/bin/hostname`
|
67 |
|
|
DOMAIN=`/bin/hostname -d`
|
68 |
slacapra |
1.2 |
CONFSCRIPT=${BOSSDIR}/MySQLConfig.clad
|
69 |
slacapra |
1.1 |
/bin/rm -f $CONFSCRIPT
|
70 |
|
|
cat > $CONFSCRIPT <<EOF
|
71 |
|
|
|
72 |
|
|
# This is the BOSS MySQL Database configuration file
|
73 |
|
|
|
74 |
|
|
[
|
75 |
|
|
# BOSS MySQL database file
|
76 |
|
|
DB_NAME = "${BOSSDBNAME}";
|
77 |
|
|
# Host where the MySQL server is running
|
78 |
|
|
DB_HOST = "${HOST}";
|
79 |
|
|
DB_DOMAIN = "${DOMAIN}";
|
80 |
|
|
# Default BOSS MySQL user and password
|
81 |
|
|
DB_USER = "BOSSmanager";
|
82 |
|
|
DB_USER_PW = "BossMySQL";
|
83 |
|
|
# Guest BOSS MySQL user and password
|
84 |
|
|
DB_GUEST = "BOSSmonitor";
|
85 |
|
|
DB_GUEST_PW = "BossMySQL";
|
86 |
|
|
# MySQL table type
|
87 |
|
|
TABLE_TYPE = "";
|
88 |
|
|
# MySQL port
|
89 |
|
|
DB_PORT = 0;
|
90 |
|
|
# MySQL socket
|
91 |
|
|
DB_SOCKET = "";
|
92 |
|
|
# MySQL client flag
|
93 |
|
|
DB_CLIENT_FLAG = 0;
|
94 |
|
|
]
|
95 |
|
|
EOF
|
96 |
|
|
|
97 |
|
|
if [ "${BACKEND}" == "MySQL" ]; then
|
98 |
|
|
echo ""
|
99 |
|
|
# Check MySQL server
|
100 |
|
|
if [ `ps -d | grep mysqld | wc -l` != "0" ]; then
|
101 |
|
|
echo "Found a MySQL server on this host"
|
102 |
|
|
else
|
103 |
|
|
echo "MySQL server is not running on this host"
|
104 |
|
|
fi
|
105 |
|
|
fi
|
106 |
|
|
|
107 |
|
|
fi # backend MySQL
|
108 |
|
|
|
109 |
|
|
# I should have boss in my path
|
110 |
|
|
boss configureDB
|
111 |
|
|
|
112 |
|
|
# now register the schedulers
|
113 |
|
|
cd $CRABDIR/script/
|
114 |
|
|
#EDG
|
115 |
|
|
./registerEDGScheduler
|
116 |
|
|
#fork
|
117 |
|
|
./registerForkScheduler
|
118 |
|
|
# Glite
|
119 |
|
|
./registerGLITEScheduler
|
120 |
|
|
# LSF
|
121 |
|
|
# ./registerLSFScheduler
|
122 |
|
|
# PBS
|
123 |
|
|
# ./registerPBSScheduler
|
124 |
|
|
# Condor
|
125 |
|
|
# ./registerCONDORScheduler
|
126 |
|
|
# BBS
|
127 |
|
|
# ./registerBBSScheduler
|
128 |
|
|
|
129 |
|
|
# now register all Job Types
|
130 |
|
|
./registerEDGjob
|
131 |
|
|
./registerCRABjob
|
132 |
|
|
|
133 |
slacapra |
1.2 |
### register the RealTime monitor
|
134 |
|
|
CONFSCRIPT=${BOSSDIR}/MySQLRTConfig.clad
|
135 |
|
|
cat > $CONFSCRIPT <<EOF
|
136 |
|
|
# This is the BOSS RealTime configuration file
|
137 |
|
|
[
|
138 |
|
|
# BOSS MySQL database file
|
139 |
|
|
DB_NAME = "boss_rt_v3_6";
|
140 |
|
|
# Host where the MySQL server is running
|
141 |
|
|
DB_HOST = "boss.bo.infn.it";
|
142 |
|
|
DB_DOMAIN = "bo.infn.it";
|
143 |
|
|
# Default BOSS MySQL user and password
|
144 |
|
|
DB_USER = "BOSSv3_6manager";
|
145 |
|
|
DB_USER_PW = "BossMySQL";
|
146 |
|
|
# Guest BOSS MySQL user and password
|
147 |
|
|
DB_GUEST = "BOSSv3_6monitor";
|
148 |
|
|
DB_GUEST_PW = "BossMySQL";
|
149 |
|
|
# MySQL table type
|
150 |
|
|
TABLE_TYPE = "";
|
151 |
|
|
# MySQL port
|
152 |
|
|
DB_PORT = 0;
|
153 |
|
|
# MySQL socket
|
154 |
|
|
DB_SOCKET = "";
|
155 |
|
|
# MySQL client flag
|
156 |
|
|
DB_CLIENT_FLAG = 0;
|
157 |
|
|
]
|
158 |
|
|
EOF
|
159 |
|
|
./registerMySQLRTmon
|
160 |
slacapra |
1.1 |
|
161 |
|
|
cd -
|
162 |
|
|
|
163 |
|
|
# End
|
164 |
|
|
echo "BOSS configured to be used with crab\n"
|
165 |
|
|
echo ""
|
166 |
|
|
echo "Schedulers registered"
|
167 |
|
|
boss showSchedulers
|
168 |
|
|
|
169 |
|
|
echo ""
|
170 |
|
|
echo "Job types registered"
|
171 |
|
|
boss showJobTypes
|
172 |
slacapra |
1.2 |
|
173 |
|
|
echo ""
|
174 |
|
|
echo "Real Time monitoring registered"
|
175 |
|
|
boss showRTMon
|