Ejemplo n.º 1
0
def getQueueList(cp):
    """
    Returns a list of all the queue names that are supported.

    @param cp: Site configuration
    @returns: List of strings containing the queue names.
    """
    queues = []
    try:
        queue_exclude = [i.strip() for i in cp.get("pbs", "queue_exclude").\
            split(',')]
    except:
        queue_exclude = []
    rvf_info = parseRvf('pbs.rvf')
    rvf_queue_list = rvf_info.get('queue', {}).get('Values', None)
    if rvf_queue_list:
        rvf_queue_list = rvf_queue_list.split()
        log.info("The RVF lists the following queues: %s." % ', '.join( \
            rvf_queue_list))
    for queue in getQueueInfo(cp):
        if rvf_queue_list and queue not in rvf_queue_list:
            continue
        if queue not in queue_exclude:
            queues.append(queue)
    return queues
Ejemplo n.º 2
0
def getQueueList(cp):
    """
    Returns a list of all the queue names that are supported.

    @param cp: Site configuration
    @returns: List of strings containing the queue names.
    """
    queues = []
    try:            
        queue_exclude = [i.strip() for i in cp.get("pbs", "queue_exclude").\
            split(',')]
    except:         
        queue_exclude = []
    rvf_info = parseRvf('pbs.rvf')
    rvf_queue_list = rvf_info.get('queue', {}).get('Values', None)
    if rvf_queue_list: 
        rvf_queue_list = rvf_queue_list.split()
        log.info("The RVF lists the following queues: %s." % ', '.join( \
            rvf_queue_list))
    for queue in getQueueInfo(cp):
        if rvf_queue_list and queue not in rvf_queue_list:
            continue
        if queue not in queue_exclude:
            queues.append(queue)
    return queues
Ejemplo n.º 3
0
def getVoQueues(cp):
    """
    Determine the (vo, queue) tuples for this site.  This allows for central
    configuration of which VOs are advertised.

    Sites will be able to blacklist queues they don't want to advertise,
    whitelist certain VOs for a particular queue, and blacklist VOs from queues.

    @param cp: Site configuration
    @returns: A list of (vo, queue) tuples representing the queues each VO
        is allowed to run in.
    """
    voMap = VoMapper(cp)
    try:
        queue_exclude = [i.strip() for i in cp.get("pbs", "queue_exclude").\
            split(',')]
    except:
        queue_exclude = []
    vo_queues = []
    queueInfo = getQueueInfo(cp)
    rvf_info = parseRvf('pbs.rvf')
    rvf_queue_list = rvf_info.get('queue', {}).get('Values', None)
    if rvf_queue_list:
        rvf_queue_list = rvf_queue_list.split()
        log.info("The RVF lists the following queues: %s." % ', '.join( \
            rvf_queue_list))
    for queue, qinfo in queueInfo.items():
        if rvf_queue_list and queue not in rvf_queue_list:
            continue
        if queue in queue_exclude:
            continue
        volist = sets.Set(voList(cp, voMap))
        try:
            whitelist = [i.strip() for i in cp.get("pbs", "%s_whitelist" % \
                queue).split(',')]
        except:
            whitelist = []
        whitelist = sets.Set(whitelist)
        try:
            blacklist = [i.strip() for i in cp.get("pbs", "%s_blacklist" % \
                queue).split(',')]
        except:
            blacklist = []
        blacklist = sets.Set(blacklist)
        if 'users' in qinfo or 'groups' in qinfo:
            acl_vos = parseAclInfo(queue, qinfo, voMap)
            volist.intersection_update(acl_vos)
        # Force any VO in the whitelist to show up in the volist, even if it
        # isn't in the acl_users / acl_groups
        for vo in whitelist:
            if vo not in volist:
                volist.add(vo)
        # Apply white and black lists
        for vo in volist:
            if (vo in blacklist or "*" in blacklist) and ((len(whitelist) == 0)\
                    or vo not in whitelist):
                continue
            vo_queues.append((vo, queue))
    return vo_queues
