ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/configure
Revision: 1.29
Committed: Thu Feb 1 16:15:36 2007 UTC (18 years, 2 months ago) by gutsche
Branch: MAIN
Changes since 1.28: +2 -0 lines
Log Message:
Moved DBS-1 APIs to DBS1API namespace. This requires preparation of special DBS checkouts:

- checkout DBSAPIs
    - create directory DBSAPI in $CRABDIR
    - check out COMP/DBS/Clients/PythonAPI into DBSAPI/DBS1API
    - check out COMP/DBS/Clients/Python into DBSAPI/DBS2API
    - create namespace __init__.py in both subdirectories DBS1API and DBS2API
- change configure to add $CRABDIR/DBSAPI to PYTHONPATH and to set
  DBS_CLIENT_CONFIG

implemented changes to PYTHONPATH.

File Contents

# User Rev Content
1 slacapra 1.1 #! /bin/sh
2     #
3     # Stefano Lacaprara <lacaprara@pd.infn.it> INFN Padova
4     #
5 fanzago 1.6 # Installation script for Crab
6 slacapra 1.1 #
7 fanzago 1.9 # 09-March-2006
8 slacapra 1.1
9 fanzago 1.6 # Subdir structure:
10     # top/
11     # Boss/...
12 fanzago 1.9 # python/...
13     # script/...
14 slacapra 1.12 # DBSAPI
15     # DLSAPI
16 afanfani 1.13 # PsetCode
17 slacapra 1.12 #
18 fanzago 1.6 TopDir=`\pwd`
19    
20     #############################################
21     ######## BOSS CONFIGURATION #################
22     #############################################
23 slacapra 1.28 BOSSVER=4_3_1
24 fanzago 1.6 BACKEND=SQLite
25    
26     function configureBoss {
27     ## unpack and configure Boss
28     cd Boss
29     echo "unpacking BOSS distribution ${BOSSVER}"
30 slacapra 1.19 tar xzf BOSS_${BOSSVER}-bin.tar.gz
31 slacapra 1.21 cd BOSS_${BOSSVER}
32 fanzago 1.6
33     echo "Creating Env. files"
34 slacapra 1.18 source install.sh
35 afanfani 1.13 echo "Creating ./BossConfig.clad"
36 fanzago 1.6 cat > ./BossConfig.clad <<EOF
37     # This is the BOSS configuration file
38    
39     [
40     # BOSS temporary directory (where files are extracted from DB)
41     BOSS_TMP_DIR = "/tmp";
42    
43     # BOSS update interval
44     BOSS_MIN_UPD_INT = 30; # at most one upd. every BOSS_MIN_UPD_INT sec.
45     BOSS_MAX_UPD_INT = 180; # at least one upd. every BOSS_MAX_UPD_INT sec.
46    
47     # Maximum retries after post-process finishes before killing RTUpdator
48     # (waits BOSS_UPD_INTERVAL*BOSS_MAX_RETRY seconds)
49     BOSS_MAX_RETRY = 3;
50 slacapra 1.1
51 fanzago 1.6 # Boss Database Backend
52     DB_BACKEND = "${BACKEND}";
53    
54     # Info sent also to Monalisa (if empty not enabled)
55     ML_URL = "";
56     ]
57     EOF
58    
59     echo "Setting environment"
60     . bossenv.sh
61     }
62    
63     function configureCrab {
64     ## prapare the crab env
65     cd $TopDir
66 slacapra 1.1
67 fanzago 1.6 # sh style
68 slacapra 1.1 cat > crab.sh <<EOF
69     #! /bin/sh
70     # CRAB related Stuff
71 fanzago 1.9 export CRABDIR=$TopDir
72 slacapra 1.18 export CRABSCRIPT=\${CRABDIR}/script
73 slacapra 1.1
74 fanzago 1.6 CRABPATH=\${CRABDIR}/python
75 slacapra 1.18 CRABDLSAPIPATH=\${CRABDIR}/DLSAPI
76 gutsche 1.14 export CRABPYTHON=\${CRABDIR}/python
77 slacapra 1.18 export CRABDBSAPIPYTHON=\${CRABDIR}/DBSAPI
78 gutsche 1.29 export DBS_CLIENT_CONFIG=\${CRABDBSAPIPYTHON}/DBS2API/dbs.config
79 slacapra 1.18 export CRABDLSAPIPYTHON=\${CRABDIR}/DLSAPI
80     export CRABPSETPYTHON=\${CRABDIR}/PsetCode
81 slacapra 1.1
82     if [ -z "\$PATH" ]; then
83 slacapra 1.23 export PATH=\${CRABPATH}
84 slacapra 1.1 else
85 slacapra 1.23 export PATH=\${CRABPATH}:\${PATH}
86 slacapra 1.1 fi
87     if [ -z "\$PYTHONPATH" ]; then
88 gutsche 1.14 export PYTHONPATH=\${CRABPYTHON}:\${CRABDBSAPIPYTHON}:\${CRABDLSAPIPYTHON}:\${CRABPSETPYTHON}
89 slacapra 1.1 else
90 corvo 1.25 export PYTHONPATH=\${PYTHONPATH}:\${CRABPYTHON}:\${CRABDBSAPIPYTHON}:\${CRABDLSAPIPYTHON}:\${CRABPSETPYTHON}
91 fanzago 1.6 fi
92    
93     # BOSS related Stuff
94 slacapra 1.18 source $BOSS_ROOT/bossenv.sh
95 fanzago 1.6
96     # check whether central boss db is configured
97    
98 fanzago 1.10 # check if .bossrc dir exists
99    
100     if [ ! -d ~/.bossrc ]; then
101     mkdir ~/.bossrc
102 slacapra 1.12 fi
103 fanzago 1.10
104 fanzago 1.6 # check if *clad files exist
105 spiga 1.8
106     if [ ! -e ~/.bossrc/BossConfig.clad ]; then
107     if [ -e ~/BossConfig.clad ]; then
108 afanfani 1.13 cp ~/BossConfig.clad ~/.bossrc/BossConfig.clad
109 spiga 1.8 else
110 slacapra 1.23 echo "User-boss DB not installed: run $\CRABDIR/configureBoss"
111 gutsche 1.14 return 1
112 spiga 1.8 fi
113     fi
114     if [ ! -e ~/.bossrc/SQLiteConfig.clad ]; then
115     if [ -e ~/SQLiteConfig.clad ]; then
116     cp ~/SQLiteConfig.clad ~/.bossrc/SQLiteConfig.clad
117     else
118 slacapra 1.23 echo "User-boss DB not installed: run $\CRABDIR/configureBoss"
119 gutsche 1.14 return 1
120 spiga 1.8 fi
121     fi
122     if [ ! -e ~/.bossrc/MySQLRTConfig.clad ]; then
123     if [ -e ~/MySQLRTConfig.clad ]; then
124     cp ~/MySQLRTConfig.clad ~/.bossrc/MySQLRTConfig.clad
125     else
126 slacapra 1.23 echo "User-boss DB not installed: run $\CRABDIR/configureBoss"
127 gutsche 1.14 return 1
128 spiga 1.8 fi
129 fanzago 1.6 fi
130     # now check a boss command to see if boss DB is up and running
131 spiga 1.8 if [ \`boss clientID 1>/dev/null | grep -c "not correctly configured"\` -ne 0 ]; then
132 slacapra 1.23 echo "User-boss DB not installed: run $\CRABDIR/configureBoss"
133 gutsche 1.14 return 1
134 slacapra 1.1 fi
135     EOF
136    
137     # csh style
138     cat > crab.csh <<EOF
139     #! /bin/csh
140     # CRAB related Stuff
141 fanzago 1.9 setenv CRABDIR $TopDir
142 slacapra 1.18 setenv CRABSCRIPT \${CRABDIR}/script
143 slacapra 1.1
144 fanzago 1.6 set CRABPATH=\${CRABDIR}/python
145 slacapra 1.18 set CRABDLSAPIPATH=\${CRABDIR}/DLSAPI
146 gutsche 1.14 setenv CRABPYTHON \${CRABDIR}/python
147 slacapra 1.18 setenv CRABDBSAPIPYTHON \${CRABDIR}/DBSAPI
148 gutsche 1.29 setenv DBS_CLIENT_CONFIG \${CRABDBSAPIPYTHON}/DBS2API/dbs.config
149 slacapra 1.18 setenv CRABDLSAPIPYTHON \${CRABDIR}/DLSAPI
150     setenv CRABPSETPYTHON \${CRABDIR}/PsetCode
151 slacapra 1.1
152     if ( ! \$?path ) then
153 slacapra 1.23 set path=(\${CRABPATH})
154 slacapra 1.1 else
155 slacapra 1.23 set path=( \${CRABPATH} \${path})
156 slacapra 1.1 endif
157     if ( ! \$?PYTHONPATH ) then
158 gutsche 1.14 setenv PYTHONPATH \${CRABPYTHON}:\${CRABDBSAPIPYTHON}:\${CRABDLSAPIPYTHON}:\${CRABPSETPYTHON}
159 slacapra 1.1 else
160 corvo 1.25 setenv PYTHONPATH \${PYTHONPATH}:\${CRABPYTHON}:\${CRABDBSAPIPYTHON}:\${CRABDLSAPIPYTHON}:\${CRABPSETPYTHON}
161 slacapra 1.1 endif
162 slacapra 1.5
163 fanzago 1.6 # BOSS related Stuff
164 slacapra 1.18 source $BOSS_ROOT/bossenv.csh
165 slacapra 1.5
166 fanzago 1.6 # check whether central boss db is configured
167 slacapra 1.5
168 fanzago 1.10 # check if .bossrc dir exists
169    
170     if ( ! -d ~/.bossrc ) then
171     mkdir ~/.bossrc
172 slacapra 1.12 endif
173 fanzago 1.10
174 fanzago 1.6 # check if *clad files exist
175 spiga 1.8 if ( ! -e ~/.bossrc/BossConfig.clad ) then
176     if ( -e ~/BossConfig.clad ) then
177 afanfani 1.13 cp ~/BossConfig.clad ~/.bossrc/BossConfig.clad
178 spiga 1.8 else
179 slacapra 1.23 echo "User-boss DB not installed: run \$CRABDIR/configureBoss"
180 spiga 1.8 exit 1
181     endif
182     endif
183     if ( ! -e ~/.bossrc/SQLiteConfig.clad ) then
184     if ( -e ~/SQLiteConfig.clad ) then
185     cp ~/SQLiteConfig.clad ~/.bossrc/SQLiteConfig.clad
186     else
187 slacapra 1.23 echo "User-boss DB not installed: run \$CRABDIR/configureBoss"
188 spiga 1.8 exit 1
189     endif
190     endif
191     if ( ! -e ~/.bossrc/MySQLRTConfig.clad ) then
192     if ( -e ~/MySQLRTConfig.clad ) then
193     cp ~/MySQLRTConfig.clad ~/.bossrc/MySQLRTConfig.clad
194     else
195 slacapra 1.23 echo "User-boss DB not installed: run \$CRABDIR/configureBoss"
196 spiga 1.8 exit 1
197     endif
198 fanzago 1.6 endif
199     # now check a boss command to see if boss DB is up and running
200     if ( \`boss clientID |& grep -c "not correctly configured"\` ) then
201 slacapra 1.23 echo "User-boss DB not installed: run \$CRABDIR/configureBoss"
202 fanzago 1.6 exit 1
203     endif
204     EOF
205     return
206     }
207 slacapra 1.5
208 afanfani 1.13 function configureDLSAPI {
209 afanfani 1.15 # part for PyXML install
210     echo "DLSAPI Installation: begin at `date`"
211     cd $TopDir/DLSAPI
212     ./InstallPyXML.sh
213     cd ..
214     echo "DLSAPI Installation: end at `date`"
215 afanfani 1.13 return
216     }
217    
218 spiga 1.8 configureBoss
219 fanzago 1.6 configureCrab
220 afanfani 1.16 configureDLSAPI
221 afanfani 1.13