Example #1
0
def mvac_job_rdb(args):
    import multyvac

    job_id, context, event_queue_name, show_output, volumes, \
    rdb_vol_name, rdb_db, cwd = args  

    check_isinstance(job_id, six.string_types)
    
    # Disable multyvac logging
    disable_logging_if_config(context)

    multyvac_job = mvac_job_rdb_instance(context, job_id, volumes, 
                                         rdb_vol_name, rdb_db, cwd)
    multyvac_job.wait()

    db = context.get_compmake_db()
    vol =  multyvac.volume.get(rdb_vol_name)  # @UndefinedVariable
            
    res = multyvac_job.get_result()
    result_dict_check(res)

    # is there something to download?
    stuff = ('fail' in res) or ('new_jobs' in res)
    # alternatives = bug, abort
    if stuff:
        new_jobs = res.get('new_jobs',[])
        transfer_down(db, vol, rdb_db, job_id, new_jobs)
    return res
Example #2
0
def mvac_job_rdb_worker(job_id, rdb_basepath, cwd, misc):    
    from compmake.jobs.actions import make
    rdb= StorageFilesystem(rdb_basepath)
    context = Context(rdb)
    
    if not os.path.exists(cwd):
        print('cwd %r not existing', cwd)
        os.makedirs(cwd)
    os.chdir(cwd)    
    
    try:
        res = make(job_id, context=context)
    except JobFailed as e:
        res = e.get_result_dict()
    except HostFailed as e:          
        res= e.get_result_dict()
    except CompmakeBug as e:
        res = e.get_result_dict()
    except Exception as e:
        res= CompmakeBug(str(e)).get_result_dict()
        
    result_dict_check(res)
    print('res: %r' % res)
    return res