Ejemplo n.º 4
0
def getVoQueues(cp):
    """
    Determine the (vo, queue) tuples for this site.  This allows for central
    configuration of which VOs are advertised.

    Sites will be able to blacklist queues they don't want to advertise,
    whitelist certain VOs for a particular queue, and blacklist VOs from queues.

    @param cp: Site configuration
    @returns: A list of (vo, queue) tuples representing the queues each VO
        is allowed to run in.
    """
    voMap = VoMapper(cp)
    try:
        queue_exclude = [i.strip() for i in cp.get("pbs", "queue_exclude").\
            split(',')]
    except:
        queue_exclude = []
    vo_queues = []
    queueInfo = getQueueInfo(cp)
    rvf_info = parseRvf('pbs.rvf')
    rvf_queue_list = rvf_info.get('queue', {}).get('Values', None)
    if rvf_queue_list:
        rvf_queue_list = rvf_queue_list.split()
        log.info("The RVF lists the following queues: %s." % ', '.join( \
            rvf_queue_list))
    for queue, qinfo in queueInfo.items():
        if rvf_queue_list and queue not in rvf_queue_list:
            continue
        if queue in queue_exclude:
            continue
        volist = sets.Set(voList(cp, voMap))
        try:
            whitelist = [i.strip() for i in cp.get("pbs", "%s_whitelist" % \
                queue).split(',')]
        except:
            whitelist = []
        whitelist = sets.Set(whitelist)
        try:
            blacklist = [i.strip() for i in cp.get("pbs", "%s_blacklist" % \
                queue).split(',')]
        except:
            blacklist = []
        blacklist = sets.Set(blacklist)
        if 'users' in qinfo or 'groups' in qinfo:
            acl_vos = parseAclInfo(queue, qinfo, voMap)
            volist.intersection_update(acl_vos)
        # Force any VO in the whitelist to show up in the volist, even if it
        # isn't in the acl_users / acl_groups
        for vo in whitelist:
            if vo not in volist:
                volist.add(vo)
        # Apply white and black lists
        for vo in volist:
            if (vo in blacklist or "*" in blacklist) and ((len(whitelist) == 0)\
                    or vo not in whitelist):
                continue
            vo_queues.append((vo, queue))
    return vo_queues
Ejemplo n.º 5
0
def getVoQueues(cp):
    voMap = VoMapper(cp)
    try:
        queue_exclude = [
            i.strip() for i in cp.get("sge", "queue_exclude").split(',')
        ]
    except:
        queue_exclude = []

    # SGE has a special "waiting" queue -- ignore it.
    queue_exclude.append('waiting')

    vo_queues = []
    queue_list, q = getQueueInfo(cp)
    rvf_info = parseRvf('sge.rvf')
    rvf_queue_list = rvf_info.get('queue', {}).get('Values', None)
    if rvf_queue_list:
        rvf_queue_list = rvf_queue_list.split()
        log.info("The RVF lists the following queues: %s." % ', '.join( \
            rvf_queue_list))
    else:
        log.warning("Unable to load a RVF file for SGE.")
    for queue, qinfo in queue_list.items():
        if rvf_queue_list and queue not in rvf_queue_list:
            continue
        if queue in queue_exclude:
            continue
        volist = sets.Set(voList(cp, voMap))
        try:
            whitelist = [
                i.strip()
                for i in cp.get("sge", "%s_whitelist" % queue).split(',')
            ]
        except:
            whitelist = []
        whitelist = sets.Set(whitelist)
        try:
            blacklist = [
                i.strip()
                for i in cp.get("sge", "%s_blacklist" % queue).split(',')
            ]
        except:
            blacklist = []
        blacklist = sets.Set(blacklist)
        if 'user_list' in qinfo:
            acl_vos = parseAclInfo(queue, qinfo, voMap)
            if acl_vos:
                volist.intersection_update(acl_vos)
        for vo in volist:
            if (vo in blacklist or "*" in blacklist) and ((len(whitelist) == 0)\
                or vo not in whitelist):
                continue
            vo_queues.append((vo, queue))
    return vo_queues
Ejemplo n.º 6
0
def getVoQueues(cp):
    voMap = VoMapper(cp)
    try:
        queue_exclude = [i.strip() for i in cp.get("sge",
            "queue_exclude").split(',')]
    except:
        queue_exclude = []

    # SGE has a special "waiting" queue -- ignore it.
    queue_exclude.append('waiting')
    
    vo_queues = []
    queue_list, q = getQueueInfo(cp)
    rvf_info = parseRvf('sge.rvf')
    rvf_queue_list = rvf_info.get('queue', {}).get('Values', None)
    if rvf_queue_list:
        rvf_queue_list = rvf_queue_list.split()
        log.info("The RVF lists the following queues: %s." % ', '.join( \
            rvf_queue_list))
    else:
        log.warning("Unable to load a RVF file for SGE.")
    for queue, qinfo in queue_list.items():
        if rvf_queue_list and queue not in rvf_queue_list:
            continue
        if queue in queue_exclude:
            continue
        volist = sets.Set(voList(cp, voMap))
        try:
            whitelist = [i.strip() for i in cp.get("sge",
                "%s_whitelist" % queue).split(',')]
        except:
            whitelist = []
        whitelist = sets.Set(whitelist)
        try:
            blacklist = [i.strip() for i in cp.get("sge",
                "%s_blacklist" % queue).split(',')]
        except:
            blacklist = []
        blacklist = sets.Set(blacklist)
        if 'user_list' in qinfo:
            acl_vos = parseAclInfo(queue, qinfo, voMap)
            if acl_vos:
                volist.intersection_update(acl_vos)
        for vo in volist:
            if (vo in blacklist or "*" in blacklist) and ((len(whitelist) == 0)\
                or vo not in whitelist):
                    continue
            vo_queues.append((vo, queue))
    return vo_queues
Ejemplo n.º 7
0
def getVoQueues(queueInfo, cp):
    """
    Determine the (vo, queue) tuples for this site.  This allows for central
    configuration of which VOs are advertised.

    Sites will be able to blacklist queues they don't want to advertise,
    whitelist certain VOs for a particular queue, and blacklist VOs from queues.

    @param cp: Site configuration
    @returns: A list of (vo, queue) tuples representing the queues each VO
        is allowed to run in.
    """
    voMap = VoMapper(cp)
    try:
        queue_exclude = [i.strip() for i in cp.get("lsf", "queue_exclude").\
            split(',')]
    except:
        queue_exclude = []
    rvf_info = parseRvf('lsf.rvf')
    rvf_queue_list = rvf_info.get('queue', {}).get('Values', None)
    if rvf_queue_list:
        rvf_queue_list = rvf_queue_list.split()
        log.info("The RVF lists the following queues: %s." % ', '.join( \
            rvf_queue_list))
    vo_queues= []
    for queue in queueInfo:
        if queue in queue_exclude:
            continue
        if rvf_queue_list and queue not in rvf_queue_list:
            continue
        try:
            whitelist = [i.strip() for i in cp.get("lsf", "%s_whitelist" % \
                queue).split(',')]
        except:
            whitelist = []
        try:
            blacklist = [i.strip() for i in cp.get("lsf", "%s_blacklist" % \
                queue).split(',')]
        except:
            blacklist = []
        for vo in queueInfo[queue].get('vos', voList(cp, voMap)):
            if (vo in blacklist or "*" in blacklist) and ((len(whitelist) == 0)\
                    or vo not in whitelist):
                continue
            vo_queues.append((vo, queue))
    return vo_queues