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.14 by belforte, Thu Jan 17 14:46:45 2013 UTC vs.
Revision 1.15 by belforte, Thu Feb 7 16:57:51 2013 UTC

# Line 40 | Line 40 | class SchedulerRemoteglidein(SchedulerGr
40  
41          self.environment_unique_identifier = None
42          self.submissionDay = time.strftime("%y%m%d",time.localtime())
43 <
43 >        
44          return
45  
46  
# Line 48 | Line 48 | class SchedulerRemoteglidein(SchedulerGr
48          """
49          Configure the scheduler with the config settings from the user
50          """
51 <        
51 >  
52 >        # this line needs to be before the call to SchedulerGrid.configure
53 >        # because that calls SchedulerRemoteglidin in turn and
54 >        # sshControlPersist needs to be defined then :-(
55 >        self.sshControlPersist =  cfg_params.get('USER.ssh_control_persist','3600')
56 >        if self.sshControlPersist.lower() == "no" or \
57 >                self.sshControlPersist.lower() == "yes" or \
58 >                self.sshControlPersist.isdigit() :
59 >            pass
60 >        else:
61 >            msg = "Error: invalid value '%s' for USER.ssh_control_persist " % \
62 >                self.sshControlPersist
63 >            raise CrabException(msg)
64 >
65          SchedulerGrid.configure(self, cfg_params)
66  
67          self.proxyValid=0
# Line 152 | Line 165 | class SchedulerRemoteglidein(SchedulerGr
165          jobParams += '+DESIRED_CMSScramArch ="' +scramArch+'";'
166          
167          myscheddName = self.remoteHost
168 +
169          jobParams += '+Glidein_MonitorID = "https://'+ myscheddName + \
170                       '//' + self.submissionDay + '//$(Cluster).$(Process)"; '
171  
# Line 175 | Line 189 | class SchedulerRemoteglidein(SchedulerGr
189  
190          common._db.updateTask_({'jobType':jobParams})
191  
178
192          return jobParams
193  
194  
# Line 184 | Line 197 | class SchedulerRemoteglidein(SchedulerGr
197          Return dictionary with specific parameters, to use with real scheduler
198          is called when scheduler is initialized in Boss, i.e. at each crab command
199          """
200 <        #SB this method is used to pass directory names to Boss Scheduler
200 >        #SB this method is used to pass informatinos to Boss Scheduler
201          # via params dictionary
202  
203          jobDir = common.work_space.jobDir()
# Line 194 | Line 207 | class SchedulerRemoteglidein(SchedulerGr
207          params = {'shareDir':shareDir,
208                    'jobDir':jobDir,
209                    'taskDir':taskDir,
210 <                  'submissionDay':self.submissionDay}
210 >                  'submissionDay':self.submissionDay,
211 >                  'sshControlPersist':self.sshControlPersist}
212  
213          return params
214  
# Line 266 | Line 280 | class SchedulerRemoteglidein(SchedulerGr
280              remoteUserHost=str(task['serverName'])
281              common.logger.info("serverName from Task DB is %s" %
282                                 remoteUserHost)
269            if '@' in remoteUserHost:
270                remoteHost = remoteUserHost.split('@')[1]
271            else:
272                remoteHost = remoteUserHost
283          else:
284              if self.cfg_params.has_key('CRAB.submit_host'):
285                  # get a remote submission host from crab config file
286                  srvCfg=ServerConfig(self.cfg_params['CRAB.submit_host']).config()
287 <                remoteHost=srvCfg['serverName']
288 <                common.logger.info("remotehost from crab.cfg = %s" % remoteHost)
287 >                remoteUserHost=srvCfg['serverName']
288 >                common.logger.info("remotehost from crab.cfg = %s" % remoteUserHost)
289              else:
290                  # pick from Available Servers List
291                  srvCfg=ServerConfig('default').config()
292 <                remoteHost = srvCfg['serverName']
293 <                common.logger.info("remotehost from Avail.List = %s" % remoteHost)
292 >                remoteUserHost = srvCfg['serverName']
293 >                common.logger.info("remotehost from Avail.List = %s" % remoteUserHost)
294  
295 <            if not remoteHost:
295 >            if not remoteUserHost:
296                  raise CrabException('FATAL ERROR: remoteHost not defined')
287            
288            #common.logger.info("try to find out username for remote Host via uberftp ...")
289            #command="uberftp %s pwd|grep User|awk '{print $3}'" % remoteHost
290            #(status, output) = commands.getstatusoutput(command)
291            #if status == 0:
292            #    remoteUser = output
293            #    common.logger.info("remoteUser set to %s" % remoteUser)
294            #    if remoteUser==None:
295            #        raise CrabException('FATAL ERROR: REMOTE USER not defined')
297  
298 <            #remoteUserHost = remoteUser + '@' + remoteHost
299 <            remoteUserHost = remoteHost
298 >        if '@' in remoteUserHost:
299 >            remoteHost = remoteUserHost.split('@')[1]
300 >        else:
301 >            remoteHost = remoteUserHost
302  
303          common._db.updateTask_({'serverName':remoteUserHost})
304  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines