def execute_fairplay(player, **kwargs): if player == 'bob': cmd = cmd_for_bob(**kwargs) else: cmd = cmd_for_alice(**kwargs) root = kwargs.get('root') fortune = kwargs.pop('fortune') logger = setupLogger(remote_logs_dir_F(root), DEBUG, DEBUG) logger.info('begin ~') path = rjoin(root, inject_folder_name, 'run') results_wrapper()(ubt.benchmark_wrapper()(lambda : do(cmd, fortune, path)))() logger.info('end ~')
""" Executes the injected millionaires viff program, wrapping the execution in a results wrapper, and a benchmark wrapper. ------------------------------------------------------------------------------- """ from shared_lib.collection import results_wrapper, parse_params, setupLogger, DEBUG, rjoin, remote_logs_dir_F, root, ubt import sys, subprocess if __name__ == '__main__': logger = setupLogger(remote_logs_dir_F(root), DEBUG, DEBUG) params = parse_params(sys.argv) tag = params.get('tag') cmd = 'python %s --no-ssl %s' % (rjoin(root,'inject', 'millionaires.py'), rjoin(root,'inject', tag+'.ini')) logger.info('begin ~') inner = lambda : subprocess.Popen(cmd, shell=True).wait() results_wrapper()(ubt.benchmark_wrapper()(inner))() logger.info('end ~')
def execute_deploy_1(): ''' helper method for hierarchy 1 ''' localpath = ljoin(ipath, 'viff_three_millionaires') remote_root = rjoin('test_framework', 'benchmarking_example') return deploy(localpath, remote_root)
def execute_deploy_4(): ''' helper method for hierarchy 4 ''' localpath = ljoin(ipath, 'fib') remotepath = rjoin('test_framework', 'benchmarking_example') return deploy(localpath, remotepath)
def execute_deploy_2(): ''' helper method for hierarchy 2 ''' localpath = ljoin(ipath, 'fairplay_two_millionaires') remote_root = rjoin('test_framework', 'benchmarking_example') return deploy(localpath, remote_root)