mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 20:11:20 +00:00
Job output dir handling.
This commit is contained in:
parent
011fd684bd
commit
547ae1c10e
@ -927,7 +927,11 @@ class JobSpec(Configuration):
|
|||||||
self.runtime_parameters = target_manager.merge_runtime_parameters(runtime_parameters)
|
self.runtime_parameters = target_manager.merge_runtime_parameters(runtime_parameters)
|
||||||
|
|
||||||
def finalize(self):
|
def finalize(self):
|
||||||
self.id = "-".join([source.config['id'] for source in self._sources[1:]]) # ignore first id, "global"
|
self.id = "-".join([source.config['id']
|
||||||
|
for source in self._sources[1:]]) # ignore first id, "global"
|
||||||
|
if self.label is None:
|
||||||
|
self.label = self.workload_name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# This is used to construct the list of Jobs WA will run
|
# This is used to construct the list of Jobs WA will run
|
||||||
|
@ -38,6 +38,10 @@ class Job(object):
|
|||||||
def id(self):
|
def id(self):
|
||||||
return self.spec.id
|
return self.spec.id
|
||||||
|
|
||||||
|
@property
|
||||||
|
def output_name(self):
|
||||||
|
return '{}-{}-{}'.format(self.id, self.spec.label, self.iteration)
|
||||||
|
|
||||||
def __init__(self, spec, iteration, context):
|
def __init__(self, spec, iteration, context):
|
||||||
self.logger = logging.getLogger('job')
|
self.logger = logging.getLogger('job')
|
||||||
self.spec = spec
|
self.spec = spec
|
||||||
|
@ -104,6 +104,11 @@ class ExecutionContext(object):
|
|||||||
return True
|
return True
|
||||||
return self.current_job.spec.id != self.next_job.spec.id
|
return self.current_job.spec.id != self.next_job.spec.id
|
||||||
|
|
||||||
|
@property
|
||||||
|
def output_directory(self):
|
||||||
|
if self.current_job:
|
||||||
|
return os.path.join(self.output.basepath, self.current_job.output_name)
|
||||||
|
return self.output.basepath
|
||||||
|
|
||||||
def __init__(self, cm, tm, output):
|
def __init__(self, cm, tm, output):
|
||||||
self.logger = logging.getLogger('context')
|
self.logger = logging.getLogger('context')
|
||||||
@ -133,6 +138,7 @@ class ExecutionContext(object):
|
|||||||
if not self.job_queue:
|
if not self.job_queue:
|
||||||
raise RuntimeError('No jobs to run')
|
raise RuntimeError('No jobs to run')
|
||||||
self.current_job = self.job_queue.pop(0)
|
self.current_job = self.job_queue.pop(0)
|
||||||
|
os.makedirs(self.output_directory)
|
||||||
return self.current_job
|
return self.current_job
|
||||||
|
|
||||||
def end_job(self):
|
def end_job(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user