mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-04-20 17:50:49 +01:00
Updating result object to track their output directories.
Also, context.result will no result in context.run_result when not executing a job.
This commit is contained in:
parent
8e340e456d
commit
5bf9f05c4b
@ -133,7 +133,7 @@ class ExecutionContext(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def result(self):
|
def result(self):
|
||||||
return getattr(self.current_job, 'result', None)
|
return getattr(self.current_job, 'result', self.run_result)
|
||||||
|
|
||||||
def __init__(self, device, config):
|
def __init__(self, device, config):
|
||||||
self.device = device
|
self.device = device
|
||||||
@ -172,17 +172,18 @@ class ExecutionContext(object):
|
|||||||
self.output_directory = self.run_output_directory
|
self.output_directory = self.run_output_directory
|
||||||
self.resolver = ResourceResolver(self.config)
|
self.resolver = ResourceResolver(self.config)
|
||||||
self.run_info = RunInfo(self.config)
|
self.run_info = RunInfo(self.config)
|
||||||
self.run_result = RunResult(self.run_info)
|
self.run_result = RunResult(self.run_info, self.run_output_directory)
|
||||||
|
|
||||||
def next_job(self, job):
|
def next_job(self, job):
|
||||||
"""Invoked by the runner when starting a new iteration of workload execution."""
|
"""Invoked by the runner when starting a new iteration of workload execution."""
|
||||||
self.current_job = job
|
self.current_job = job
|
||||||
self.job_iteration_counts[self.spec.id] += 1
|
self.job_iteration_counts[self.spec.id] += 1
|
||||||
self.current_job.result.iteration = self.current_iteration
|
|
||||||
if not self.aborted:
|
if not self.aborted:
|
||||||
outdir_name = '_'.join(map(str, [self.spec.label, self.spec.id, self.current_iteration]))
|
outdir_name = '_'.join(map(str, [self.spec.label, self.spec.id, self.current_iteration]))
|
||||||
self.output_directory = _d(os.path.join(self.run_output_directory, outdir_name))
|
self.output_directory = _d(os.path.join(self.run_output_directory, outdir_name))
|
||||||
self.iteration_artifacts = [wa for wa in self.workload.artifacts]
|
self.iteration_artifacts = [wa for wa in self.workload.artifacts]
|
||||||
|
self.current_job.result.iteration = self.current_iteration
|
||||||
|
self.current_job.result.output_directory = self.output_directory
|
||||||
|
|
||||||
def end_job(self):
|
def end_job(self):
|
||||||
if self.current_job.result.status == IterationResult.ABORTED:
|
if self.current_job.result.status == IterationResult.ABORTED:
|
||||||
|
@ -191,12 +191,13 @@ class RunResult(object):
|
|||||||
else:
|
else:
|
||||||
return self.UNKNOWN # should never happen
|
return self.UNKNOWN # should never happen
|
||||||
|
|
||||||
def __init__(self, run_info):
|
def __init__(self, run_info, output_directory=None):
|
||||||
self.info = run_info
|
self.info = run_info
|
||||||
self.iteration_results = []
|
self.iteration_results = []
|
||||||
self.artifacts = []
|
self.artifacts = []
|
||||||
self.events = []
|
self.events = []
|
||||||
self.non_iteration_errors = False
|
self.non_iteration_errors = False
|
||||||
|
self.output_directory = output_directory
|
||||||
|
|
||||||
|
|
||||||
class RunEvent(object):
|
class RunEvent(object):
|
||||||
@ -255,6 +256,7 @@ class IterationResult(object):
|
|||||||
self.workload = spec.workload
|
self.workload = spec.workload
|
||||||
self.iteration = None
|
self.iteration = None
|
||||||
self.status = self.NOT_STARTED
|
self.status = self.NOT_STARTED
|
||||||
|
self.output_directory = None
|
||||||
self.events = []
|
self.events = []
|
||||||
self.metrics = []
|
self.metrics = []
|
||||||
self.artifacts = []
|
self.artifacts = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user