def buildWorkload(self, originalRequestURL, arguments): """ _buildWorkload_ Build a resubmission workload from a previous workload, it loads the workload and truncates it. """ helper = WMWorkloadHelper() helper.loadSpecFromCouch(originalRequestURL, self.originalRequestName) helper.truncate(self.workloadName, self.initialTaskPath, self.acdcServer, self.acdcDatabase, self.collectionName) helper.ignoreOutputModules(self.ignoredOutputModules) # override a couple of parameters, if provided by user if 'Memory' in arguments: helper.setMemory(arguments['Memory']) if 'Campaign' in arguments and not helper.getCampaign(): helper.setCampaign(arguments["Campaign"]) if 'RequestPriority' in arguments: helper.setPriority(arguments["RequestPriority"]) if 'TimePerEvent' in arguments: for task in helper.taskIterator(): task.setJobResourceInformation(timePerEvent=arguments["TimePerEvent"]) return helper
def buildWorkload(self, arguments): """ _buildWorkload_ Build a resubmission workload from a previous workload, it loads the workload and truncates it. """ helper = WMWorkloadHelper() # where to find the original spec file originalRequestURL = "%s/%s" % (arguments['CouchURL'], arguments['CouchWorkloadDBName']) helper.loadSpecFromCouch(originalRequestURL, self.originalRequestName) helper.truncate(self.workloadName, self.initialTaskPath, self.acdcServer, self.acdcDatabase, self.collectionName) helper.ignoreOutputModules(self.ignoredOutputModules) # override a couple of parameters, if provided by user if 'RequestPriority' in arguments: helper.setPriority(arguments["RequestPriority"]) if arguments['OriginalRequestType'] != 'TaskChain' or isinstance(arguments['Memory'], dict): helper.setMemory(arguments['Memory']) helper.setupPerformanceMonitoring(softTimeout=arguments.get("SoftTimeout"), gracePeriod=arguments.get("GracePeriod")) if arguments['OriginalRequestType'] != 'TaskChain' or isinstance(arguments['Multicore'], dict): helper.setCoresAndStreams(arguments['Multicore'], arguments.get("EventStreams", 0)) if arguments['OriginalRequestType'] != 'TaskChain' or isinstance(arguments.get('TimePerEvent'), dict): helper.setTimePerEvent(arguments.get("TimePerEvent")) return helper
def buildWorkload(self, arguments): """ _buildWorkload_ Build a resubmission workload from a previous workload, it loads the workload and truncates it. """ helper = WMWorkloadHelper() # where to find the original spec file originalRequestURL = "%s/%s" % (arguments['CouchURL'], arguments['CouchWorkloadDBName']) helper.loadSpecFromCouch(originalRequestURL, self.originalRequestName) helper.truncate(self.workloadName, self.initialTaskPath, self.acdcServer, self.acdcDatabase, self.collectionName) helper.ignoreOutputModules(self.ignoredOutputModules) # override a couple of parameters, if provided by user # Note that if it was provided by the user, then it's already part of the arguments too if "RequestPriority" in self.userArgs: helper.setPriority(arguments["RequestPriority"]) if "Memory" in self.userArgs: helper.setMemory(arguments["Memory"]) if "Multicore" in self.userArgs or "EventStreams" in self.userArgs: self.setCoresAndStreams(helper, arguments) if "TimePerEvent" in self.userArgs: helper.setTimePerEvent(arguments.get("TimePerEvent")) return helper
def buildWorkload(self, arguments): """ _buildWorkload_ Build a resubmission workload from a previous workload, it loads the workload and truncates it. """ helper = WMWorkloadHelper() # where to find the original spec file originalRequestURL = "%s/%s" % (arguments['CouchURL'], arguments['CouchWorkloadDBName']) helper.loadSpecFromCouch(originalRequestURL, self.originalRequestName) helper.truncate(self.workloadName, self.initialTaskPath, self.acdcServer, self.acdcDatabase, self.collectionName) helper.ignoreOutputModules(self.ignoredOutputModules) # override a couple of parameters, if provided by user if 'Memory' in arguments: helper.setMemory(arguments['Memory']) if 'Campaign' in arguments and not helper.getCampaign(): helper.setCampaign(arguments["Campaign"]) if 'RequestPriority' in arguments: helper.setPriority(arguments["RequestPriority"]) if 'TimePerEvent' in arguments: for task in helper.taskIterator(): task.setJobResourceInformation( timePerEvent=arguments["TimePerEvent"]) return helper
def buildWorkload(self, originalRequestURL): """ _buildWorkload_ Build a resubmission workload from a previous workload, it loads the workload and truncates it. """ #TODO remove the dependency on reqmgr1 if originalRequestURL == None: # reqmgr1 call (Due to reqmgr2 dependency imports here from WMCore.HTTPFrontEnd.RequestManager.ReqMgrWebTools import loadWorkload from WMCore.RequestManager.RequestDB.Interface.Request.GetRequest import getRequestByName originalRequest = getRequestByName(self.originalRequestName) helper = loadWorkload(originalRequest) else: # reqmgr2 call helper = WMWorkloadHelper() helper.loadSpecFromCouch(originalRequestURL, self.originalRequestName) helper.truncate(self.workloadName, self.initialTaskPath, self.acdcServer, self.acdcDatabase, self.collectionName) helper.ignoreOutputModules(self.ignoredOutputModules) return helper
def buildWorkload(self, originalRequestURL): """ _buildWorkload_ Build a resubmission workload from a previous workload, it loads the workload and truncates it. """ # TODO remove the dependency on reqmgr1 if originalRequestURL == None: # reqmgr1 call (Due to reqmgr2 dependency imports here from WMCore.HTTPFrontEnd.RequestManager.ReqMgrWebTools import loadWorkload from WMCore.RequestManager.RequestDB.Interface.Request.GetRequest import getRequestByName originalRequest = getRequestByName(self.originalRequestName) helper = loadWorkload(originalRequest) else: # reqmgr2 call helper = WMWorkloadHelper() helper.loadSpecFromCouch(originalRequestURL, self.originalRequestName) helper.truncate( self.workloadName, self.initialTaskPath, self.acdcServer, self.acdcDatabase, self.collectionName ) helper.ignoreOutputModules(self.ignoredOutputModules) return helper
def buildWorkload(self, arguments): """ _buildWorkload_ Build a resubmission workload from a previous workload, it loads the workload and truncates it. """ helper = WMWorkloadHelper() # where to find the original spec file originalRequestURL = "%s/%s" % (arguments['CouchURL'], arguments['CouchWorkloadDBName']) helper.loadSpecFromCouch(originalRequestURL, self.originalRequestName) helper.truncate(self.workloadName, self.initialTaskPath, self.acdcServer, self.acdcDatabase, self.collectionName) helper.ignoreOutputModules(self.ignoredOutputModules) # override a couple of parameters, if provided by user if 'RequestPriority' in arguments: helper.setPriority(arguments["RequestPriority"]) if arguments['OriginalRequestType'] != 'TaskChain' or isinstance(arguments['Memory'], dict): helper.setMemory(arguments['Memory']) if arguments['OriginalRequestType'] != 'TaskChain' or isinstance(arguments.get('TimePerEvent'), dict): helper.setTimePerEvent(arguments.get("TimePerEvent")) return helper
def buildWorkload(self, originalRequestURL, arguments): """ _buildWorkload_ Build a resubmission workload from a previous workload, it loads the workload and truncates it. """ #TODO remove the dependency on reqmgr1 if originalRequestURL == None: # reqmgr1 call (Due to reqmgr2 dependency imports here from WMCore.HTTPFrontEnd.RequestManager.ReqMgrWebTools import loadWorkload from WMCore.RequestManager.RequestDB.Interface.Request.GetRequest import getRequestByName originalRequest = getRequestByName(self.originalRequestName) helper = loadWorkload(originalRequest) else: # reqmgr2 call helper = WMWorkloadHelper() helper.loadSpecFromCouch(originalRequestURL, self.originalRequestName) helper.truncate(self.workloadName, self.initialTaskPath, self.acdcServer, self.acdcDatabase, self.collectionName) helper.ignoreOutputModules(self.ignoredOutputModules) # override a couple of parameters, if provided by user if 'Memory' in arguments: helper.setMemory(arguments['Memory']) if 'Campaign' in arguments and not helper.getCampaign(): helper.setCampaign(arguments["Campaign"]) if 'RequestPriority' in arguments: helper.setPriority(arguments["RequestPriority"]) if 'TimePerEvent' in arguments: for task in helper.taskIterator(): task.setJobResourceInformation( timePerEvent=arguments["TimePerEvent"]) return helper
def buildWorkload(self, originalRequestURL, arguments): """ _buildWorkload_ Build a resubmission workload from a previous workload, it loads the workload and truncates it. """ #TODO remove the dependency on reqmgr1 if originalRequestURL == None: # reqmgr1 call (Due to reqmgr2 dependency imports here from WMCore.HTTPFrontEnd.RequestManager.ReqMgrWebTools import loadWorkload from WMCore.RequestManager.RequestDB.Interface.Request.GetRequest import getRequestByName originalRequest = getRequestByName(self.originalRequestName) helper = loadWorkload(originalRequest) else: # reqmgr2 call helper = WMWorkloadHelper() helper.loadSpecFromCouch(originalRequestURL, self.originalRequestName) helper.truncate(self.workloadName, self.initialTaskPath, self.acdcServer, self.acdcDatabase, self.collectionName) helper.ignoreOutputModules(self.ignoredOutputModules) # override a couple of parameters, if provided by user if 'Memory' in arguments: helper.setMemory(arguments['Memory']) if 'Campaign' in arguments and not helper.getCampaign(): helper.setCampaign(arguments["Campaign"]) if 'RequestPriority' in arguments: helper.setPriority(arguments["RequestPriority"]) if 'TimePerEvent' in arguments: for task in helper.taskIterator(): task.setJobResourceInformation(timePerEvent=arguments["TimePerEvent"]) return helper