コード例 #1
0
    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
コード例 #2
0
ファイル: Resubmission.py プロジェクト: tsarangi/WMCore
    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
コード例 #3
0
ファイル: ResubmissionRequest.py プロジェクト: stuartw/WMCore
    def makeWorkload(self, schema):
        originalRequest = GetRequest.getRequestByName(schema['OriginalRequestName'])
        helper = loadWorkload(originalRequest)
        helper.truncate(schema["RequestName"], schema["InitialTaskPath"],
                        schema["ACDCServer"], schema["ACDCDatabase"])

        return helper.data
コード例 #4
0
def main():
    parser = OptionParser()
    parser.add_option("-f", "--input-list", dest="acdcList")
    parser.add_option("-o", "--output", dest="outputFile")

    (options, _) = parser.parse_args()
    
    handle = open(options.acdcList, 'r')
    lines = handle.read()
    
    outputList = []
    for line in lines.splitlines():
        request = {'RequestWorkflow' : 'https://cmsweb.cern.ch/couchdb/reqmgr_workload_cache/%s/spec' % line}
        workload = loadWorkload(request)
        topLevelTask =  workload.getTopLevelTask()
        taskInput = topLevelTask[0].inputReference()
        owner = taskInput.splitting.owner
        group = taskInput.splitting.group
        collection_name = taskInput.acdc.collection
        fileset_name = taskInput.acdc.fileset
        originalOwner = workload.getOwner()
        outputList.append({'owner' : owner, 'group' : group, 
                           'collection_name' : collection_name,
                           'fileset_name' : fileset_name,
                           'original_dn' : originalOwner['dn']})
    handle.close()
    
    handle = open(options.outputFile, 'w')
    json.dump(outputList, handle)
    handle.close()
コード例 #5
0
ファイル: Resubmission.py プロジェクト: stuartw/WMCore
    def __call__(self, workloadName, arguments):

        requestName     = arguments['OriginalRequestName']
        originalRequest = GetRequest.getRequestByName(requestName)
        helper = loadWorkload(originalRequest)
        helper.truncate(arguments["RequestName"], arguments["InitialTaskPath"],
                        arguments["ACDCServer"], arguments["ACDCDatabase"])
        return helper
コード例 #6
0
    def makeWorkload(self, schema):
        originalRequest = GetRequest.getRequestByName(
            schema['OriginalRequestName'])
        helper = loadWorkload(originalRequest)
        helper.truncate(schema["RequestName"], schema["InitialTaskPath"],
                        schema["ACDCServer"], schema["ACDCDatabase"])

        return helper.data
コード例 #7
0
ファイル: Resubmission.py プロジェクト: cinquo/WMCore
 def __call__(self, workloadName, arguments):
     requestName = arguments['OriginalRequestName']
     originalRequest = GetRequest.getRequestByName(requestName)
     helper = loadWorkload(originalRequest)
     helper.truncate(arguments["RequestName"], arguments["InitialTaskPath"],
                     arguments["ACDCServer"], arguments["ACDCDatabase"],
                     arguments.get("CollectionName"))
     helper.ignoreOutputModules(arguments.get("IgnoredOutputModules", []))
     return helper
コード例 #8
0
ファイル: Resubmission.py プロジェクト: ticoann/WMCore
    def __call__(self, workloadName, arguments):

        requestName = arguments['OriginalRequestName']
        originalRequest = GetRequest.getRequestByName(requestName)
        helper = loadWorkload(originalRequest)
        helper.truncate(arguments["RequestName"], arguments["InitialTaskPath"],
                        arguments["ACDCServer"], arguments["ACDCDatabase"],
                        arguments.get("CollectionName"))
        helper.ignoreOutputModules(arguments.get("IgnoredOutputModules", []))
        return helper
コード例 #9
0
ファイル: Resubmission.py プロジェクト: AndrewLevin/WMCore
    def buildWorkload(self):
        """
        _buildWorkload_

        Build a resubmission workload from a previous
        workload, it loads the workload and truncates it.
        """
        originalRequest = getRequestByName(self.originalRequestName)
        helper = loadWorkload(originalRequest)
        helper.truncate(self.requestName, self.initialTaskPath,
                        self.acdcServer, self.acdcDatabase,
                        self.collectionName)
        helper.ignoreOutputModules(self.ignoredOutputModules)

        return helper
コード例 #10
0
ファイル: Resubmission.py プロジェクト: samircury/WMCore
    def buildWorkload(self):
        """
        _buildWorkload_

        Build a resubmission workload from a previous
        workload, it loads the workload and truncates it.
        """
        originalRequest = getRequestByName(self.originalRequestName)
        helper = loadWorkload(originalRequest)
        helper.truncate(self.requestName, self.initialTaskPath,
                        self.acdcServer, self.acdcDatabase,
                        self.collectionName)
        helper.ignoreOutputModules(self.ignoredOutputModules)

        return helper
コード例 #11
0
ファイル: Resubmission.py プロジェクト: johnhcasallasl/WMCore
    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
コード例 #12
0
ファイル: Resubmission.py プロジェクト: BrunoCoimbra/WMCore
    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