Exemple #1
0
def find_builds(oldid, newid):
    """

    :param oldid: The id to start from
    :param newid: The id to end
    :return: None
    """
    koji_session = koji.ClientSession("http://koji.fedoraproject.org/kojihub/")

    config = get_redis_config()
    jobqueue = Queue('jobqueue', config)
    jobqueue.connect()

    for i in range(oldid, newid + 1):
        build_rpms = koji_session.listBuildRPMs(i)
        if build_rpms:
            r1 = build_rpms[0]
            release = r1['release'].split('.')[-1]
            if release == 'el5':
                continue
            print i, release  # Enqueue the job here.
            info = {
                'build_id': i,
                'instance': 'primary',
                'release': release,
            }

            task = Task(info)
            enqueue(task)
        else:
            print "Missing: ", i
Exemple #2
0
import darkimporter.utils as utils
from darkimporter import libimporter
from darkimporter.libimporter import do_buildid_import
from darkimporter.libimporter import create_rundir, log_status
from darkimporter.libimporter import remove_redis_keys, get_redis_config
from darkimporter.utils import log
from retask.queue import Queue
from retask.task import Task

                

if __name__ == '__main__':
    libimporter.loadconfig()
    create_rundir()
    key = 'darkjobworker'
    config = get_redis_config()
    jobqueue = Queue('jobqueue', config)
    jobqueue.connect()
    log_status('darkjobworker', 'Starting worker module')
    while True:

        if jobqueue.length == 0:
            log(key, "Sleeping, no jobqueue job", 'info')
            time.sleep(60)
            continue
        try:
            task = jobqueue.dequeue()
            if not task:
                continue
            instance = task.data['instance']
            idx = task.data['build_id']
Exemple #3
0
import logging

import darkimporter.utils as utils
from darkimporter import libimporter
from darkimporter.libimporter import do_buildid_import
from darkimporter.libimporter import create_rundir, log_status
from darkimporter.libimporter import remove_redis_keys, get_redis_config
from darkimporter.utils import log
from retask.queue import Queue
from retask.task import Task

if __name__ == '__main__':
    libimporter.loadconfig()
    create_rundir()
    key = 'darkjobworker'
    config = get_redis_config()
    jobqueue = Queue('jobqueue', config)
    jobqueue.connect()
    log_status('darkjobworker', 'Starting worker module')
    while True:

        if jobqueue.length == 0:
            log(key, "Sleeping, no jobqueue job", 'info')
            time.sleep(60)
            continue
        try:
            task = jobqueue.dequeue()
            if not task:
                continue
            instance = task.data['instance']
            idx = task.data['build_id']