ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/SchedulerRemoteglidein.py
(Generate patch)

Comparing COMP/CRAB/python/SchedulerRemoteglidein.py (file contents):
Revision 1.2 by belforte, Mon Aug 27 20:16:24 2012 UTC vs.
Revision 1.6 by belforte, Mon Oct 22 12:07:36 2012 UTC

# Line 39 | Line 39 | class SchedulerRemoteglidein(SchedulerGr
39          self.OSBsize = 50*1000*1000 # 50 MB
40  
41          self.environment_unique_identifier = None
42 +        self.submissionDay = time.strftime("%y%m%d",time.localtime())
43  
44          return
45  
# Line 57 | Line 58 | class SchedulerRemoteglidein(SchedulerGr
58          self.group = cfg_params.get("GRID.group", None)
59          self.role = cfg_params.get("GRID.role", None)
60          self.VO = cfg_params.get('GRID.virtual_organization','cms')
61 +        self.allowOverflow = cfg_params.get('GRID.allow_overflow', 1)
62  
63          self.checkProxy()
64  
# Line 80 | Line 82 | class SchedulerRemoteglidein(SchedulerGr
82              msg+="\n Use GRID.se_white_list and/or GRID.se_black_list instead"
83              raise CrabException(msg)
84  
85 +
86 +        # make sure proxy FQAN has not changed since last time
87 +        command =  "voms-proxy-info -identity -fqan 2>/dev/null"
88 +        command += " | head -2"
89 +        identity = runCommand(command)
90 +        idfile = common.work_space.shareDir() + "GridIdentity"
91 +        if os.access(idfile, os.F_OK) :
92 +            # identity file exists from previous commands
93 +            f=open(idfile, 'r')
94 +            idFromFile=f.read()
95 +            f.close()
96 +        else :
97 +            # create it
98 +            f=open(idfile, 'w')
99 +            f.write(identity)
100 +            f.close()
101 +            idFromFile = identity
102 +
103 +        if identity != idFromFile:
104 +            msg =  "Wrong Grid Credentials:\n%s" % identity
105 +            msg += "\nMake sure you have "
106 +            msg += " DN, FQAN =\n%s" % idFromFile
107 +            raise CrabException(msg)
108 +
109          return
110      
111      def userName(self):
# Line 125 | Line 151 | class SchedulerRemoteglidein(SchedulerGr
151          jobParams += '+DESIRED_CMSScramArch ="' +scramArch+'";'
152          
153          myscheddName = self.remoteHost
154 <        jobParams += '+Glidein_MonitorID = "https://'+ myscheddName  + '//$(Cluster).$(Process)"; '
154 >        jobParams += '+Glidein_MonitorID = "https://'+ myscheddName + \
155 >                     '//' + self.submissionDay + '//$(Cluster).$(Process)"; '
156  
157          if (self.EDG_clock_time):
158              jobParams += '+MaxWallTimeMins = '+self.EDG_clock_time+'; '
159          else:
160              jobParams += '+MaxWallTimeMins = %d; ' % (60*24)
161  
162 +        if self.allowOverflow == "0":
163 +            jobParams += '+CMS_ALLOW_OVERFLOW = False; '
164 +
165          common._db.updateTask_({'jobType':jobParams})
166  
167  
# Line 152 | Line 182 | class SchedulerRemoteglidein(SchedulerGr
182          
183          params = {'shareDir':shareDir,
184                    'jobDir':jobDir,
185 <                  'taskDir':taskDir}
185 >                  'taskDir':taskDir,
186 >                  'submissionDay':self.submissionDay}
187  
188          return params
189  
# Line 270 | Line 301 | class SchedulerRemoteglidein(SchedulerGr
301              if not remoteHost:
302                  raise CrabException('FATAL ERROR: remoteHost not defined')
303              
304 <            common.logger.info("try to find out username for remote Host via uberftp ...")
305 <            command="uberftp %s pwd|grep User|awk '{print $3}'" % remoteHost
306 <            (status, output) = commands.getstatusoutput(command)
307 <            if status == 0:
308 <                remoteUser = output
309 <                common.logger.info("remoteUser set to %s" % remoteUser)
310 <                if remoteUser==None:
311 <                    raise CrabException('FATAL ERROR: REMOTE USER not defined')
304 >            #common.logger.info("try to find out username for remote Host via uberftp ...")
305 >            #command="uberftp %s pwd|grep User|awk '{print $3}'" % remoteHost
306 >            #(status, output) = commands.getstatusoutput(command)
307 >            #if status == 0:
308 >            #    remoteUser = output
309 >            #    common.logger.info("remoteUser set to %s" % remoteUser)
310 >            #    if remoteUser==None:
311 >            #        raise CrabException('FATAL ERROR: REMOTE USER not defined')
312  
313 <            remoteUserHost = remoteUser + '@' + remoteHost
313 >            #remoteUserHost = remoteUser + '@' + remoteHost
314 >            remoteUserHost = remoteHost
315  
316          common._db.updateTask_({'serverName':remoteUserHost})
317  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines