def runbench(bench): jid = multyvac.shell_submit( "/bin/bash {}/run.sh {}".format(scripts_vol.mount_path, bench), _name='bench1', _core='f2', _layer=args.layer, _vol=[args.scripts_volume, args.results_volume]) return multyvac.get(jid)
"cmd": 'echo "success" > /tmp/out', "_result_source": "file:/tmp/out", }, "stdin": { "cmd": 'cat', "_stdin": "success", }, } longest = 0 for name in jobs.keys(): if len(name) > longest: longest = len(name) success = 0 failure = 0 for (name, kwargs) in jobs.items(): jid = multyvac.shell_submit(**kwargs) print("{:<{}}: job {} ...".format(name, longest, jid), end='') result = multyvac.get(jid).get_result().strip('\n') print(" result [{}]".format(result)) if result == "success": success += 1 else: failure += 1 print("{} pass / {} fail".format(success, failure)) if failure > 0: sys.exit(1)