Пример #1
0
def run(args):
    local_runner = LocalRunner(json.loads(args.config))

    workload = Workload.from_json_str(args.workload)
    instance = Instance.from_json_str(args.instance)

    print(local_runner.run(workload, instance).to_json_str())
Пример #2
0
 def from_json_str(json_str):
     data = json.loads(json_str)
     return InstanceWithRunResults(
         Instance.from_json_str(data['instance']),
         run_results=[
             RunResult(failure=bool(data['failure']),
                       elapsed_time=float(data['mean_elapsed']),
                       cost=float(data['mean_cost']),
                       container_metrics={})
         ])