diff options
author | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2014-04-01 17:33:17 +0100 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2014-04-01 17:33:17 +0100 |
commit | 2d97f2b19dcbc345996fed1d0c9bee170ef3064e (patch) | |
tree | 84445c93ddcbf08360aa9615456a19f5cba4f2ec | |
parent | 1ba8678718febddd477ef65e57974aa115d12bd6 (diff) |
created helper script for creating LAVA job definitions
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
-rw-r--r-- | create-jobs.py | 203 |
1 files changed, 203 insertions, 0 deletions
diff --git a/create-jobs.py b/create-jobs.py new file mode 100644 index 0000000..5a6d944 --- /dev/null +++ b/create-jobs.py @@ -0,0 +1,203 @@ +import json +from copy import deepcopy +from pprint import pprint + +SIGNAL_PREFIX = "SIGNAL_PREFIX" +MODE = "MODE" +JOB_NAME = "JOB_NAME" +AGENDA = "AGENDA" +PARAMETERS = "parameters" +TESTDEF_REPOS = "testdef_repos" +ACTIONS = "actions" + +HOST_SHELL = { + "command": "lava_test_shell", + "parameters": { + "testdef_repos": [ + { + "git-repo": "git://git.linaro.org/qa/wa2-lava.git", + "testdef": "wa2host.yaml", + "parameters": { + "AGENDA": "$WA2_AGENDA", + "JOB_NAME": "$WA2_JOB_NAME", + "MODE": "$WA2_MODE", + "SIGNAL_PREFIX": "$WA2_PREFIX" + } + } + ], + "timeout": 4200, + "role": "host" + } + } + +TARGET_SHELL = { + "command": "lava_test_shell", + "parameters": { + "testdef_repos": [ + { + "git-repo": "git://git.linaro.org/qa/wa2-lava.git", + "testdef": "wa2target.yaml", + "parameters": { + "SIGNAL_PREFIX": "$WA2_PREFIX" + } + + } + ], + "timeout": 2400, + "role": "target" + } + } + +JSON_TEMPLATE = { + "health_check": "false", + "logging_level": "INFO", + "timeout": 1800, + "job_name": "$JOB_NAME", + "device_group": [ + { + "role": "host", + "count": 1, + "device_type": "dummy-ssh" + }, + { + "role": "target", + "count": 1, + "device_type": "$DUT_TYPE" + } + ], + "actions": [ + { + "command": "dummy_deploy", + "parameters": { + "target_type": "ubuntu" + } + }, + { + "command": "deploy_linaro_android_image", + "metadata": { + "android.build": "$ANDROID_META_BUILD", + "android.name": "$ANDROID_META_NAME", + "android.url": "$ANDROID_META_URL" + }, + "parameters": { + "boot": "$ANDROID_BOOT", + "data": "$ANDROID_DATA", + "system": "$ANDROID_SYSTEM", + "role": "target" + } + } + ] +} + +SUBMIT_RESULTS = { + "command": "submit_results_on_host", + "parameters": { + "stream": "$BUNDLE_STREAM", + "server": "http://validation.linaro.org/RPC2/" + } + } + +POSTPROCESSING = { + "command": "lava_test_shell", + "parameters": { + "testdef_repos": [ + { + "git-repo": "git://git.linaro.org/qa/wa2-lava.git", + "testdef": "wa2host_postprocessing.yaml", + "parameters": { + "JOB_NAME": "$JOB_NAME" + } + } + ], + "timeout": 4200, + "role": "host" + } + } + +modes = [ + "mp_workloads", + "mp_benchmarks", + "a7only_workloads", + "a15only_workloads", + "a15only_benchmarks", +] + +agenda_mp_workloads = [ + "a7only_audio.yaml", + "a7only_bbench_audio.yaml", +] + +agenda_mp_benchmarks = [ + "hmp_andbench_t1.yaml", + "hmp_andbench_t5.yaml", + "hmp_antutu_4.0.3.yaml", + "hmp_audio.yaml", + "hmp_bbench_audio.yaml", + "hmp_benchmarkpi.yaml", + "hmp_caffeinemark.yaml", + "hmp_cfbench.yaml", + "hmp_geekbench3.yaml", + "hmp_linpack.yaml", + "hmp_quadrant.yaml", + "hmp_smartbench.yaml", + "hmp_sqlite.yaml", + "hmp_vellamo.yaml", +] + +agenda_a7only_workloads = [ + "a7only_audio.yaml", + "a7only_bbench_audio.yaml", +] + +agenda_a15only_workloads = [ + "a15only_audio.yaml", + "a15only_bbench_audio.yaml", +] + +agenda_a15only_benchmarks = [ + "a15only_andbench_t1.yaml", + "a15only_andbench_t5.yaml", + "a15only_antutu_4.0.3.yaml", + "a15only_benchmarkpi.yaml", + "a15only_caffeinemark.yaml", + "a15only_cfbench.yaml", + "a15only_geekbench3.yaml", + "a15only_linpack.yaml", + "a15only_quadrant.yaml", + "a15only_smartbench.yaml", + "a15only_sqlite.yaml", + "a15only_vellamo.yaml", +] + +for mode in modes: + if mode.split("_")[1] == "workloads": + for benchmark in globals()["agenda_" + mode]: + test_case = deepcopy(JSON_TEMPLATE) + for iteration in range(1,6): + hostshell = deepcopy(HOST_SHELL) + hostshell[PARAMETERS][TESTDEF_REPOS][0][PARAMETERS][AGENDA] = benchmark + hostshell[PARAMETERS][TESTDEF_REPOS][0][PARAMETERS][MODE] = mode.split("_")[0] + hostshell[PARAMETERS][TESTDEF_REPOS][0][PARAMETERS][SIGNAL_PREFIX] = benchmark.split(".")[0] + "-iter" + str(iteration) + targetshell = deepcopy(TARGET_SHELL) + targetshell[PARAMETERS][TESTDEF_REPOS][0][PARAMETERS][SIGNAL_PREFIX] = benchmark.split(".")[0] + "-iter" + str(iteration) + test_case[ACTIONS].append(hostshell) + test_case[ACTIONS].append(targetshell) + #pprint(test_case) + f = open("wa2_%s.json" % benchmark.split(".")[0], "w") + f.write(json.dumps(test_case, sort_keys=True, indent=4)) + f.close() + else: + for benchmark in globals()["agenda_" + mode]: + test_case = deepcopy(JSON_TEMPLATE) + hostshell = deepcopy(HOST_SHELL) + hostshell[PARAMETERS][TESTDEF_REPOS][0][PARAMETERS][AGENDA] = benchmark + hostshell[PARAMETERS][TESTDEF_REPOS][0][PARAMETERS][MODE] = mode.split("_")[0] + hostshell[PARAMETERS][TESTDEF_REPOS][0][PARAMETERS][SIGNAL_PREFIX] = benchmark.split(".")[0] + targetshell = deepcopy(TARGET_SHELL) + targetshell[PARAMETERS][TESTDEF_REPOS][0][PARAMETERS][SIGNAL_PREFIX] = benchmark.split(".")[0] + test_case[ACTIONS].append(hostshell) + test_case[ACTIONS].append(targetshell) + #pprint(test_case) + f = open("wa2_%s.json" % benchmark.split(".")[0], "w") + f.write(json.dumps(test_case, sort_keys=True, indent=4)) + f.close() |