4 |
|
# |
5 |
|
# Installation script for Crab |
6 |
|
# |
7 |
< |
# 02-Nov-2005 |
7 |
> |
# 09-March-2006 |
8 |
|
|
9 |
|
# Subdir structure: |
10 |
|
# top/ |
11 |
|
# Boss/... |
12 |
< |
# Crab/python |
13 |
< |
# Crab/script |
14 |
< |
|
12 |
> |
# python/... |
13 |
> |
# script/... |
14 |
> |
# DBSAPI |
15 |
> |
# DLSAPI |
16 |
> |
# PsetCode |
17 |
> |
# |
18 |
|
TopDir=`\pwd` |
19 |
|
|
20 |
|
############################################# |
21 |
|
######## BOSS CONFIGURATION ################# |
22 |
|
############################################# |
23 |
< |
BOSSVER=3_6_1 |
23 |
> |
BOSSVER=4_3_6-sl3-sl4 |
24 |
|
BACKEND=SQLite |
25 |
|
|
26 |
|
function configureBoss { |
27 |
|
## unpack and configure Boss |
28 |
|
cd Boss |
29 |
|
echo "unpacking BOSS distribution ${BOSSVER}" |
30 |
< |
tar xzf boss-v${BOSSVER}-bin.tar.gz |
31 |
< |
cd boss-v${BOSSVER} |
30 |
> |
tar xzf BOSS_${BOSSVER}-bin.tar.gz |
31 |
> |
cd BOSS_${BOSSVER} |
32 |
|
|
33 |
|
echo "Creating Env. files" |
34 |
< |
./CONFIGURE |
34 |
> |
source install.sh |
35 |
|
echo "Creating ./BossConfig.clad" |
36 |
|
cat > ./BossConfig.clad <<EOF |
37 |
|
# This is the BOSS configuration file |
68 |
|
cat > crab.sh <<EOF |
69 |
|
#! /bin/sh |
70 |
|
# CRAB related Stuff |
71 |
< |
export CRABDIR=$TopDir/Crab |
72 |
< |
export CRABSCRIPT=\${CRABDIR} |
71 |
> |
export CRABDIR=$TopDir |
72 |
> |
export CRABSCRIPT=\${CRABDIR}/script |
73 |
|
|
74 |
|
CRABPATH=\${CRABDIR}/python |
75 |
< |
CRABPYTHON=\${CRABDIR}/python |
75 |
> |
CRABDLSAPIPATH=\${CRABDIR}/DLSAPI |
76 |
> |
export CRABPYTHON=\${CRABDIR}/python |
77 |
> |
export CRABDBSAPIPYTHON=\${CRABDIR}/DBSAPI |
78 |
> |
export CRABDLSAPIPYTHON=\${CRABDIR}/DLSAPI |
79 |
> |
export CRABPSETPYTHON=\${CRABDIR}/PsetCode |
80 |
> |
export CRABPRODAGENTPYTHON=\${CRABDIR}/ProdAgentApi |
81 |
> |
export CRABPRODCOMMONPYTHON=\${CRABDIR}/ProdCommon |
82 |
|
|
83 |
|
if [ -z "\$PATH" ]; then |
84 |
|
export PATH=\${CRABPATH} |
86 |
|
export PATH=\${CRABPATH}:\${PATH} |
87 |
|
fi |
88 |
|
if [ -z "\$PYTHONPATH" ]; then |
89 |
< |
export PYTHONPATH=\${CRABPYTHON} |
89 |
> |
export PYTHONPATH=\${CRABPYTHON}:\${CRABDBSAPIPYTHON}:\${CRABDLSAPIPYTHON}:\${CRABPSETPYTHON}:\${CRABPRODAGENTPYTHON}:\${CRABPRODCOMMONPYTHON} |
90 |
|
else |
91 |
< |
export PYTHONPATH=\${CRABPYTHON}:\${PYTHONPATH} |
91 |
> |
export PYTHONPATH=\${PYTHONPATH}:\${CRABPYTHON}:\${CRABDBSAPIPYTHON}:\${CRABDLSAPIPYTHON}:\${CRABPSETPYTHON}:\${CRABPRODAGENTPYTHON}:\${CRABPRODCOMMONPYTHON} |
92 |
|
fi |
93 |
|
|
94 |
|
# BOSS related Stuff |
95 |
< |
source $BOSSDIR/bossenv.sh |
95 |
> |
source $TopDir/Boss/BOSS_$BOSSVER/bossenv.sh |
96 |
|
|
97 |
|
# check whether central boss db is configured |
98 |
|
|
99 |
< |
# check if *clad files exist |
100 |
< |
if [ ! -e ~/BossConfig.clad ]; then |
101 |
< |
echo "User-boss DB not installed: run configureBoss" |
102 |
< |
fi |
94 |
< |
if [ ! -e ~/SQLiteConfig.clad ]; then |
95 |
< |
echo "User-boss DB not installed: run configureBoss" |
99 |
> |
# check if .bossrc dir exists |
100 |
> |
|
101 |
> |
if [ ! -d ~/.bossrc ]; then |
102 |
> |
mkdir ~/.bossrc |
103 |
|
fi |
104 |
< |
if [ ! -e ~/MySQLRTConfig.clad ]; then |
105 |
< |
echo "User-boss DB not installed: run configureBoss" |
104 |
> |
|
105 |
> |
# check if *clad files exist |
106 |
> |
|
107 |
> |
if [ ! -e ~/.bossrc/BossConfig.clad ]; then |
108 |
> |
if [ -e ~/BossConfig.clad ]; then |
109 |
> |
cp ~/BossConfig.clad ~/.bossrc/BossConfig.clad |
110 |
> |
else |
111 |
> |
echo "User-boss DB not installed: run $\CRABDIR/configureBoss" |
112 |
> |
return 1 |
113 |
> |
fi |
114 |
> |
fi |
115 |
> |
if [ ! -e ~/.bossrc/SQLiteConfig.clad ]; then |
116 |
> |
if [ -e ~/SQLiteConfig.clad ]; then |
117 |
> |
cp ~/SQLiteConfig.clad ~/.bossrc/SQLiteConfig.clad |
118 |
> |
else |
119 |
> |
echo "User-boss DB not installed: run $\CRABDIR/configureBoss" |
120 |
> |
return 1 |
121 |
> |
fi |
122 |
> |
fi |
123 |
> |
if [ ! -e ~/.bossrc/MySQLRTConfig.clad ]; then |
124 |
> |
if [ -e ~/MySQLRTConfig.clad ]; then |
125 |
> |
cp ~/MySQLRTConfig.clad ~/.bossrc/MySQLRTConfig.clad |
126 |
> |
else |
127 |
> |
echo "User-boss DB not installed: run $\CRABDIR/configureBoss" |
128 |
> |
return 1 |
129 |
> |
fi |
130 |
|
fi |
131 |
|
# now check a boss command to see if boss DB is up and running |
132 |
< |
|
133 |
< |
ok=\`boss clientID 2>&1 | grep -c "not correctly configured"\` |
134 |
< |
if [ \$ok -ne 0 ]; then |
104 |
< |
echo "User-boss DB not installed: run configureBoss" |
132 |
> |
if [ \`boss clientID 1>/dev/null | grep -c "not correctly configured"\` -ne 0 ]; then |
133 |
> |
echo "User-boss DB not installed: run $\CRABDIR/configureBoss" |
134 |
> |
return 1 |
135 |
|
fi |
136 |
|
EOF |
137 |
|
|
139 |
|
cat > crab.csh <<EOF |
140 |
|
#! /bin/csh |
141 |
|
# CRAB related Stuff |
142 |
< |
setenv CRABDIR $TopDir/Crab |
143 |
< |
setenv CRABSCRIPT \${CRABDIR} |
142 |
> |
setenv CRABDIR $TopDir |
143 |
> |
setenv CRABSCRIPT \${CRABDIR}/script |
144 |
|
|
145 |
|
set CRABPATH=\${CRABDIR}/python |
146 |
< |
set CRABPYTHON=\${CRABDIR}/python |
146 |
> |
set CRABDLSAPIPATH=\${CRABDIR}/DLSAPI |
147 |
> |
setenv CRABPYTHON \${CRABDIR}/python |
148 |
> |
setenv CRABDBSAPIPYTHON \${CRABDIR}/DBSAPI |
149 |
> |
setenv CRABDLSAPIPYTHON \${CRABDIR}/DLSAPI |
150 |
> |
setenv CRABPSETPYTHON \${CRABDIR}/PsetCode |
151 |
> |
setenv CRABPRODAGENTPYTHON \${CRABDIR}/ProdAgentApi |
152 |
> |
setenv CRABPRODCOMMONPYTHON \${CRABDIR}/ProdCommon |
153 |
|
|
154 |
|
if ( ! \$?path ) then |
155 |
< |
set path=\${CRABPATH} |
155 |
> |
set path=(\${CRABPATH}) |
156 |
|
else |
157 |
< |
set path=( \${CRABPATH} \${path} ) |
157 |
> |
set path=( \${CRABPATH} \${path}) |
158 |
|
endif |
159 |
|
if ( ! \$?PYTHONPATH ) then |
160 |
< |
setenv PYTHONPATH \${CRABPYTHON} |
160 |
> |
setenv PYTHONPATH \${CRABPYTHON}:\${CRABDBSAPIPYTHON}:\${CRABDLSAPIPYTHON}:\${CRABPSETPYTHON}:\${CRABPRODAGENTPYTHON}:\${CRABPRODCOMMONPYTHON} |
161 |
|
else |
162 |
< |
setenv PYTHONPATH \${CRABPYTHON}:\${PYTHONPATH} |
162 |
> |
setenv PYTHONPATH \${PYTHONPATH}:\${CRABPYTHON}:\${CRABDBSAPIPYTHON}:\${CRABDLSAPIPYTHON}:\${CRABPSETPYTHON}:\${CRABPRODAGENTPYTHON}:\${CRABPRODCOMMONPYTHON} |
163 |
|
endif |
164 |
|
|
165 |
|
# BOSS related Stuff |
166 |
< |
source $BOSSDIR/bossenv.csh |
166 |
> |
source $TopDir/Boss/BOSS_$BOSSVER/bossenv.csh |
167 |
|
|
168 |
|
# check whether central boss db is configured |
169 |
|
|
170 |
< |
# check if *clad files exist |
171 |
< |
if ( ! -e ~/BossConfig.clad ) then |
172 |
< |
echo "User-boss DB not installed: run configureBoss" |
173 |
< |
exit 1 |
138 |
< |
endif |
139 |
< |
if ( ! -e ~/SQLiteConfig.clad ) then |
140 |
< |
echo "User-boss DB not installed: run configureBoss" |
141 |
< |
exit 1 |
170 |
> |
# check if .bossrc dir exists |
171 |
> |
|
172 |
> |
if ( ! -d ~/.bossrc ) then |
173 |
> |
mkdir ~/.bossrc |
174 |
|
endif |
175 |
< |
if ( ! -e ~/MySQLRTConfig.clad ) then |
176 |
< |
echo "User-boss DB not installed: run configureBoss" |
177 |
< |
exit 1 |
175 |
> |
|
176 |
> |
# check if *clad files exist |
177 |
> |
if ( ! -e ~/.bossrc/BossConfig.clad ) then |
178 |
> |
if ( -e ~/BossConfig.clad ) then |
179 |
> |
cp ~/BossConfig.clad ~/.bossrc/BossConfig.clad |
180 |
> |
else |
181 |
> |
echo "User-boss DB not installed: run \$CRABDIR/configureBoss" |
182 |
> |
exit 1 |
183 |
> |
endif |
184 |
> |
endif |
185 |
> |
if ( ! -e ~/.bossrc/SQLiteConfig.clad ) then |
186 |
> |
if ( -e ~/SQLiteConfig.clad ) then |
187 |
> |
cp ~/SQLiteConfig.clad ~/.bossrc/SQLiteConfig.clad |
188 |
> |
else |
189 |
> |
echo "User-boss DB not installed: run \$CRABDIR/configureBoss" |
190 |
> |
exit 1 |
191 |
> |
endif |
192 |
> |
endif |
193 |
> |
if ( ! -e ~/.bossrc/MySQLRTConfig.clad ) then |
194 |
> |
if ( -e ~/MySQLRTConfig.clad ) then |
195 |
> |
cp ~/MySQLRTConfig.clad ~/.bossrc/MySQLRTConfig.clad |
196 |
> |
else |
197 |
> |
echo "User-boss DB not installed: run \$CRABDIR/configureBoss" |
198 |
> |
exit 1 |
199 |
> |
endif |
200 |
|
endif |
201 |
|
# now check a boss command to see if boss DB is up and running |
202 |
|
if ( \`boss clientID |& grep -c "not correctly configured"\` ) then |
203 |
< |
echo "User-boss DB not installed: run configureBoss" |
203 |
> |
echo "User-boss DB not installed: run \$CRABDIR/configureBoss" |
204 |
|
exit 1 |
205 |
|
endif |
206 |
|
EOF |
207 |
|
return |
208 |
|
} |
209 |
|
|
210 |
< |
#configureBoss |
210 |
> |
function configureDLSAPI { |
211 |
> |
# part for PyXML install |
212 |
> |
echo "DLSAPI Installation: begin at `date`" |
213 |
> |
cd $TopDir/DLSAPI |
214 |
> |
./InstallPyXML.sh |
215 |
> |
cd .. |
216 |
> |
echo "DLSAPI Installation: end at `date`" |
217 |
> |
return |
218 |
> |
} |
219 |
> |
|
220 |
> |
configureBoss |
221 |
|
configureCrab |
222 |
+ |
configureDLSAPI |
223 |
+ |
|