3 |
|
from crab_exceptions import * |
4 |
|
from crab_util import * |
5 |
|
from EdgConfig import * |
6 |
+ |
from BlackWhiteListParser import BlackWhiteListParser |
7 |
|
import common |
8 |
|
|
9 |
|
import os, sys, time |
23 |
|
|
24 |
|
def configure(self, cfg_params): |
25 |
|
|
26 |
+ |
# init BlackWhiteListParser |
27 |
+ |
self.blackWhiteListParser = BlackWhiteListParser(cfg_params) |
28 |
+ |
|
29 |
+ |
self.proxyValid=0 |
30 |
+ |
try: self.dontCheckProxy=int(cfg_params["EDG.dont_check_proxy"]) |
31 |
+ |
except KeyError: self.dontCheckProxy = 0 |
32 |
+ |
|
33 |
+ |
try: |
34 |
+ |
RB=cfg_params["EDG.rb"] |
35 |
+ |
self.rb_param_file=self.rb_configure(RB) |
36 |
+ |
except KeyError: |
37 |
+ |
self.rb_param_file='' |
38 |
+ |
pass |
39 |
|
try: |
40 |
< |
RB = cfg_params["EDG.rb"] |
27 |
< |
edgConfig = EdgConfig(RB) |
28 |
< |
self.edg_config = edgConfig.config() |
29 |
< |
self.edg_config_vo = edgConfig.configVO() |
40 |
> |
self.proxyServer = cfg_params["EDG.proxy_server"] |
41 |
|
except KeyError: |
42 |
< |
self.edg_config = '' |
43 |
< |
self.edg_config_vo = '' |
42 |
> |
self.proxyServer = 'myproxy.cern.ch' |
43 |
> |
common.logger.debug(5,'Setting myproxy server to '+self.proxyServer) |
44 |
|
|
45 |
+ |
try: |
46 |
+ |
self.group = cfg_params["EDG.group"] |
47 |
+ |
except KeyError: |
48 |
+ |
self.group = None |
49 |
+ |
|
50 |
+ |
try: |
51 |
+ |
self.role = cfg_params["EDG.role"] |
52 |
+ |
except KeyError: |
53 |
+ |
self.role = None |
54 |
+ |
|
55 |
|
try: self.LCG_version = cfg_params["EDG.lcg_version"] |
56 |
|
except KeyError: self.LCG_version = '2' |
57 |
|
|
58 |
< |
try: self.EDG_requirements = cfg_params['EDG.requirements'] |
59 |
< |
except KeyError: self.EDG_requirements = '' |
58 |
> |
try: |
59 |
> |
self.EDG_ce_black_list = cfg_params['EDG.ce_black_list'] |
60 |
> |
except KeyError: |
61 |
> |
self.EDG_ce_black_list = '' |
62 |
|
|
63 |
< |
try: self.EDG_retry_count = cfg_params['EDG.retry_count'] |
64 |
< |
except KeyError: self.EDG_retry_count = '' |
63 |
> |
try: |
64 |
> |
self.EDG_ce_white_list = cfg_params['EDG.ce_white_list'] |
65 |
> |
except KeyError: self.EDG_ce_white_list = '' |
66 |
|
|
67 |
|
try: self.VO = cfg_params['EDG.virtual_organization'] |
68 |
|
except KeyError: self.VO = 'cms' |
69 |
|
|
70 |
< |
try: |
47 |
< |
self.copy_input_data = common.analisys_common_info['copy_input_data'] |
48 |
< |
#print "self.copy_input_data = ", self.copy_input_data |
70 |
> |
try: self.copy_input_data = cfg_params["USER.copy_input_data"] |
71 |
|
except KeyError: self.copy_input_data = 0 |
72 |
|
|
73 |
|
try: self.return_data = cfg_params['USER.return_data'] |
74 |
< |
except KeyError: self.return_data = 1 |
74 |
> |
except KeyError: self.return_data = 0 |
75 |
|
|
76 |
|
try: |
77 |
|
self.copy_data = cfg_params["USER.copy_data"] |
91 |
|
msg = msg + 'Please modify return_data and copy_data value in your crab.cfg file\n' |
92 |
|
raise CrabException(msg) |
93 |
|
|
94 |
+ |
########### FEDE FOR DBS2 ############################## |
95 |
+ |
try: |
96 |
+ |
self.publish_data = cfg_params["USER.publish_data"] |
97 |
+ |
self.checkProxy() |
98 |
+ |
if int(self.publish_data) == 1: |
99 |
+ |
try: |
100 |
+ |
self.publish_data_name = cfg_params['USER.publish_data_name'] |
101 |
+ |
except KeyError: |
102 |
+ |
msg = "Error. The [USER] section does not have 'publish_data_name'" |
103 |
+ |
raise CrabException(msg) |
104 |
+ |
try: |
105 |
+ |
tmp = runCommand("voms-proxy-info -identity") |
106 |
+ |
tmp = string.split(tmp,'/') |
107 |
+ |
reCN=re.compile(r'CN=') |
108 |
+ |
for t in tmp: |
109 |
+ |
if reCN.match(t): |
110 |
+ |
self.UserGridName=string.strip((t.replace('CN=','')).replace(' ','')) |
111 |
+ |
|
112 |
+ |
#self.UserGridName = string.strip(runCommand("voms-proxy-info -identity | awk -F\'CN\' \'{print $2$3$4}\' | tr -d \'=/ \'")) |
113 |
+ |
except: |
114 |
+ |
msg = "Error. Problem with voms-proxy-info -identity command" |
115 |
+ |
raise CrabException(msg) |
116 |
+ |
except KeyError: self.publish_data = 0 |
117 |
+ |
|
118 |
+ |
if ( int(self.copy_data) == 0 and int(self.publish_data) == 1 ): |
119 |
+ |
msg = 'Warning: publish_data = 1 must be used with copy_data = 1\n' |
120 |
+ |
msg = msg + 'Please modify copy_data value in your crab.cfg file\n' |
121 |
+ |
common.logger.message(msg) |
122 |
+ |
raise CrabException(msg) |
123 |
+ |
################################################# |
124 |
+ |
|
125 |
|
try: |
126 |
|
self.lfc_host = cfg_params['EDG.lfc_host'] |
127 |
|
except KeyError: |
164 |
|
|
165 |
|
try: self.EDG_requirements = cfg_params['EDG.requirements'] |
166 |
|
except KeyError: self.EDG_requirements = '' |
167 |
< |
|
167 |
> |
|
168 |
> |
try: self.EDG_addJdlParam = string.split(cfg_params['EDG.additional_jdl_parameters'],',') |
169 |
> |
except KeyError: self.EDG_addJdlParam = [] |
170 |
> |
|
171 |
|
try: self.EDG_retry_count = cfg_params['EDG.retry_count'] |
172 |
|
except KeyError: self.EDG_retry_count = '' |
173 |
< |
|
173 |
> |
|
174 |
> |
try: self.EDG_shallow_retry_count= cfg_params['EDG.shallow_retry_count'] |
175 |
> |
except KeyError: self.EDG_shallow_retry_count = '' |
176 |
> |
|
177 |
|
try: self.EDG_clock_time = cfg_params['EDG.max_wall_clock_time'] |
178 |
|
except KeyError: self.EDG_clock_time= '' |
179 |
< |
|
179 |
> |
|
180 |
|
try: self.EDG_cpu_time = cfg_params['EDG.max_cpu_time'] |
181 |
|
except KeyError: self.EDG_cpu_time = '' |
182 |
|
|
193 |
|
libPath=os.path.join(path, "lib", "python") |
194 |
|
sys.path.append(libPath) |
195 |
|
|
196 |
< |
self.proxyValid=0 |
196 |
> |
try: |
197 |
> |
self._taskId = cfg_params['taskId'] |
198 |
> |
except: |
199 |
> |
self._taskId = '' |
200 |
> |
|
201 |
> |
try: self.jobtypeName = cfg_params['CRAB.jobtype'] |
202 |
> |
except KeyError: self.jobtypeName = '' |
203 |
> |
|
204 |
> |
try: self.schedulerName = cfg_params['CRAB.scheduler'] |
205 |
> |
except KeyError: self.scheduler = '' |
206 |
> |
|
207 |
|
return |
208 |
|
|
209 |
|
|
210 |
+ |
def rb_configure(self, RB): |
211 |
+ |
self.edg_config = '' |
212 |
+ |
self.edg_config_vo = '' |
213 |
+ |
self.rb_param_file = '' |
214 |
+ |
|
215 |
+ |
edgConfig = EdgConfig(RB) |
216 |
+ |
self.edg_config = edgConfig.config() |
217 |
+ |
self.edg_config_vo = edgConfig.configVO() |
218 |
+ |
|
219 |
+ |
if (self.edg_config and self.edg_config_vo != ''): |
220 |
+ |
self.rb_param_file = 'RBconfig = "'+self.edg_config+'";\nRBconfigVO = "'+self.edg_config_vo+'";\n' |
221 |
+ |
#print "rb_param_file = ", self.rb_param_file |
222 |
+ |
return self.rb_param_file |
223 |
+ |
|
224 |
+ |
|
225 |
|
def sched_parameter(self): |
226 |
|
""" |
227 |
< |
Returns file with scheduler-specific parameters |
227 |
> |
Returns file with requirements and scheduler-specific parameters |
228 |
|
""" |
229 |
< |
|
230 |
< |
if (self.edg_config and self.edg_config_vo != ''): |
231 |
< |
self.param='sched_param.clad' |
229 |
> |
index = int(common.jobDB.nJobs()) - 1 |
230 |
> |
job = common.job_list[index] |
231 |
> |
jbt = job.type() |
232 |
> |
|
233 |
> |
lastBlock=-1 |
234 |
> |
first = [] |
235 |
> |
for n in range(common.jobDB.nJobs()): |
236 |
> |
currBlock=common.jobDB.block(n) |
237 |
> |
if (currBlock!=lastBlock): |
238 |
> |
lastBlock = currBlock |
239 |
> |
first.append(n) |
240 |
> |
|
241 |
> |
req = '' |
242 |
> |
req = req + jbt.getRequirements() |
243 |
> |
|
244 |
> |
if self.EDG_requirements: |
245 |
> |
if (req == ' '): |
246 |
> |
req = req + self.EDG_requirements |
247 |
> |
else: |
248 |
> |
req = req + ' && ' + self.EDG_requirements |
249 |
> |
|
250 |
> |
if self.EDG_ce_white_list: |
251 |
> |
ce_white_list = string.split(self.EDG_ce_white_list,',') |
252 |
> |
for i in range(len(ce_white_list)): |
253 |
> |
if i == 0: |
254 |
> |
if (req == ' '): |
255 |
> |
req = req + '((RegExp("' + string.strip(ce_white_list[i]) + '", other.GlueCEUniqueId))' |
256 |
> |
else: |
257 |
> |
req = req + ' && ((RegExp("' + string.strip(ce_white_list[i]) + '", other.GlueCEUniqueId))' |
258 |
> |
pass |
259 |
> |
else: |
260 |
> |
req = req + ' || (RegExp("' + string.strip(ce_white_list[i]) + '", other.GlueCEUniqueId))' |
261 |
> |
req = req + ')' |
262 |
> |
|
263 |
> |
if self.EDG_ce_black_list: |
264 |
> |
ce_black_list = string.split(self.EDG_ce_black_list,',') |
265 |
> |
for ce in ce_black_list: |
266 |
> |
if (req == ' '): |
267 |
> |
req = req + '(!RegExp("' + string.strip(ce) + '", other.GlueCEUniqueId))' |
268 |
> |
else: |
269 |
> |
req = req + ' && (!RegExp("' + string.strip(ce) + '", other.GlueCEUniqueId))' |
270 |
> |
pass |
271 |
> |
if self.EDG_clock_time: |
272 |
> |
if (req == ' '): |
273 |
> |
req = req + 'other.GlueCEPolicyMaxWallClockTime>='+self.EDG_clock_time |
274 |
> |
else: |
275 |
> |
req = req + ' && other.GlueCEPolicyMaxWallClockTime>='+self.EDG_clock_time |
276 |
> |
|
277 |
> |
if self.EDG_cpu_time: |
278 |
> |
if (req == ' '): |
279 |
> |
req = req + ' other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time |
280 |
> |
else: |
281 |
> |
req = req + ' && other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time |
282 |
> |
|
283 |
> |
for i in range(len(first)): # Add loop DS |
284 |
> |
groupReq = req |
285 |
> |
self.param='sched_param_'+str(i)+'.clad' |
286 |
|
param_file = open(common.work_space.shareDir()+'/'+self.param, 'w') |
287 |
< |
param_file.write('RBconfig = "'+self.edg_config+'";\n') |
288 |
< |
param_file.write('RBconfigVO = "'+self.edg_config_vo+'";') |
287 |
> |
|
288 |
> |
itr4=self.findSites_(first[i]) |
289 |
> |
for arg in itr4: |
290 |
> |
groupReq = groupReq + ' && anyMatch(other.storage.CloseSEs, ('+str(arg)+'))' |
291 |
> |
param_file.write('Requirements = '+groupReq +';\n') |
292 |
> |
|
293 |
> |
if (self.rb_param_file != ''): |
294 |
> |
param_file.write(self.rb_param_file) |
295 |
> |
|
296 |
> |
if len(self.EDG_addJdlParam): |
297 |
> |
for p in self.EDG_addJdlParam: |
298 |
> |
param_file.write(p) |
299 |
> |
|
300 |
|
param_file.close() |
301 |
< |
return 1 |
153 |
< |
else: |
154 |
< |
return 0 |
301 |
> |
|
302 |
|
|
303 |
|
def wsSetupEnvironment(self): |
304 |
|
""" |
305 |
|
Returns part of a job script which does scheduler-specific work. |
306 |
|
""" |
160 |
– |
|
307 |
|
txt = '' |
308 |
< |
if int(self.copy_data) == 1: |
309 |
< |
if self.SE: |
310 |
< |
txt += 'export SE='+self.SE+'\n' |
311 |
< |
txt += 'echo "SE = $SE"\n' |
312 |
< |
if self.SE_PATH: |
313 |
< |
if ( self.SE_PATH[-1] != '/' ) : self.SE_PATH = self.SE_PATH + '/' |
314 |
< |
txt += 'export SE_PATH='+self.SE_PATH+'\n' |
315 |
< |
txt += 'echo "SE_PATH = $SE_PATH"\n' |
316 |
< |
|
308 |
> |
txt += '# strip arguments\n' |
309 |
> |
txt += 'echo "strip arguments"\n' |
310 |
> |
txt += 'args=("$@")\n' |
311 |
> |
txt += 'nargs=$#\n' |
312 |
> |
txt += 'shift $nargs\n' |
313 |
> |
txt += "# job number (first parameter for job wrapper)\n" |
314 |
> |
#txt += "NJob=$1\n" |
315 |
> |
txt += "NJob=${args[0]}\n" |
316 |
> |
|
317 |
> |
txt += '# job identification to DashBoard \n' |
318 |
> |
txt += 'MonitorJobID=`echo ${NJob}_$EDG_WL_JOBID`\n' |
319 |
> |
txt += 'SyncGridJobId=`echo $EDG_WL_JOBID`\n' |
320 |
> |
txt += 'MonitorID=`echo ' + self._taskId + '`\n' |
321 |
> |
txt += 'echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n' |
322 |
> |
txt += 'echo "SyncGridJobId=`echo $SyncGridJobId`" | tee -a $RUNTIME_AREA/$repo \n' |
323 |
> |
txt += 'echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n' |
324 |
> |
|
325 |
> |
txt += 'echo "middleware discovery " \n' |
326 |
> |
txt += 'if [ $GRID3_APP_DIR ]; then\n' |
327 |
> |
txt += ' middleware=OSG \n' |
328 |
> |
txt += ' echo "SyncCE=`echo $EDG_WL_LOG_DESTINATION`" | tee -a $RUNTIME_AREA/$repo \n' |
329 |
> |
txt += ' echo "GridFlavour=`echo $middleware`" | tee -a $RUNTIME_AREA/$repo \n' |
330 |
> |
txt += ' echo "middleware =$middleware" \n' |
331 |
> |
txt += 'elif [ $OSG_APP ]; then \n' |
332 |
> |
txt += ' middleware=OSG \n' |
333 |
> |
txt += ' echo "SyncCE=`echo $EDG_WL_LOG_DESTINATION`" | tee -a $RUNTIME_AREA/$repo \n' |
334 |
> |
txt += ' echo "GridFlavour=`echo $middleware`" | tee -a $RUNTIME_AREA/$repo \n' |
335 |
> |
txt += ' echo "middleware =$middleware" \n' |
336 |
> |
txt += 'elif [ $VO_CMS_SW_DIR ]; then \n' |
337 |
> |
txt += ' middleware=LCG \n' |
338 |
> |
# txt += ' echo "SyncCE=`edg-brokerinfo getCE`" | tee -a $RUNTIME_AREA/$repo \n' |
339 |
> |
txt += ' echo "SyncCE=`glite-brokerinfo getCE`" | tee -a $RUNTIME_AREA/$repo \n' |
340 |
> |
txt += ' echo "GridFlavour=`echo $middleware`" | tee -a $RUNTIME_AREA/$repo \n' |
341 |
> |
txt += ' echo "middleware =$middleware" \n' |
342 |
> |
txt += 'else \n' |
343 |
> |
txt += ' echo "SET_CMS_ENV 10030 ==> middleware not identified" \n' |
344 |
> |
txt += ' echo "JOB_EXIT_STATUS = 10030" \n' |
345 |
> |
txt += ' echo "JobExitCode=10030" | tee -a $RUNTIME_AREA/$repo \n' |
346 |
> |
txt += ' dumpStatus $RUNTIME_AREA/$repo \n' |
347 |
> |
txt += ' rm -f $RUNTIME_AREA/$repo \n' |
348 |
> |
txt += ' echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n' |
349 |
> |
txt += ' echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n' |
350 |
> |
txt += ' exit 1 \n' |
351 |
> |
txt += 'fi \n' |
352 |
> |
|
353 |
> |
txt += '# report first time to DashBoard \n' |
354 |
> |
txt += 'dumpStatus $RUNTIME_AREA/$repo \n' |
355 |
> |
txt += 'rm -f $RUNTIME_AREA/$repo \n' |
356 |
> |
txt += 'echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n' |
357 |
> |
txt += 'echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n' |
358 |
> |
|
359 |
> |
txt += '\n\n' |
360 |
> |
|
361 |
> |
# if int(self.copy_data) == 1: |
362 |
> |
# if self.SE: |
363 |
> |
# txt += 'export SE='+self.SE+'\n' |
364 |
> |
# txt += 'echo "SE = $SE"\n' |
365 |
> |
# if self.SE_PATH: |
366 |
> |
# if ( self.SE_PATH[-1] != '/' ) : self.SE_PATH = self.SE_PATH + '/' |
367 |
> |
# txt += 'export SE_PATH='+self.SE_PATH+'\n' |
368 |
> |
# txt += 'echo "SE_PATH = $SE_PATH"\n' |
369 |
> |
|
370 |
|
txt += 'export VO='+self.VO+'\n' |
371 |
< |
### FEDE: add some line for LFC catalog setting |
372 |
< |
txt += 'if [[ $LCG_CATALOG_TYPE != \''+self.lcg_catalog_type+'\' ]]; then\n' |
373 |
< |
txt += ' export LCG_CATALOG_TYPE='+self.lcg_catalog_type+'\n' |
374 |
< |
txt += 'fi\n' |
375 |
< |
txt += 'if [[ $LFC_HOST != \''+self.lfc_host+'\' ]]; then\n' |
376 |
< |
txt += 'export LFC_HOST='+self.lfc_host+'\n' |
377 |
< |
txt += 'fi\n' |
378 |
< |
txt += 'if [[ $LFC_HOME != \''+self.lfc_home+'\' ]]; then\n' |
379 |
< |
txt += 'export LFC_HOME='+self.lfc_home+'\n' |
371 |
> |
### add some line for LFC catalog setting |
372 |
> |
txt += 'if [ $middleware == LCG ]; then \n' |
373 |
> |
txt += ' if [[ $LCG_CATALOG_TYPE != \''+self.lcg_catalog_type+'\' ]]; then\n' |
374 |
> |
txt += ' export LCG_CATALOG_TYPE='+self.lcg_catalog_type+'\n' |
375 |
> |
txt += ' fi\n' |
376 |
> |
txt += ' if [[ $LFC_HOST != \''+self.lfc_host+'\' ]]; then\n' |
377 |
> |
txt += ' export LFC_HOST='+self.lfc_host+'\n' |
378 |
> |
txt += ' fi\n' |
379 |
> |
txt += ' if [[ $LFC_HOME != \''+self.lfc_home+'\' ]]; then\n' |
380 |
> |
txt += ' export LFC_HOME='+self.lfc_home+'\n' |
381 |
> |
txt += ' fi\n' |
382 |
> |
txt += 'elif [ $middleware == OSG ]; then\n' |
383 |
> |
txt += ' echo "LFC catalog setting to be implemented for OSG"\n' |
384 |
|
txt += 'fi\n' |
385 |
|
##### |
386 |
|
if int(self.register_data) == 1: |
387 |
< |
txt += 'export LFN='+self.LFN+'\n' |
388 |
< |
txt += 'lfc-ls $LFN\n' |
389 |
< |
txt += 'result=$?\n' |
390 |
< |
txt += 'echo $result\n' |
387 |
> |
txt += 'if [ $middleware == LCG ]; then \n' |
388 |
> |
txt += ' export LFN='+self.LFN+'\n' |
389 |
> |
txt += ' lfc-ls $LFN\n' |
390 |
> |
txt += ' result=$?\n' |
391 |
> |
txt += ' echo $result\n' |
392 |
|
### creation of LFN dir in LFC catalog, under /grid/cms dir |
393 |
< |
txt += 'if [ $result != 0 ]; then\n' |
394 |
< |
txt += ' lfc-mkdir $LFN\n' |
395 |
< |
txt += ' result=$?\n' |
396 |
< |
txt += ' echo $result\n' |
393 |
> |
txt += ' if [ $result != 0 ]; then\n' |
394 |
> |
txt += ' lfc-mkdir $LFN\n' |
395 |
> |
txt += ' result=$?\n' |
396 |
> |
txt += ' echo $result\n' |
397 |
> |
txt += ' fi\n' |
398 |
> |
txt += 'elif [ $middleware == OSG ]; then\n' |
399 |
> |
txt += ' echo " Files registration to be implemented for OSG"\n' |
400 |
|
txt += 'fi\n' |
401 |
|
txt += '\n' |
402 |
< |
txt += 'CloseCEs=`edg-brokerinfo getCE`\n' |
403 |
< |
txt += 'echo "CloseCEs = $CloseCEs"\n' |
404 |
< |
txt += 'CE=`echo $CloseCEs | sed -e "s/:.*//"`\n' |
405 |
< |
txt += 'echo "CE = $CE"\n' |
402 |
> |
|
403 |
> |
if self.VO: |
404 |
> |
txt += 'export VO='+self.VO+'\n' |
405 |
> |
if self.LFN: |
406 |
> |
txt += 'if [ $middleware == LCG ]; then \n' |
407 |
> |
txt += ' export LFN='+self.LFN+'\n' |
408 |
> |
txt += 'fi\n' |
409 |
> |
txt += '\n' |
410 |
> |
|
411 |
> |
txt += 'if [ $middleware == LCG ]; then\n' |
412 |
> |
# txt += ' CloseCEs=`edg-brokerinfo getCE`\n' |
413 |
> |
txt += ' CloseCEs=`glite-brokerinfo getCE`\n' |
414 |
> |
txt += ' echo "CloseCEs = $CloseCEs"\n' |
415 |
> |
txt += ' CE=`echo $CloseCEs | sed -e "s/:.*//"`\n' |
416 |
> |
txt += ' echo "CE = $CE"\n' |
417 |
> |
txt += 'elif [ $middleware == OSG ]; then \n' |
418 |
> |
txt += ' if [ $OSG_JOB_CONTACT ]; then \n' |
419 |
> |
txt += ' CE=`echo $OSG_JOB_CONTACT | /usr/bin/awk -F\/ \'{print $1}\'` \n' |
420 |
> |
txt += ' else \n' |
421 |
> |
txt += ' echo "SET_CMS_ENV 10099 ==> OSG mode: ERROR in setting CE name from OSG_JOB_CONTACT" \n' |
422 |
> |
txt += ' echo "JOB_EXIT_STATUS = 10099" \n' |
423 |
> |
txt += ' echo "JobExitCode=10099" | tee -a $RUNTIME_AREA/$repo \n' |
424 |
> |
txt += ' dumpStatus $RUNTIME_AREA/$repo \n' |
425 |
> |
txt += ' rm -f $RUNTIME_AREA/$repo \n' |
426 |
> |
txt += ' echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n' |
427 |
> |
txt += ' echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n' |
428 |
> |
txt += ' exit 1 \n' |
429 |
> |
txt += ' fi \n' |
430 |
> |
txt += 'fi \n' |
431 |
> |
|
432 |
|
return txt |
433 |
|
|
434 |
|
def wsCopyInput(self): |
436 |
|
Copy input data from SE to WN |
437 |
|
""" |
438 |
|
txt = '' |
439 |
< |
try: |
440 |
< |
self.copy_input_data = common.analisys_common_info['copy_input_data'] |
441 |
< |
#print "self.copy_input_data = ", self.copy_input_data |
442 |
< |
except KeyError: self.copy_input_data = 0 |
443 |
< |
if int(self.copy_input_data) == 1: |
444 |
< |
txt += '#\n' |
445 |
< |
txt += '# Copy Input Data from SE to this WN\n' |
446 |
< |
txt += '#\n' |
447 |
< |
### changed by georgia (put a loop copying more than one input files per jobs) |
448 |
< |
txt +='for input_file in $cur_file_list \n' |
449 |
< |
txt +='do \n' |
450 |
< |
txt +=' lcg-cp --vo $VO lfn:$input_lfn/$input_file file:`pwd`/$input_file 2>&1\n' |
451 |
< |
txt +=' copy_input_exit_status=$?\n' |
452 |
< |
txt +=' echo "COPY_INPUT_EXIT_STATUS = $copy_input_exit_status"\n' |
453 |
< |
txt +=' if [ $copy_input_exit_status -ne 0 ]; then \n' |
454 |
< |
txt +=' echo "Problems with copying to WN" \n' |
455 |
< |
txt +=' else \n' |
456 |
< |
txt +=' echo "input copied into WN" \n' |
457 |
< |
txt +=' fi \n' |
458 |
< |
txt +='done \n' |
459 |
< |
### copy a set of PU ntuples (same for each jobs -- but accessed randomly) |
460 |
< |
txt +='for file in $cur_pu_list \n' |
461 |
< |
txt +='do \n' |
462 |
< |
txt +=' lcg-cp --vo $VO lfn:$pu_lfn/$file file:`pwd`/$file 2>&1\n' |
463 |
< |
txt +=' copy_input_exit_status=$?\n' |
464 |
< |
txt +=' echo "COPY_INPUT_PU_EXIT_STATUS = $copy_input_pu_exit_status"\n' |
465 |
< |
txt +=' if [ $copy_input_pu_exit_status -ne 0 ]; then \n' |
466 |
< |
txt +=' echo "Problems with copying pu to WN" \n' |
467 |
< |
txt +=' else \n' |
468 |
< |
txt +=' echo "input pu files copied into WN" \n' |
469 |
< |
txt +=' fi \n' |
470 |
< |
txt +='done \n' |
471 |
< |
txt +='\n' |
472 |
< |
txt +='### Check SCRATCH space available on WN : \n' |
473 |
< |
txt +='df -h \n' |
439 |
> |
if not self.copy_input_data: return txt |
440 |
> |
|
441 |
> |
## OLI_Daniele deactivate for OSG (wait for LCG UI installed on OSG) |
442 |
> |
txt += 'if [ $middleware == OSG ]; then\n' |
443 |
> |
txt += ' #\n' |
444 |
> |
txt += ' # Copy Input Data from SE to this WN deactivated in OSG mode\n' |
445 |
> |
txt += ' #\n' |
446 |
> |
txt += ' echo "Copy Input Data from SE to this WN deactivated in OSG mode"\n' |
447 |
> |
txt += 'elif [ $middleware == LCG ]; then \n' |
448 |
> |
txt += ' #\n' |
449 |
> |
txt += ' # Copy Input Data from SE to this WN\n' |
450 |
> |
txt += ' #\n' |
451 |
> |
### changed by georgia (put a loop copying more than one input files per jobs) |
452 |
> |
txt += ' for input_file in $cur_file_list \n' |
453 |
> |
txt += ' do \n' |
454 |
> |
txt += ' lcg-cp --vo $VO --verbose -t 1200 lfn:$input_lfn/$input_file file:`pwd`/$input_file 2>&1\n' |
455 |
> |
txt += ' copy_input_exit_status=$?\n' |
456 |
> |
txt += ' echo "COPY_INPUT_EXIT_STATUS = $copy_input_exit_status"\n' |
457 |
> |
txt += ' if [ $copy_input_exit_status -ne 0 ]; then \n' |
458 |
> |
txt += ' echo "Problems with copying to WN" \n' |
459 |
> |
txt += ' else \n' |
460 |
> |
txt += ' echo "input copied into WN" \n' |
461 |
> |
txt += ' fi \n' |
462 |
> |
txt += ' done \n' |
463 |
> |
### copy a set of PU ntuples (same for each jobs -- but accessed randomly) |
464 |
> |
txt += ' for file in $cur_pu_list \n' |
465 |
> |
txt += ' do \n' |
466 |
> |
txt += ' lcg-cp --vo $VO --verbose -t 1200 lfn:$pu_lfn/$file file:`pwd`/$file 2>&1\n' |
467 |
> |
txt += ' copy_input_pu_exit_status=$?\n' |
468 |
> |
txt += ' echo "COPY_INPUT_PU_EXIT_STATUS = $copy_input_pu_exit_status"\n' |
469 |
> |
txt += ' if [ $copy_input_pu_exit_status -ne 0 ]; then \n' |
470 |
> |
txt += ' echo "Problems with copying pu to WN" \n' |
471 |
> |
txt += ' else \n' |
472 |
> |
txt += ' echo "input pu files copied into WN" \n' |
473 |
> |
txt += ' fi \n' |
474 |
> |
txt += ' done \n' |
475 |
> |
txt += ' \n' |
476 |
> |
txt += ' ### Check SCRATCH space available on WN : \n' |
477 |
> |
txt += ' df -h \n' |
478 |
> |
txt += 'fi \n' |
479 |
> |
|
480 |
|
return txt |
481 |
|
|
482 |
|
def wsCopyOutput(self): |
484 |
|
Write a CopyResults part of a job script, e.g. |
485 |
|
to copy produced output into a storage element. |
486 |
|
""" |
487 |
< |
txt = '' |
249 |
< |
if int(self.copy_data) == 1: |
250 |
< |
txt += '#\n' |
251 |
< |
txt += '# Copy output to SE = $SE\n' |
252 |
< |
txt += '#\n' |
253 |
< |
txt += 'if [ $exe_result -eq 0 ]; then\n' |
254 |
< |
txt += ' for out_file in $file_list ; do\n' |
255 |
< |
txt += ' echo "Trying to copy output file to $SE "\n' |
256 |
< |
txt += ' echo "lcg-cp --vo cms -t 1200 file://`pwd`/$out_file gsiftp://${SE}${SE_PATH}$out_file"\n' |
257 |
< |
# txt += ' echo "globus-url-copy file://`pwd`/$out_file gsiftp://${SE}${SE_PATH}$out_file"\n' |
258 |
< |
txt += ' exitstring=`lcg-cp --vo cms -t 1200 file://\`pwd\`/$out_file gsiftp://${SE}${SE_PATH}$out_file 2>&1`\n' |
259 |
< |
# txt += ' exitstring=`globus-url-copy file://\`pwd\`/$out_file gsiftp://${SE}${SE_PATH}$out_file 2>&1`\n' |
260 |
< |
txt += ' copy_exit_status=$?\n' |
261 |
< |
txt += ' echo "COPY_EXIT_STATUS = $copy_exit_status"\n' |
262 |
< |
txt += ' echo "STAGE_OUT = $copy_exit_status"\n' |
263 |
< |
txt += ' if [ $copy_exit_status -ne 0 ]; then\n' |
264 |
< |
txt += ' echo "Problems with SE = $SE"\n' |
265 |
< |
txt += ' echo "StageOutExitStatus = 198" | tee -a $RUNTIME_AREA/$repo\n' |
266 |
< |
txt += ' echo "StageOutExitStatusReason = $exitstring" | tee -a $RUNTIME_AREA/$repo\n' |
267 |
< |
txt += ' else\n' |
268 |
< |
txt += ' echo "StageOutSE = $SE" | tee -a $RUNTIME_AREA/$repo\n' |
269 |
< |
txt += ' echo "StageOutCatalog = " | tee -a $RUNTIME_AREA/$repo\n' |
270 |
< |
txt += ' echo "output copied into $SE/$SE_PATH directory"\n' |
271 |
< |
txt += ' echo "StageOutExitStatus = 0" | tee -a $RUNTIME_AREA/$repo\n' |
272 |
< |
txt += ' fi\n' |
273 |
< |
txt += ' done\n' |
274 |
< |
txt += 'fi\n' |
275 |
< |
return txt |
487 |
> |
txt = '\n' |
488 |
|
|
489 |
< |
def wsRegisterOutput(self): |
490 |
< |
""" |
491 |
< |
Returns part of a job script which does scheduler-specific work. |
280 |
< |
""" |
489 |
> |
txt += '#\n' |
490 |
> |
txt += '# COPY OUTPUT FILE TO SE\n' |
491 |
> |
txt += '#\n\n' |
492 |
|
|
493 |
< |
txt = '' |
494 |
< |
if int(self.register_data) == 1: |
495 |
< |
txt += '#\n' |
496 |
< |
txt += '# Register output to LFC\n' |
497 |
< |
txt += '#\n' |
498 |
< |
txt += 'if [[ $exe_result -eq 0 && $copy_exit_status -eq 0 ]]; then\n' |
499 |
< |
txt += ' for out_file in $file_list ; do\n' |
500 |
< |
txt += ' echo "Trying to register the output file into LFC"\n' |
501 |
< |
txt += ' echo "lcg-rf -l $LFN/$out_file --vo $VO sfn://$SE$SE_PATH/$out_file"\n' |
502 |
< |
txt += ' lcg-rf -l $LFN/$out_file --vo $VO sfn://$SE$SE_PATH/$out_file 2>&1 \n' |
503 |
< |
txt += ' register_exit_status=$?\n' |
504 |
< |
txt += ' echo "REGISTER_EXIT_STATUS = $register_exit_status"\n' |
505 |
< |
txt += ' echo "STAGE_OUT = $register_exit_status"\n' |
506 |
< |
txt += ' if [ $register_exit_status -ne 0 ]; then \n' |
507 |
< |
txt += ' echo "Problems with the registration to LFC" \n' |
508 |
< |
txt += ' echo "Try with srm protocol" \n' |
509 |
< |
txt += ' echo "lcg-rf -l $LFN/$out_file --vo $VO srm://$SE$SE_PATH/$out_file"\n' |
510 |
< |
txt += ' lcg-rf -l $LFN/$out_file --vo $VO srm://$SE$SE_PATH/$out_file 2>&1 \n' |
511 |
< |
txt += ' register_exit_status=$?\n' |
512 |
< |
txt += ' echo "REGISTER_EXIT_STATUS = $register_exit_status"\n' |
513 |
< |
txt += ' echo "STAGE_OUT = $register_exit_status"\n' |
514 |
< |
txt += ' if [ $register_exit_status -ne 0 ]; then \n' |
515 |
< |
txt += ' echo "Problems with the registration into LFC" \n' |
516 |
< |
txt += ' fi \n' |
517 |
< |
txt += ' else \n' |
518 |
< |
txt += ' echo "output registered to LFC"\n' |
519 |
< |
txt += ' fi \n' |
520 |
< |
txt += ' echo "StageOutExitStatus = $register_exit_status" | tee -a $RUNTIME_AREA/$repo\n' |
521 |
< |
txt += ' done\n' |
522 |
< |
txt += 'elif [[ $exe_result -eq 0 && $copy_exit_status -ne 0 ]]; then \n' |
523 |
< |
txt += ' echo "Trying to copy output file to CloseSE"\n' |
524 |
< |
txt += ' CLOSE_SE=`edg-brokerinfo getCloseSEs | head -1`\n' |
525 |
< |
txt += ' for out_file in $file_list ; do\n' |
526 |
< |
txt += ' echo "lcg-cr -v -l lfn:${LFN}/$out_file -d $CLOSE_SE -P $LFN/$out_file --vo $VO file://`pwd`/$out_file" \n' |
527 |
< |
txt += ' lcg-cr -v -l lfn:${LFN}/$out_file -d $CLOSE_SE -P $LFN/$out_file --vo $VO file://`pwd`/$out_file 2>&1 \n' |
528 |
< |
txt += ' register_exit_status=$?\n' |
529 |
< |
txt += ' echo "REGISTER_EXIT_STATUS = $register_exit_status"\n' |
530 |
< |
txt += ' echo "STAGE_OUT = $register_exit_status"\n' |
531 |
< |
txt += ' if [ $register_exit_status -ne 0 ]; then \n' |
532 |
< |
txt += ' echo "Problems with CloseSE" \n' |
533 |
< |
txt += ' else \n' |
534 |
< |
txt += ' echo "The program was successfully executed"\n' |
535 |
< |
txt += ' echo "SE = $CLOSE_SE"\n' |
536 |
< |
txt += ' echo "LFN for the file is LFN=${LFN}/$out_file"\n' |
537 |
< |
txt += ' fi \n' |
538 |
< |
txt += ' echo "StageOutExitStatus = $register_exit_status" | tee -a $RUNTIME_AREA/$repo\n' |
539 |
< |
txt += ' done\n' |
540 |
< |
txt += 'else\n' |
330 |
< |
txt += ' echo "Problem with the executable"\n' |
331 |
< |
txt += 'fi \n' |
493 |
> |
SE_PATH='' |
494 |
> |
if int(self.copy_data) == 1: |
495 |
> |
if self.SE: |
496 |
> |
txt += 'export SE='+self.SE+'\n' |
497 |
> |
txt += 'echo "SE = $SE"\n' |
498 |
> |
if self.SE_PATH: |
499 |
> |
if ( self.SE_PATH[-1] != '/' ) : self.SE_PATH = self.SE_PATH + '/' |
500 |
> |
SE_PATH=self.SE_PATH |
501 |
> |
if int(self.publish_data) == 1: |
502 |
> |
txt += '### publish_data = 1 so the SE path where to copy the output is: \n' |
503 |
> |
path_add = self.UserGridName + '/' + self.publish_data_name +'_${PSETHASH}/' |
504 |
> |
SE_PATH = SE_PATH + path_add |
505 |
> |
txt += 'export SE_PATH='+SE_PATH+'\n' |
506 |
> |
txt += 'echo "SE_PATH = $SE_PATH"\n' |
507 |
> |
|
508 |
> |
txt += 'echo "####################################################"\n' |
509 |
> |
txt += 'echo "# Copy output files from WN = `hostname` to SE = $SE"\n' |
510 |
> |
txt += 'echo "####################################################"\n' |
511 |
> |
|
512 |
> |
txt += 'for out_file in $file_list ; do\n' |
513 |
> |
txt += ' echo "Trying to copy output file to $SE using srmcp"\n' |
514 |
> |
txt += ' cmscp $out_file ${SE} ${SE_PATH} $out_file $middleware\n' |
515 |
> |
txt += ' copy_exit_status=$?\n' |
516 |
> |
txt += ' echo "COPY_EXIT_STATUS for srmcp = $copy_exit_status"\n' |
517 |
> |
txt += ' echo "STAGE_OUT = $copy_exit_status"\n' |
518 |
> |
|
519 |
> |
txt += ' if [ $copy_exit_status -ne 0 ]; then\n' |
520 |
> |
txt += ' echo "Problem copying $out_file to $SE $SE_PATH"\n' |
521 |
> |
txt += ' echo "StageOutExitStatus = $copy_exit_status " | tee -a $RUNTIME_AREA/$repo\n' |
522 |
> |
txt += ' echo "StageOutExitStatusReason = $exitstring" | tee -a $RUNTIME_AREA/$repo\n' |
523 |
> |
txt += ' copy_exit_status=60307\n' |
524 |
> |
|
525 |
> |
txt += ' else\n' |
526 |
> |
txt += ' echo "StageOutSE = $SE" | tee -a $RUNTIME_AREA/$repo\n' |
527 |
> |
txt += ' echo "StageOutCatalog = " | tee -a $RUNTIME_AREA/$repo\n' |
528 |
> |
txt += ' echo "output copied into $SE/$SE_PATH directory"\n' |
529 |
> |
txt += ' echo "StageOutExitStatus = 0" | tee -a $RUNTIME_AREA/$repo\n' |
530 |
> |
txt += ' echo "srmcp succeeded"\n' |
531 |
> |
txt += ' fi\n' |
532 |
> |
txt += 'done\n' |
533 |
> |
txt += 'if [ $copy_exit_status -ne 0 ]; then\n' |
534 |
> |
txt += ' SE=""\n' |
535 |
> |
txt += ' echo "SE = $SE"\n' |
536 |
> |
txt += ' SE_PATH=""\n' |
537 |
> |
txt += ' echo "SE_PATH = $SE_PATH"\n' |
538 |
> |
txt += 'fi\n' |
539 |
> |
txt += 'exit_status=$copy_exit_status\n' |
540 |
> |
pass |
541 |
|
return txt |
542 |
|
|
543 |
|
def loggingInfo(self, id): |
546 |
|
""" |
547 |
|
self.checkProxy() |
548 |
|
cmd = 'edg-job-get-logging-info -v 2 ' + id |
340 |
– |
#cmd_out = os.popen(cmd) |
549 |
|
cmd_out = runCommand(cmd) |
550 |
|
return cmd_out |
551 |
|
|
552 |
< |
def listMatch(self, nj): |
553 |
< |
""" |
554 |
< |
Check the compatibility of available resources |
555 |
< |
""" |
556 |
< |
self.checkProxy() |
349 |
< |
jdl = common.job_list[nj].jdlFilename() |
350 |
< |
cmd = 'edg-job-list-match ' + self.configOpt_() + jdl |
351 |
< |
cmd_out = runCommand(cmd,0,10) |
352 |
< |
if not cmd_out: |
353 |
< |
raise CrabException("ERROR: "+cmd+" failed!") |
354 |
< |
|
355 |
< |
return self.parseListMatch_(cmd_out, jdl) |
356 |
< |
|
357 |
< |
def parseListMatch_(self, out, jdl): |
358 |
< |
""" |
359 |
< |
Parse the f* output of edg-list-match and produce something sensible |
360 |
< |
""" |
361 |
< |
reComment = re.compile( r'^\**$' ) |
362 |
< |
reEmptyLine = re.compile( r'^$' ) |
363 |
< |
reVO = re.compile( r'Selected Virtual Organisation name.*' ) |
364 |
< |
reLine = re.compile( r'.*') |
365 |
< |
reCE = re.compile( r'(.*:.*)') |
366 |
< |
reCEId = re.compile( r'CEId.*') |
367 |
< |
reNO = re.compile( r'No Computing Element matching' ) |
368 |
< |
reRB = re.compile( r'Connecting to host' ) |
369 |
< |
next = 0 |
370 |
< |
CEs=[] |
371 |
< |
Match=0 |
372 |
< |
|
373 |
< |
#print out |
374 |
< |
lines = reLine.findall(out) |
375 |
< |
|
376 |
< |
i=0 |
377 |
< |
CEs=[] |
378 |
< |
for line in lines: |
379 |
< |
string.strip(line) |
380 |
< |
#print line |
381 |
< |
if reNO.match( line ): |
382 |
< |
common.logger.debug(5,line) |
383 |
< |
return 0 |
384 |
< |
pass |
385 |
< |
if reVO.match( line ): |
386 |
< |
VO =reVO.match( line ).group() |
387 |
< |
common.logger.debug(5,"VO "+VO) |
388 |
< |
pass |
389 |
< |
|
390 |
< |
if reRB.match( line ): |
391 |
< |
RB = reRB.match(line).group() |
392 |
< |
common.logger.debug(5,"RB "+RB) |
393 |
< |
pass |
552 |
> |
def queryDetailedStatus(self, id): |
553 |
> |
""" Query a detailed status of the job with id """ |
554 |
> |
cmd = 'edg-job-status '+id |
555 |
> |
cmd_out = runCommand(cmd) |
556 |
> |
return cmd_out |
557 |
|
|
558 |
< |
if reCEId.search( line ): |
559 |
< |
for lineCE in lines[i:-1]: |
397 |
< |
if reCE.match( lineCE ): |
398 |
< |
CE = string.strip(reCE.search(lineCE).group(1)) |
399 |
< |
CEs.append(CE.split(':')[0]) |
400 |
< |
pass |
401 |
< |
pass |
402 |
< |
pass |
403 |
< |
i=i+1 |
404 |
< |
pass |
558 |
> |
def findSites_(self, n): |
559 |
> |
itr4 =[] |
560 |
|
|
561 |
< |
common.logger.debug(5,"All CE :"+str(CEs)) |
561 |
> |
sites = common.jobDB.destination(n) |
562 |
|
|
563 |
< |
sites = [] |
564 |
< |
[sites.append(it) for it in CEs if not sites.count(it)] |
563 |
> |
if len(sites)>0 and sites[0]=="": |
564 |
> |
return itr4 |
565 |
|
|
566 |
< |
common.logger.debug(5,"All Sites :"+str(sites)) |
567 |
< |
return len(sites) |
568 |
< |
|
569 |
< |
def noMatchFound_(self, jdl): |
570 |
< |
reReq = re.compile( r'Requirements' ) |
571 |
< |
reString = re.compile( r'"\S*"' ) |
572 |
< |
f = file(jdl,'r') |
573 |
< |
for line in f.readlines(): |
574 |
< |
line= line.strip() |
575 |
< |
if reReq.match(line): |
576 |
< |
for req in reString.findall(line): |
577 |
< |
if re.search("VO",req): |
578 |
< |
common.logger.message( "SW required: "+req) |
579 |
< |
continue |
580 |
< |
if re.search('"\d+',req): |
581 |
< |
common.logger.message("Other req : "+req) |
582 |
< |
continue |
583 |
< |
common.logger.message( "CE required: "+req) |
429 |
< |
break |
430 |
< |
pass |
431 |
< |
raise CrabException("No compatible resources found!") |
566 |
> |
itr = '' |
567 |
> |
if sites != [""]:#CarlosDaniele |
568 |
> |
##Addedd Daniele |
569 |
> |
replicas = self.blackWhiteListParser.checkBlackList(sites,n) |
570 |
> |
if len(replicas)!=0: |
571 |
> |
replicas = self.blackWhiteListParser.checkWhiteList(replicas,n) |
572 |
> |
|
573 |
> |
if len(replicas)==0: |
574 |
> |
msg = 'No sites remaining that host any part of the requested data! Exiting... ' |
575 |
> |
raise CrabException(msg) |
576 |
> |
##### |
577 |
> |
# for site in sites: |
578 |
> |
for site in replicas: |
579 |
> |
#itr = itr + 'target.GlueSEUniqueID=="'+site+'" || ' |
580 |
> |
itr = itr + 'target.GlueSEUniqueID=="'+site+'" || ' |
581 |
> |
itr = itr[0:-4] |
582 |
> |
itr4.append( itr ) |
583 |
> |
return itr4 |
584 |
|
|
585 |
< |
def submit(self, nj): |
585 |
> |
def createXMLSchScript(self, nj, argsList): |
586 |
> |
|
587 |
|
""" |
588 |
< |
Submit one EDG job. |
588 |
> |
Create a XML-file for BOSS4. |
589 |
|
""" |
590 |
< |
|
438 |
< |
self.checkProxy() |
439 |
< |
jid = None |
440 |
< |
jdl = common.job_list[nj].jdlFilename() |
441 |
< |
|
442 |
< |
cmd = 'edg-job-submit ' + self.configOpt_() + jdl |
443 |
< |
cmd_out = runCommand(cmd) |
444 |
< |
if cmd_out != None: |
445 |
< |
reSid = re.compile( r'https.+' ) |
446 |
< |
jid = reSid.search(cmd_out).group() |
447 |
< |
pass |
448 |
< |
return jid |
449 |
< |
|
450 |
< |
def resubmit(self, nj_list): |
590 |
> |
# job = common.job_list[nj] |
591 |
|
""" |
592 |
< |
Prepare jobs to be submit |
592 |
> |
INDY |
593 |
> |
[begin] FIX-ME: |
594 |
> |
I would pass jobType instead of job |
595 |
> |
""" |
596 |
> |
index = nj - 1 |
597 |
> |
job = common.job_list[index] |
598 |
> |
jbt = job.type() |
599 |
> |
|
600 |
> |
inp_sandbox = jbt.inputSandbox(index) |
601 |
> |
#out_sandbox = jbt.outputSandbox(index) |
602 |
> |
""" |
603 |
> |
[end] FIX-ME |
604 |
|
""" |
454 |
– |
return |
455 |
– |
|
456 |
– |
def getExitStatus(self, id): |
457 |
– |
return self.getStatusAttribute_(id, 'exit_code') |
458 |
– |
|
459 |
– |
def queryStatus(self, id): |
460 |
– |
return self.getStatusAttribute_(id, 'status') |
461 |
– |
|
462 |
– |
def queryDest(self, id): |
463 |
– |
return self.getStatusAttribute_(id, 'destination') |
464 |
– |
|
465 |
– |
|
466 |
– |
def getStatusAttribute_(self, id, attr): |
467 |
– |
""" Query a status of the job with id """ |
605 |
|
|
606 |
< |
self.checkProxy() |
607 |
< |
hstates = {} |
608 |
< |
Status = importName('edg_wl_userinterface_common_LbWrapper', 'Status') |
609 |
< |
# Bypass edg-job-status interfacing directly to C++ API |
610 |
< |
# Job attribute vector to retrieve status without edg-job-status |
611 |
< |
level = 0 |
475 |
< |
# Instance of the Status class provided by LB API |
476 |
< |
jobStat = Status() |
477 |
< |
st = 0 |
478 |
< |
jobStat.getStatus(id, level) |
479 |
< |
err, apiMsg = jobStat.get_error() |
480 |
< |
if err: |
481 |
< |
common.logger.debug(5,'Error caught' + apiMsg) |
482 |
< |
return None |
483 |
< |
else: |
484 |
< |
for i in range(len(self.states)): |
485 |
< |
# Fill an hash table with all information retrieved from LB API |
486 |
< |
hstates[ self.states[i] ] = jobStat.loadStatus(st)[i] |
487 |
< |
result = jobStat.loadStatus(st)[ self.states.index(attr) ] |
488 |
< |
return result |
606 |
> |
|
607 |
> |
title = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n' |
608 |
> |
jt_string = '' |
609 |
> |
|
610 |
> |
xml_fname = str(self.jobtypeName)+'.xml' |
611 |
> |
xml = open(common.work_space.shareDir()+'/'+xml_fname, 'a') |
612 |
|
|
613 |
< |
def queryDetailedStatus(self, id): |
614 |
< |
""" Query a detailed status of the job with id """ |
615 |
< |
cmd = 'edg-job-status '+id |
616 |
< |
cmd_out = runCommand(cmd) |
617 |
< |
return cmd_out |
613 |
> |
#TaskName |
614 |
> |
dir = string.split(common.work_space.topDir(), '/') |
615 |
> |
taskName = dir[len(dir)-2] |
616 |
> |
|
617 |
> |
to_write = '' |
618 |
|
|
619 |
< |
def getOutput(self, id): |
620 |
< |
""" |
498 |
< |
Get output for a finished job with id. |
499 |
< |
Returns the name of directory with results. |
500 |
< |
""" |
619 |
> |
req=' ' |
620 |
> |
req = req + jbt.getRequirements() |
621 |
|
|
622 |
< |
self.checkProxy() |
623 |
< |
cmd = 'edg-job-get-output --dir ' + common.work_space.resDir() + ' ' + id |
624 |
< |
cmd_out = runCommand(cmd) |
622 |
> |
if self.EDG_requirements: |
623 |
> |
if (req == ' '): |
624 |
> |
req = req + self.EDG_requirements |
625 |
> |
else: |
626 |
> |
req = req + ' && ' + self.EDG_requirements |
627 |
> |
if self.EDG_ce_white_list: |
628 |
> |
ce_white_list = string.split(self.EDG_ce_white_list,',') |
629 |
> |
for i in range(len(ce_white_list)): |
630 |
> |
if i == 0: |
631 |
> |
if (req == ' '): |
632 |
> |
req = req + '((RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))' |
633 |
> |
else: |
634 |
> |
req = req + ' && ((RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))' |
635 |
> |
pass |
636 |
> |
else: |
637 |
> |
req = req + ' || (RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))' |
638 |
> |
req = req + ')' |
639 |
> |
|
640 |
> |
if self.EDG_ce_black_list: |
641 |
> |
ce_black_list = string.split(self.EDG_ce_black_list,',') |
642 |
> |
for ce in ce_black_list: |
643 |
> |
if (req == ' '): |
644 |
> |
req = req + '(!RegExp("' + ce + '", other.GlueCEUniqueId))' |
645 |
> |
else: |
646 |
> |
req = req + ' && (!RegExp("' + ce + '", other.GlueCEUniqueId))' |
647 |
> |
pass |
648 |
> |
if self.EDG_clock_time: |
649 |
> |
if (req == ' '): |
650 |
> |
req = req + 'other.GlueCEPolicyMaxWallClockTime>='+self.EDG_clock_time |
651 |
> |
else: |
652 |
> |
req = req + ' && other.GlueCEPolicyMaxWallClockTime>='+self.EDG_clock_time |
653 |
|
|
654 |
< |
# Determine the output directory name |
655 |
< |
dir = common.work_space.resDir() |
656 |
< |
dir += os.getlogin() |
657 |
< |
dir += '_' + os.path.basename(id) |
658 |
< |
return dir |
654 |
> |
if self.EDG_cpu_time: |
655 |
> |
if (req == ' '): |
656 |
> |
req = req + ' other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time |
657 |
> |
else: |
658 |
> |
req = req + ' && other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time |
659 |
> |
|
660 |
> |
if ( self.EDG_retry_count ): |
661 |
> |
to_write = to_write + 'RetryCount = "'+self.EDG_retry_count+'"\n' |
662 |
> |
pass |
663 |
|
|
664 |
< |
def cancel(self, id): |
665 |
< |
""" Cancel the EDG job with id """ |
666 |
< |
self.checkProxy() |
515 |
< |
cmd = 'edg-job-cancel --noint ' + id |
516 |
< |
cmd_out = runCommand(cmd) |
517 |
< |
return cmd_out |
664 |
> |
if ( self.EDG_shallow_retry_count ): |
665 |
> |
to_write = to_write + 'ShallowRetryCount = "'+self.EDG_shallow_retry_count+'"\n' |
666 |
> |
pass |
667 |
|
|
668 |
< |
def createSchScript(self, nj): |
669 |
< |
""" |
521 |
< |
Create a JDL-file for EDG. |
522 |
< |
""" |
668 |
> |
to_write = to_write + 'MyProxyServer = ""' + self.proxyServer + '""\n' |
669 |
> |
to_write = to_write + 'VirtualOrganisation = ""' + self.VO + '""\n' |
670 |
|
|
671 |
< |
job = common.job_list[nj] |
672 |
< |
jbt = job.type() |
673 |
< |
inp_sandbox = jbt.inputSandbox(nj) |
674 |
< |
out_sandbox = jbt.outputSandbox(nj) |
675 |
< |
inp_storage_subdir = '' |
671 |
> |
#TaskName |
672 |
> |
dir = string.split(common.work_space.topDir(), '/') |
673 |
> |
taskName = dir[len(dir)-2] |
674 |
> |
|
675 |
> |
xml.write(str(title)) |
676 |
> |
#xml.write('<task name="' +str(taskName)+'" sub_path="' +common.work_space.pathForTgz() + 'share/.boss_cache">\n') |
677 |
> |
|
678 |
> |
#xml.write('<task name="' +str(taskName)+ '" sub_path="' +common.work_space.pathForTgz() + 'share/.boss_cache"' + '" task_info="' + os.path.expandvars('X509_USER_PROXY') + '">\n') |
679 |
> |
x509_cmd = 'ls /tmp/x509up_u`id -u`' |
680 |
> |
x509=runCommand(x509_cmd).strip() |
681 |
> |
xml.write('<task name="' +str(taskName)+ '" sub_path="' +common.work_space.pathForTgz() + 'share/.boss_cache"' + ' task_info="' + str(x509) + '">\n') |
682 |
> |
xml.write(jt_string) |
683 |
|
|
684 |
< |
title = '# This JDL was generated by '+\ |
685 |
< |
common.prog_name+' (version '+common.prog_version_str+')\n' |
686 |
< |
jt_string = '' |
687 |
< |
|
684 |
> |
if (to_write != ''): |
685 |
> |
xml.write('<extraTags\n') |
686 |
> |
xml.write(to_write) |
687 |
> |
xml.write('/>\n') |
688 |
> |
pass |
689 |
|
|
690 |
+ |
xml.write('<iterator>\n') |
691 |
+ |
xml.write('\t<iteratorRule name="ITR1">\n') |
692 |
+ |
xml.write('\t\t<ruleElement> 1:'+ str(nj) + ' </ruleElement>\n') |
693 |
+ |
xml.write('\t</iteratorRule>\n') |
694 |
+ |
xml.write('\t<iteratorRule name="ITR2">\n') |
695 |
+ |
for arg in argsList: |
696 |
+ |
xml.write('\t\t<ruleElement> <![CDATA[\n'+ arg + '\n\t\t]]> </ruleElement>\n') |
697 |
+ |
pass |
698 |
+ |
xml.write('\t</iteratorRule>\n') |
699 |
+ |
#print jobList |
700 |
+ |
xml.write('\t<iteratorRule name="ITR3">\n') |
701 |
+ |
xml.write('\t\t<ruleElement> 1:'+ str(nj) + ':1:6 </ruleElement>\n') |
702 |
+ |
xml.write('\t</iteratorRule>\n') |
703 |
+ |
|
704 |
+ |
''' |
705 |
+ |
indy: here itr4 |
706 |
+ |
''' |
707 |
|
|
708 |
< |
SPL = inp_storage_subdir |
709 |
< |
if ( SPL and SPL[-1] != '/' ) : SPL = SPL + '/' |
708 |
> |
xml.write('<chain name="' +str(taskName)+'__ITR1_" scheduler="'+str(self.schedulerName)+'">\n') |
709 |
> |
# xml.write('<chain scheduler="'+str(self.schedulerName)+'">\n') |
710 |
> |
xml.write(jt_string) |
711 |
|
|
712 |
< |
jdl_fname = job.jdlFilename() |
540 |
< |
jdl = open(jdl_fname, 'w') |
541 |
< |
jdl.write(title) |
712 |
> |
#executable |
713 |
|
|
714 |
+ |
""" |
715 |
+ |
INDY |
716 |
+ |
script depends on jobType: it should be probably get in a different way |
717 |
+ |
""" |
718 |
|
script = job.scriptFilename() |
719 |
< |
jdl.write('Executable = "' + os.path.basename(script) +'";\n') |
720 |
< |
jdl.write(jt_string) |
721 |
< |
|
722 |
< |
### only one .sh JDL has arguments: |
723 |
< |
firstEvent = common.jobDB.firstEvent(nj) |
724 |
< |
maxEvents = common.jobDB.maxEvents(nj) |
725 |
< |
jdl.write('Arguments = "' + str(nj+1)+' '+str(firstEvent)+' '+str(maxEvents)+'";\n') |
551 |
< |
|
552 |
< |
inp_box = 'InputSandbox = { ' |
553 |
< |
inp_box = inp_box + '"' + script + '",' |
719 |
> |
xml.write('<program>\n') |
720 |
> |
xml.write('<exec> ' + os.path.basename(script) +' </exec>\n') |
721 |
> |
xml.write(jt_string) |
722 |
> |
|
723 |
> |
xml.write('<args> <![CDATA[\n _ITR2_ \n]]> </args>\n') |
724 |
> |
xml.write('<program_types> crabjob </program_types>\n') |
725 |
> |
inp_box = common.work_space.pathForTgz() + 'job/' + jbt.scriptName + ',' |
726 |
|
|
727 |
|
if inp_sandbox != None: |
728 |
|
for fl in inp_sandbox: |
729 |
< |
inp_box = inp_box + ' "' + fl + '",' |
729 |
> |
inp_box = inp_box + '' + fl + ',' |
730 |
|
pass |
731 |
|
pass |
732 |
|
|
733 |
< |
#if common.use_jam: |
734 |
< |
# inp_box = inp_box+' "'+common.bin_dir+'/'+common.run_jam+'",' |
735 |
< |
|
736 |
< |
# Marco (VERY TEMPORARY ML STUFF) |
737 |
< |
inp_box = inp_box+' "' + os.path.abspath(os.environ['CRABDIR']+'/python/'+'report.py') + '", "' +\ |
738 |
< |
os.path.abspath(os.environ['CRABDIR']+'/python/'+'DashboardAPI.py') + '", "'+\ |
567 |
< |
os.path.abspath(os.environ['CRABDIR']+'/python/'+'Logger.py') + '", "'+\ |
568 |
< |
os.path.abspath(os.environ['CRABDIR']+'/python/'+'ProcInfo.py') + '", "'+\ |
569 |
< |
os.path.abspath(os.environ['CRABDIR']+'/python/'+'apmon.py') + '"' |
570 |
< |
# End Marco |
571 |
< |
|
572 |
< |
if (not jbt.additional_inbox_files == []): |
573 |
< |
inp_box = inp_box + ', ' |
574 |
< |
for addFile in jbt.additional_inbox_files: |
575 |
< |
addFile = os.path.abspath(addFile) |
576 |
< |
inp_box = inp_box+' "'+addFile+'",' |
577 |
< |
pass |
733 |
> |
# if (not jbt.additional_inbox_files == []): |
734 |
> |
# inp_box = inp_box + ',' |
735 |
> |
# for addFile in jbt.additional_inbox_files: |
736 |
> |
# #addFile = os.path.abspath(addFile) |
737 |
> |
# inp_box = inp_box+''+addFile+',' |
738 |
> |
# pass |
739 |
|
|
740 |
|
if inp_box[-1] == ',' : inp_box = inp_box[:-1] |
741 |
< |
inp_box = inp_box + ' };\n' |
742 |
< |
jdl.write(inp_box) |
582 |
< |
|
583 |
< |
jdl.write('StdOutput = "' + job.stdout() + '";\n') |
584 |
< |
jdl.write('StdError = "' + job.stderr() + '";\n') |
741 |
> |
inp_box = '<infiles> <![CDATA[\n' + inp_box + '\n]]> </infiles>\n' |
742 |
> |
xml.write(inp_box) |
743 |
|
|
744 |
+ |
base = jbt.name() |
745 |
+ |
stdout = base + '__ITR3_.stdout' |
746 |
+ |
stderr = base + '__ITR3_.stderr' |
747 |
|
|
748 |
< |
if job.stdout() == job.stderr(): |
749 |
< |
out_box = 'OutputSandbox = { "' + \ |
750 |
< |
job.stdout() + '", ".BrokerInfo",' |
751 |
< |
else: |
752 |
< |
out_box = 'OutputSandbox = { "' + \ |
753 |
< |
job.stdout() + '", "' + \ |
593 |
< |
job.stderr() + '", ".BrokerInfo",' |
748 |
> |
xml.write('<stderr> ' + stderr + '</stderr>\n') |
749 |
> |
xml.write('<stdout> ' + stdout + '</stdout>\n') |
750 |
> |
|
751 |
> |
|
752 |
> |
out_box = stdout + ',' + \ |
753 |
> |
stderr + ',.BrokerInfo,' |
754 |
|
|
755 |
+ |
""" |
756 |
|
if int(self.return_data) == 1: |
757 |
|
if out_sandbox != None: |
758 |
|
for fl in out_sandbox: |
759 |
< |
out_box = out_box + ' "' + fl + '",' |
759 |
> |
out_box = out_box + '' + fl + ',' |
760 |
|
pass |
761 |
|
pass |
762 |
|
pass |
763 |
< |
|
763 |
> |
""" |
764 |
> |
|
765 |
> |
""" |
766 |
> |
INDY |
767 |
> |
something similar should be also done for infiles (if it makes sense!) |
768 |
> |
""" |
769 |
> |
# Stuff to be returned _always_ via sandbox |
770 |
> |
for fl in jbt.output_file_sandbox: |
771 |
> |
out_box = out_box + '' + jbt.numberFile_(fl, '_ITR1_') + ',' |
772 |
> |
pass |
773 |
> |
pass |
774 |
> |
|
775 |
> |
# via sandbox iif required return_data |
776 |
> |
if int(self.return_data) == 1: |
777 |
> |
for fl in jbt.output_file: |
778 |
> |
out_box = out_box + '' + jbt.numberFile_(fl, '_ITR1_') + ',' |
779 |
> |
pass |
780 |
> |
pass |
781 |
> |
|
782 |
|
if out_box[-1] == ',' : out_box = out_box[:-1] |
783 |
< |
out_box = out_box + ' };' |
784 |
< |
jdl.write(out_box+'\n') |
783 |
> |
out_box = '<outfiles> <![CDATA[\n' + out_box + '\n]]></outfiles>\n' |
784 |
> |
xml.write(out_box) |
785 |
> |
|
786 |
> |
xml.write('<BossAttr> crabjob.INTERNAL_ID=_ITR1_ </BossAttr>\n') |
787 |
|
|
788 |
+ |
xml.write('</program>\n') |
789 |
+ |
xml.write('</chain>\n') |
790 |
|
|
791 |
< |
req='Requirements = ' |
792 |
< |
req = req + jbt.getRequirements() |
610 |
< |
# ### if at least a CE exists ... |
611 |
< |
# if common.analisys_common_info['sites']: |
612 |
< |
# if common.analisys_common_info['sw_version']: |
613 |
< |
# req='Requirements = ' |
614 |
< |
# req=req + 'Member("VO-cms-' + \ |
615 |
< |
# common.analisys_common_info['sw_version'] + \ |
616 |
< |
# '", other.GlueHostApplicationSoftwareRunTimeEnvironment)' |
617 |
< |
# if len(common.analisys_common_info['sites'])>0: |
618 |
< |
# req = req + ' && (' |
619 |
< |
# for i in range(len(common.analisys_common_info['sites'])): |
620 |
< |
# req = req + 'other.GlueCEInfoHostName == "' \ |
621 |
< |
# + common.analisys_common_info['sites'][i] + '"' |
622 |
< |
# if ( i < (int(len(common.analisys_common_info['sites']) - 1)) ): |
623 |
< |
# req = req + ' || ' |
624 |
< |
# req = req + ')' |
625 |
< |
#### and USER REQUIREMENT |
626 |
< |
if self.EDG_requirements: |
627 |
< |
if (req == 'Requirement = '): |
628 |
< |
req = req + self.EDG_requirements |
629 |
< |
else: |
630 |
< |
req = req + ' && ' + self.EDG_requirements |
631 |
< |
if self.EDG_clock_time: |
632 |
< |
if (req == 'Requirement = '): |
633 |
< |
req = req + 'other.GlueCEPolicyMaxWallClockTime>='+self.EDG_clock_time |
634 |
< |
else: |
635 |
< |
req = req + ' && other.GlueCEPolicyMaxWallClockTime>='+self.EDG_clock_time |
636 |
< |
|
637 |
< |
if self.EDG_cpu_time: |
638 |
< |
if (req == 'Requirement = '): |
639 |
< |
req = req + ' other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time |
640 |
< |
else: |
641 |
< |
req = req + ' && other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time |
642 |
< |
if (req != 'Requirement = '): |
643 |
< |
req = req + ';\n' |
644 |
< |
jdl.write(req) |
645 |
< |
|
646 |
< |
jdl.write('VirtualOrganisation = "' + self.VO + '";\n') |
791 |
> |
xml.write('</iterator>\n') |
792 |
> |
xml.write('</task>\n') |
793 |
|
|
794 |
< |
if ( self.EDG_retry_count ): |
795 |
< |
jdl.write('RetryCount = '+self.EDG_retry_count+';\n') |
650 |
< |
pass |
794 |
> |
xml.close() |
795 |
> |
|
796 |
|
|
652 |
– |
jdl.close() |
797 |
|
return |
798 |
|
|
799 |
|
def checkProxy(self): |
801 |
|
Function to check the Globus proxy. |
802 |
|
""" |
803 |
|
if (self.proxyValid): return |
804 |
< |
timeleft = -999 |
805 |
< |
minTimeLeft=10 # in hours |
806 |
< |
cmd = 'grid-proxy-info -e -v '+str(minTimeLeft)+':00' |
807 |
< |
# SL Here I have to use os.system since the stupid command exit with >0 if no valid proxy is found |
808 |
< |
cmd_out = os.system(cmd) |
809 |
< |
if (cmd_out>0): |
810 |
< |
common.logger.message( "No valid proxy found or timeleft too short!\n Creating a user proxy with default length of 100h\n") |
811 |
< |
cmd = 'grid-proxy-init -valid 100:00' |
804 |
> |
|
805 |
> |
### Just return if asked to do so |
806 |
> |
if (self.dontCheckProxy==1): |
807 |
> |
self.proxyValid=1 |
808 |
> |
return |
809 |
> |
|
810 |
> |
minTimeLeft=10*3600 # in seconds |
811 |
> |
|
812 |
> |
minTimeLeftServer = 100 # in hours |
813 |
> |
|
814 |
> |
mustRenew = 0 |
815 |
> |
timeLeftLocal = runCommand('voms-proxy-info -timeleft 2>/dev/null') |
816 |
> |
timeLeftServer = -999 |
817 |
> |
if not timeLeftLocal or int(timeLeftLocal) <= 0 or not isInt(timeLeftLocal): |
818 |
> |
mustRenew = 1 |
819 |
> |
else: |
820 |
> |
timeLeftServer = runCommand('voms-proxy-info -actimeleft 2>/dev/null | head -1') |
821 |
> |
if not timeLeftServer or not isInt(timeLeftServer): |
822 |
> |
mustRenew = 1 |
823 |
> |
elif timeLeftLocal<minTimeLeft or timeLeftServer<minTimeLeft: |
824 |
> |
mustRenew = 1 |
825 |
> |
pass |
826 |
> |
pass |
827 |
> |
|
828 |
> |
if mustRenew: |
829 |
> |
common.logger.message( "No valid proxy found or remaining time of validity of already existing proxy shorter than 10 hours!\n Creating a user proxy with default length of 192h\n") |
830 |
> |
cmd = 'voms-proxy-init -voms '+self.VO |
831 |
> |
if self.group: |
832 |
> |
cmd += ':/'+self.VO+'/'+self.group |
833 |
> |
if self.role: |
834 |
> |
cmd += '/role='+self.role |
835 |
> |
cmd += ' -valid 192:00' |
836 |
|
try: |
837 |
|
# SL as above: damn it! |
838 |
+ |
common.logger.debug(10,cmd) |
839 |
|
out = os.system(cmd) |
840 |
|
if (out>0): raise CrabException("Unable to create a valid proxy!\n") |
841 |
|
except: |
842 |
|
msg = "Unable to create a valid proxy!\n" |
843 |
|
raise CrabException(msg) |
675 |
– |
# cmd = 'grid-proxy-info -timeleft' |
676 |
– |
# cmd_out = runCommand(cmd,0,20) |
844 |
|
pass |
845 |
+ |
|
846 |
+ |
## now I do have a voms proxy valid, and I check the myproxy server |
847 |
+ |
renewProxy = 0 |
848 |
+ |
cmd = 'myproxy-info -d -s '+self.proxyServer |
849 |
+ |
cmd_out = runCommand(cmd,0,20) |
850 |
+ |
if not cmd_out: |
851 |
+ |
common.logger.message('No credential delegated to myproxy server '+self.proxyServer+' will do now') |
852 |
+ |
renewProxy = 1 |
853 |
+ |
else: |
854 |
+ |
# if myproxy exist but not long enough, renew |
855 |
+ |
reTime = re.compile( r'timeleft: (\d+)' ) |
856 |
+ |
#print "<"+str(reTime.search( cmd_out ).group(1))+">" |
857 |
+ |
if reTime.match( cmd_out ): |
858 |
+ |
time = reTime.search( cmd_out ).group(1) |
859 |
+ |
if time < minTimeLeftServer: |
860 |
+ |
renewProxy = 1 |
861 |
+ |
common.logger.message('No credential delegation will expire in '+time+' hours: renew it') |
862 |
+ |
pass |
863 |
+ |
pass |
864 |
+ |
|
865 |
+ |
# if not, create one. |
866 |
+ |
if renewProxy: |
867 |
+ |
cmd = 'myproxy-init -d -n -s '+self.proxyServer |
868 |
+ |
out = os.system(cmd) |
869 |
+ |
if (out>0): |
870 |
+ |
raise CrabException("Unable to delegate the proxy to myproxyserver "+self.proxyServer+" !\n") |
871 |
+ |
pass |
872 |
+ |
|
873 |
+ |
# cache proxy validity |
874 |
|
self.proxyValid=1 |
875 |
|
return |
876 |
< |
|
876 |
> |
|
877 |
|
def configOpt_(self): |
878 |
|
edg_ui_cfg_opt = ' ' |
879 |
|
if self.edg_config: |
880 |
< |
edg_ui_cfg_opt = ' -c ' + self.edg_config + ' ' |
880 |
> |
edg_ui_cfg_opt = ' -c ' + self.edg_config + ' ' |
881 |
|
if self.edg_config_vo: |
882 |
< |
edg_ui_cfg_opt += ' --config-vo ' + self.edg_config_vo + ' ' |
882 |
> |
edg_ui_cfg_opt += ' --config-vo ' + self.edg_config_vo + ' ' |
883 |
|
return edg_ui_cfg_opt |
884 |
+ |
|
885 |
+ |
def submitTout(self, list): |
886 |
+ |
return 120 |
887 |
+ |
|
888 |
+ |
|