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
Exemple #2
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
    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
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()
Exemple #5
0
    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
Exemple #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
Exemple #7
0
 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
Exemple #8
0
    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
Exemple #9
0
    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
Exemple #10
0
    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
Exemple #11
0
    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
Exemple #12
0
    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