From 00f3ca3e0422ef6777bf8dcc0e92fb8007ddd741 Mon Sep 17 00:00:00 2001 From: Andrew Grant Date: Mon, 11 Jun 2018 16:50:07 -0400 Subject: [PATCH] Conver profile, machine, result, and test to send to the client Matches * most * of the existing Client layout from EtherBench, barring name changes, the addition of dev/base options, the book name, the book source (Newly saved in Repo), an some extra id's to send back. --- OpenBench/utils.py | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/OpenBench/utils.py b/OpenBench/utils.py index 3575c5d..ff9f067 100644 --- a/OpenBench/utils.py +++ b/OpenBench/utils.py @@ -152,4 +152,38 @@ def getWorkload(machine): options = options[1:] def getResults(machine, test): - pass \ No newline at end of file + pass + +def workloadDictionary(profile, machine, result, test): + + # Worker will send back the id of each model for ease of + # updating. Worker needs test information, as well as the + # specification for both engines. Group the dev and base + # options with the coressponding engine, for easy usage + return { + 'profile' : { 'id' : profile.id, }, + 'machine' : { 'id' : machine.id, }, + 'result' : { 'id' : result.id, }, + 'test' : { + 'id' : test.id, + 'bookname' : test.bookname, + 'booksource' : FRAMEWORK_REPO_URL + '/raw/master/Books/' + 'timecontrol' : test.timecontrol, + 'dev' : { + 'name' : test.dev.name, + 'source' : test.dev.source, + 'protocol' : test.dev.protocol, + 'sha' : test.dev.sha, + 'bench' : test.dev.bench, + 'options' : test.devoptions, + }, + 'base' : { + 'name' : test.base.name, + 'source' : test.base.source, + 'protocol' : test.base.protocol, + 'sha' : test.base.sha, + 'bench' : test.base.bench, + 'options' : test.base.baseoptions, + }, + }, + }