diff options
author | akhilbatra898 <akhil.batra@research.iiit.ac.in> | 2017-07-25 03:30:18 +0530 |
---|---|---|
committer | Akhil Batra <akhil.batra@research.iiit.ac.in> | 2017-07-25 02:03:23 +0000 |
commit | 971df12c95bfa17459d042857e5200f4a7f60cd4 (patch) | |
tree | d75610f678ed9c40ac7b63e88143e35fc52ccc07 /qtip/web/bench/utils.py | |
parent | 05ed8bbe8a4e3c6092152382fdb42e33fd3841a2 (diff) |
Implement benchmark running and logging the output
- Run benchmark by adding new tasks
- Modify Task model to have log as log files
- Add new urls for respective views
- Module for running benchmarks in background
- Updating status of tasks
- Listing and detailed log of all tasks
- Add corresponding html templates
Change-Id: I244d1bb74949eeb470c738363f6917191e0f052d
Signed-off-by: akhilbatra898 <akhil.batra@research.iiit.ac.in>
Diffstat (limited to 'qtip/web/bench/utils.py')
-rw-r--r-- | qtip/web/bench/utils.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/qtip/web/bench/utils.py b/qtip/web/bench/utils.py new file mode 100644 index 00000000..aac388e0 --- /dev/null +++ b/qtip/web/bench/utils.py @@ -0,0 +1,27 @@ +############################################################################## +# Copyright (c) 2017 akhil.batra@research.iiit.ac.in and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import os +from subprocess import Popen, PIPE, STDOUT +import shutil + + +def run(repo): + if os.path.exists(repo.name): + shutil.rmtree(repo.name) + os.mkdir(repo.name) + os.chdir(repo.name) + output = Popen(("git clone %s ." % repo.git_link).split(), stdout=PIPE, stderr=STDOUT) + for line in output.stdout: + yield line + output.wait() + output = Popen("ansible-playbook run.yml".split(), stdout=PIPE, stderr=STDOUT) + for line in output.stdout: + yield line + os.chdir("../") |