コード例 #1
0
ファイル: ProdMgrRetrieve.py プロジェクト: ticoann/WMCore
def getRequest(requestId):
    """
    _getRequest_

    Get the full details of the request to be passed to the PM.

    Includes
    - All basic request information from DB
    - Teams the request has been assigned to
    - Priority per assigned team
    - URL to download the workflow spec from

    TODO: Add download URL for the workflow spec.
          Follow up with FVL what needs to be added here

    """


    request = GetRequest.getRequest(requestId)
    assigned = GetRequest.getRequestAssignments(requestId)

    for team in assigned:
        team['TeamPriority'] += request['RequestPriority']
    request['Assignments'] = assigned


    return request
コード例 #2
0
def getRequest(requestId):
    """
    _getRequest_

    Get the full details of the request to be passed to the PM.

    Includes
    - All basic request information from DB
    - Teams the request has been assigned to
    - Priority per assigned team
    - URL to download the workflow spec from

    TODO: Add download URL for the workflow spec.
          Follow up with FVL what needs to be added here

    """

    request = GetRequest.getRequest(requestId)
    assigned = GetRequest.getRequestAssignments(requestId)

    for team in assigned:
        team['TeamPriority'] += request['RequestPriority']
    request['Assignments'] = assigned

    return request
コード例 #3
0
def requestsWithStatus(status):
    requestIds = theseIds = ListRequests.listRequestsByStatus(status).values()
    requests = []
    for requestId in requestIds:
        request = GetRequest.getRequest(requestId)
        request = prepareForTable(request)
        requests.append(request)
    return requests
コード例 #4
0
ファイル: ReqMgrWebTools.py プロジェクト: stuartw/WMCore
def requestsWithStatus(status):
    requestIds = theseIds = ListRequests.listRequestsByStatus(status).values()
    requests = []
    for requestId in requestIds:
        request = GetRequest.getRequest(requestId)
        request = prepareForTable(request)
        requests.append(request)
    return requests
コード例 #5
0
 def getMostRecentOutputForPrepID(self, prepID):
     """Return the datasets produced by the most recently submitted request with this prep ID"""
     requestIDs = GetRequest.getRequestByPrepID(prepID)
     # most recent will have the largest ID
     requestID = max(requestIDs)
     request = GetRequest.getRequest(requestID)
     helper = Utilities.loadWorkload(request)
     return helper.listOutputDatasets()
コード例 #6
0
ファイル: ReqMgrRESTModel.py プロジェクト: AndrewLevin/WMCore
 def getOutputForPrepID(self, prepID):
     """Return the datasets produced by this prep ID. in a dict of requestName:dataset list"""
     requestIDs = GetRequest.getRequestByPrepID(prepID)
     result = {}
     for requestID in requestIDs:
         request = GetRequest.getRequest(requestID)
         requestName = request["RequestName"]
         helper = Utilities.loadWorkload(request)
         result[requestName] =  helper.listOutputDatasets()
     return result
コード例 #7
0
 def getOutputForPrepID(self, prepID):
     """Return the datasets produced by this prep ID. in a dict of requestName:dataset list"""
     requestIDs = GetRequest.getRequestByPrepID(prepID)
     result = {}
     for requestID in requestIDs:
         request = GetRequest.getRequest(requestID)
         requestName = request["RequestName"]
         helper = Utilities.loadWorkload(request)
         result[requestName] = helper.listOutputDatasets()
     return result
コード例 #8
0
ファイル: ReqMgrRESTModel.py プロジェクト: AndrewLevin/WMCore
 def getAssignment(self, teamName=None, request=None):
     """ If a team name is passed in, get all assignments for that team.
     If a request is passed in, return a list of teams the request is
     assigned to
     """
     # better to use ReqMgr/RequestDB/Interface/ProdSystem/ProdMgrRetrieve?
     #requestIDs = ProdMgrRetrieve.findAssignedRequests(teamName)
     # Maybe now assigned to team is same as assigned to ProdMgr
     result = []
     if teamName != None:
         requestIDs = ListRequests.listRequestsByTeam(teamName, "assigned").values()
         requests = [GetRequest.getRequest(reqID) for reqID in requestIDs]
         # put highest priorities first
         requests.sort(key=lambda r: r['RequestPriority'], reverse=True)
         # return list of tuples, since we need sorting
         result = [[req['RequestName'], req['RequestWorkflow']] for req in requests]
     elif request != None:
         result = GetRequest.getAssignmentsByName(request)
     return result
コード例 #9
0
ファイル: ReqMgrRESTModel.py プロジェクト: prozober/WMCore
 def getAssignment(self, teamName=None, request=None):
     """ If a team name is passed in, get all assignments for that team.
     If a request is passed in, return a list of teams the request is
     assigned to
     """
     # better to use ReqMgr/RequestDB/Interface/ProdSystem/ProdMgrRetrieve?
     #requestIDs = ProdMgrRetrieve.findAssignedRequests(teamName)
     # Maybe now assigned to team is same as assigned to ProdMgr
     result = []
     if teamName != None:
         requestIDs = ListRequests.listRequestsByTeam(teamName, "assigned").values()
         requests = [GetRequest.getRequest(reqID) for reqID in requestIDs]
         # put highest priorities first
         requests.sort(key=lambda r: r['RequestPriority'], reverse=True)
         # return list of tuples, since we need sorting
         result = [[req['RequestName'], req['RequestWorkflow']] for req in requests]
     elif request != None:
         result = GetRequest.getAssignmentsByName(request)
     return result
コード例 #10
0
    def getMostRecentOutputForPrepID(self, prepID):
        """Return the datasets produced by the most recently submitted request with this prep ID"""
        requestIDs = sorted(GetRequest.getRequestByPrepID(prepID))
        # most recent will have the largest ID
        requestIDs.reverse()

        request = None
        # Go through each request in order from largest to smallest
        # looking for the first non-failed/non-canceled request
        for requestID in requestIDs:
            request = GetRequest.getRequest(requestID)
            rejectList = ['aborted', 'failed', 'rejected', 'epic-failed']
            requestStatus = request.get("RequestStatus", 'aborted').lower()
            if requestStatus not in rejectList:
                break

        if request != None:
            helper = Utilities.loadWorkload(request)
            return helper.listOutputDatasets()
        else:
            return []
コード例 #11
0
    def getMostRecentOutputForPrepID(self, prepID):
        """Return the datasets produced by the most recently submitted request with this prep ID"""
        requestIDs = sorted(GetRequest.getRequestByPrepID(prepID))
        # most recent will have the largest ID
        requestIDs.reverse()

        request = None
        # Go through each request in order from largest to smallest
        # looking for the first non-failed/non-canceled request
        for requestID in requestIDs:
            request = GetRequest.getRequest(requestID)
            rejectList = ['aborted', 'failed', 'rejected', 'epic-failed']
            requestStatus = request.get("RequestStatus", 'aborted').lower()
            if requestStatus not in rejectList:
                break

        if request != None:
            helper = Utilities.loadWorkload(request)
            return helper.listOutputDatasets()
        else:
            return []