def configure(self, csSection, submitPool ): """ Here goes common configuration for DIRAC PilotDirector """ PilotDirector.configure( self, csSection, submitPool ) self.reloadConfiguration( csSection, submitPool ) self.__failingCECache.purgeExpired() self.__ticketsCECache.purgeExpired() for ce in self.__failingCECache.getKeys(): if ce in self.computingElementDict.keys(): try: del self.computingElementDict[ce] except: pass if self.computingElementDict: self.log.info( ' ComputingElements:', ', '.join(self.computingElementDict.keys()) ) else: return # FIXME: this is to start testing _ceName, computingElementDict = self.computingElementDict.items()[0] self.computingElement = computingElementDict['CE'] self.log.debug( self.computingElement.getCEStatus() ) self.log.info( ' SiteName:', self.siteName )
def configureFromSection(self, mySection): """ reload from CS """ PilotDirector.configureFromSection(self, mySection) self.gridEnv = gConfig.getValue(mySection + '/GridEnv', self.gridEnv) if not self.gridEnv: # No specific option found, try a general one setup = gConfig.getValue('/DIRAC/Setup', '') if setup: instance = gConfig.getValue( '/DIRAC/Setups/%s/WorkloadManagement' % setup, '') if instance: self.gridEnv = gConfig.getValue( '/Systems/WorkloadManagement/%s/GridEnv' % instance, '') self.resourceBrokers = gConfig.getValue(mySection + '/ResourceBrokers', self.resourceBrokers) self.cpuPowerRef = gConfig.getValue(mySection + '/CPUPowerRef', self.cpuPowerRef) self.requirements = gConfig.getValue(mySection + '/Requirements', self.requirements) self.rank = gConfig.getValue(mySection + '/Rank', self.rank) self.fuzzyRank = gConfig.getValue(mySection + '/FuzzyRank', self.fuzzyRank)
def configure(self, csSection, submitPool): """ Here goes common configuration for DIRAC PilotDirector """ PilotDirector.configure(self, csSection, submitPool) self.reloadConfiguration(csSection, submitPool) self.__failingCECache.purgeExpired() self.__ticketsCECache.purgeExpired() for ce in self.__failingCECache.getKeys(): if ce in self.computingElementDict.keys(): try: del self.computingElementDict[ce] except: pass if self.computingElementDict: self.log.info(' ComputingElements:', ', '.join(self.computingElementDict.keys())) else: return # FIXME: this is to start testing _ceName, computingElementDict = self.computingElementDict.items()[0] self.computingElement = computingElementDict['CE'] self.log.debug(self.computingElement.getCEStatus()) self.log.info(' SiteName:', self.siteName)
def configureFromSection( self, mySection ): """ reload from CS """ PilotDirector.configureFromSection( self, mySection ) self.computingElementList = gConfig.getValue( mySection+'/ComputingElements' , self.computingElementList ) self.addComputingElement( self.computingElementList ) self.siteName = gConfig.getValue( mySection+'/SiteName' , self.siteName )
def configureFromSection( self, mySection ): """ reload from CS """ PilotDirector.configureFromSection( self, mySection ) self.computingElementList = gConfig.getValue( mySection+'/ComputingElements' , self.computingElementList ) self.addComputingElement( self.computingElementList ) self.siteName = gConfig.getValue( mySection+'/SiteName' , self.siteName )
def __init__( self, submitPool ): """ Define some defaults and call parent __init__ """ self.gridEnv = GRIDENV self.cpuPowerRef = CPU_POWER_REF self.requirements = REQUIREMENTS self.rank = RANK self.fuzzyRank = FUZZY_RANK self.__failingWMSCache = DictCache() self.__ticketsWMSCache = DictCache() self.__listMatchWMSCache = DictCache() PilotDirector.__init__( self, submitPool )
def __init__(self, submitPool): """ Define some defaults and call parent __init__ """ self.gridEnv = GRIDENV self.cpuPowerRef = CPU_POWER_REF self.requirements = REQUIREMENTS self.rank = RANK self.fuzzyRank = FUZZY_RANK self.__failingWMSCache = DictCache() self.__ticketsWMSCache = DictCache() self.__listMatchWMSCache = DictCache() PilotDirector.__init__(self, submitPool)
def __init__( self, submitPool ): """ Define some defaults and call parent __init__ """ self.gridMiddleware = 'DIRAC' PilotDirector.__init__( self, submitPool ) self.computingElementList = COMPUTING_ELEMENTS self.computingElementDict = {} self.addComputingElement( self.computingElementList ) self.siteName = gConfig.getValue('/LocalSite/Site','') if not self.siteName: self.log.error( 'Can not run a Director if Site Name is not defined' ) sys.exit() self.__failingCECache = DictCache() self.__ticketsCECache = DictCache()
def __init__( self, submitPool ): """ Define some defaults and call parent __init__ """ self.gridMiddleware = 'DIRAC' PilotDirector.__init__( self, submitPool ) self.computingElementList = COMPUTING_ELEMENTS self.computingElementDict = {} self.addComputingElement( self.computingElementList ) self.siteName = gConfig.getValue('/LocalSite/Site','') if not self.siteName: self.log.error( 'Can not run a Director if Site Name is not defined' ) sys.exit() self.__failingCECache = DictCache() self.__ticketsCECache = DictCache()
def configureFromSection( self, mySection ): """ reload from CS """ PilotDirector.configureFromSection( self, mySection ) self.gridEnv = gConfig.getValue( mySection + '/GridEnv', self.gridEnv ) if not self.gridEnv: # No specific option found, try a general one setup = gConfig.getValue( '/DIRAC/Setup', '' ) if setup: instance = gConfig.getValue( '/DIRAC/Setups/%s/WorkloadManagement' % setup, '' ) if instance: self.gridEnv = gConfig.getValue( '/Systems/WorkloadManagement/%s/GridEnv' % instance, '' ) self.resourceBrokers = gConfig.getValue( mySection + '/ResourceBrokers' , self.resourceBrokers ) self.cpuPowerRef = gConfig.getValue( mySection + '/CPUPowerRef' , self.cpuPowerRef ) self.requirements = gConfig.getValue( mySection + '/Requirements' , self.requirements ) self.rank = gConfig.getValue( mySection + '/Rank' , self.rank ) self.fuzzyRank = gConfig.getValue( mySection + '/FuzzyRank' , self.fuzzyRank )
def configureFromSection(self, mySection): """ reload from CS """ PilotDirector.configureFromSection(self, mySection) self.gridEnv = gConfig.getValue(mySection + "/GridEnv", self.gridEnv) if not self.gridEnv: # No specific option found, try a general one setup = gConfig.getValue("/DIRAC/Setup", "") if setup: instance = gConfig.getValue("/DIRAC/Setups/%s/WorkloadManagement" % setup, "") if instance: self.gridEnv = gConfig.getValue("/Systems/WorkloadManagement/%s/GridEnv" % instance, "") self.resourceBrokers = gConfig.getValue(mySection + "/ResourceBrokers", self.resourceBrokers) self.cpuPowerRef = gConfig.getValue(mySection + "/CPUPowerRef", self.cpuPowerRef) self.requirements = gConfig.getValue(mySection + "/Requirements", self.requirements) self.rank = gConfig.getValue(mySection + "/Rank", self.rank) self.fuzzyRank = gConfig.getValue(mySection + "/FuzzyRank", self.fuzzyRank)
def configure( self, csSection, submitPool ): """ Here goes common configuration for all Grid PilotDirectors """ PilotDirector.configure( self, csSection, submitPool ) self.reloadConfiguration( csSection, submitPool ) self.__failingWMSCache.purgeExpired() self.__ticketsWMSCache.purgeExpired() for rb in self.__failingWMSCache.getKeys(): if rb in self.resourceBrokers: try: self.resourceBrokers.remove( rb ) except: pass self.resourceBrokers = List.randomize( self.resourceBrokers ) if self.gridEnv: self.log.info( ' GridEnv: ', self.gridEnv ) if self.resourceBrokers: self.log.info( ' ResourceBrokers:', ', '.join( self.resourceBrokers ) )
def configure(self, csSection, submitPool): """ Here goes common configuration for all Grid PilotDirectors """ PilotDirector.configure(self, csSection, submitPool) self.reloadConfiguration(csSection, submitPool) self.__failingWMSCache.purgeExpired() self.__ticketsWMSCache.purgeExpired() for rb in self.__failingWMSCache.getKeys(): if rb in self.resourceBrokers: try: self.resourceBrokers.remove(rb) except: pass self.resourceBrokers = List.randomize(self.resourceBrokers) if self.gridEnv: self.log.info(' GridEnv: ', self.gridEnv) if self.resourceBrokers: self.log.info(' ResourceBrokers:', ', '.join(self.resourceBrokers))