예제 #1
0
def test_get_formated_jobid():
    """
    Test formated job id
    """
    pack = {}
    choices = ["spec","module","method"]
    for choice in choices:
        gw=generate_word(choice,4)
        pack[choice] = gw

    get_formated_jobid(**pack)
예제 #2
0
def test_get_formated_jobid():
    """
    Test formated job id
    """
    pack = {}
    choices = ["spec", "module", "method"]
    for choice in choices:
        gw = generate_word(choice, 4)
        pack[choice] = gw

    get_formated_jobid(**pack)
예제 #3
0
 def create_new_jobid(self):
     """
     Generating an old id
     """
     pack = {}
     choices = ["spec","module","method"]
     for choice in choices:
         #the stres words :)
         gw=generate_word(choice,4)
         pack[choice] = gw
         
     return get_formated_jobid(**pack)
예제 #4
0
    def create_new_jobid(self):
        """
        Generating an old id
        """
        pack = {}
        choices = ["spec", "module", "method"]
        for choice in choices:
            #the stres words :)
            gw = generate_word(choice, 4)
            pack[choice] = gw

        return get_formated_jobid(**pack)
예제 #5
0
파일: jobthing.py 프로젝트: lkeijser/func
def batch_run(pool, callback, nforks,**extra_args):
    """
    This is the method used by the overlord side usage of jobthing.
    Minion side usage will use minion_async_run instead.

    Given an array of items (pool), call callback in each one, but divide
    the workload over nfork forks.  Temporary files used during the
    operation will be created in cachedir and subsequently deleted.    
    """
   
    job_id = utils.get_formated_jobid(**extra_args)
    
    __update_status(job_id, JOB_ID_RUNNING, -1)
    pid = os.fork()
    if pid != 0:
        return job_id
    else:
        # kick off the job
        results = forkbomb.batch_run(pool, callback, nforks)
        
        # write job IDs to the state file on overlord 
        __update_status(job_id, JOB_ID_PARTIAL, results)
        # we now have a list of job id's for each minion, kill the task
        os._exit(0)
예제 #6
0
def batch_run(pool, callback, nforks, **extra_args):
    """
    This is the method used by the overlord side usage of jobthing.
    Minion side usage will use minion_async_run instead.

    Given an array of items (pool), call callback in each one, but divide
    the workload over nfork forks.  Temporary files used during the
    operation will be created in cachedir and subsequently deleted.
    """

    job_id = utils.get_formated_jobid(**extra_args)

    __update_status(job_id, JOB_ID_RUNNING, -1)
    pid = os.fork()
    if pid != 0:
        return job_id
    else:
        # kick off the job
        results = forkbomb.batch_run(pool, callback, nforks)

        # write job IDs to the state file on overlord
        __update_status(job_id, JOB_ID_PARTIAL, results)
        # we now have a list of job id's for each minion, kill the task
        os._exit(0)