1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-22 04:49:00 +00:00

Tidying run_config config points

This commit is contained in:
Sergei Trofimov 2017-03-20 14:40:13 +00:00
parent 482a936639
commit 1c4eef54d6

View File

@ -636,89 +636,119 @@ class RunConfiguration(Configuration):
# Metadata is separated out because it is not loaded into the auto # Metadata is separated out because it is not loaded into the auto
# generated config file # generated config file
meta_data = [ meta_data = [
ConfigurationPoint('run_name', kind=str, ConfigurationPoint(
'run_name',
kind=str,
description=''' description='''
A string that labels the WA run that is being performed. This would typically A string that labels the WA run that is being performed. This would
be set in the ``config`` section of an agenda (see typically be set in the ``config`` section of an agenda (see
:ref:`configuration in an agenda <configuration_in_agenda>`) rather than in the config file. :ref:`configuration in an agenda <configuration_in_agenda>`) rather
than in the config file.
.. _old-style format strings: http://docs.python.org/2/library/stdtypes.html#string-formatting-operations ''',
.. _log record attributes: http://docs.python.org/2/library/logging.html#logrecord-attributes ),
'''), ConfigurationPoint(
ConfigurationPoint('project', kind=str, 'project',
kind=str,
description=''' description='''
A string naming the project for which data is being collected. This may be A string naming the project for which data is being collected. This
useful, e.g. when uploading data to a shared database that is populated from may be useful, e.g. when uploading data to a shared database that
multiple projects. is populated from multiple projects.
'''), ''',
ConfigurationPoint('project_stage', kind=dict, ),
ConfigurationPoint(
'project_stage',
kind=dict,
description=''' description='''
A dict or a string that allows adding additional identifier. This is may be A dict or a string that allows adding additional identifier. This
useful for long-running projects. is may be useful for long-running projects.
'''), ''',
),
] ]
config_points = [ config_points = [
ConfigurationPoint('execution_order', kind=str, default='by_iteration', ConfigurationPoint(
'execution_order',
kind=str,
default='by_iteration',
allowed_values=['by_iteration', 'by_spec', 'by_section', 'random'], allowed_values=['by_iteration', 'by_spec', 'by_section', 'random'],
description=''' description='''
Defines the order in which the agenda spec will be executed. At the moment, Defines the order in which the agenda spec will be executed. At the
the following execution orders are supported: moment, the following execution orders are supported:
``"by_iteration"`` ``"by_iteration"``
The first iteration of each workload spec is executed one after the other, The first iteration of each workload spec is executed one after
so all workloads are executed before proceeding on to the second iteration. the other, so all workloads are executed before proceeding on
E.g. A1 B1 C1 A2 C2 A3. This is the default if no order is explicitly specified. to the second iteration. E.g. A1 B1 C1 A2 C2 A3. This is the
default if no order is explicitly specified.
In case of multiple sections, this will spread them out, such that specs In case of multiple sections, this will spread them out, such
from the same section are further part. E.g. given sections X and Y, global that specs from the same section are further part. E.g. given
specs A and B, and two iterations, this will run :: sections X and Y, global specs A and B, and two iterations,
this will run ::
X.A1, Y.A1, X.B1, Y.B1, X.A2, Y.A2, X.B2, Y.B2 X.A1, Y.A1, X.B1, Y.B1, X.A2, Y.A2, X.B2, Y.B2
``"by_section"`` ``"by_section"``
Same as ``"by_iteration"``, however this will group specs from the same Same as ``"by_iteration"``, however this will group specs from
section together, so given sections X and Y, global specs A and B, and two iterations, the same section together, so given sections X and Y, global
this will run :: specs A and B, and two iterations, this will run ::
X.A1, X.B1, Y.A1, Y.B1, X.A2, X.B2, Y.A2, Y.B2 X.A1, X.B1, Y.A1, Y.B1, X.A2, X.B2, Y.A2, Y.B2
``"by_spec"`` ``"by_spec"``
All iterations of the first spec are executed before moving on to the next All iterations of the first spec are executed before moving on
spec. E.g. A1 A2 A3 B1 C1 C2 This may also be specified as ``"classic"``, to the next spec. E.g. A1 A2 A3 B1 C1 C2 This may also be
as this was the way workloads were executed in earlier versions of WA. specified as ``"classic"``, as this was the way workloads were
executed in earlier versions of WA.
``"random"`` ``"random"``
Execution order is entirely random. Execution order is entirely random.
'''), ''',
ConfigurationPoint('reboot_policy', kind=RebootPolicy, default='as_needed', ),
ConfigurationPoint(
'reboot_policy',
kind=RebootPolicy,
default='as_needed',
allowed_values=RebootPolicy.valid_policies, allowed_values=RebootPolicy.valid_policies,
description=''' description='''
This defines when during execution of a run the Device will be rebooted. The This defines when during execution of a run the Device will be
possible values are: rebooted. The possible values are:
``"never"`` ``"never"``
The device will never be rebooted. The device will never be rebooted.
``"initial"`` ``"initial"``
The device will be rebooted when the execution first starts, just before The device will be rebooted when the execution first starts,
executing the first workload spec. just before executing the first workload spec.
``"each_spec"`` ``"each_spec"``
The device will be rebooted before running a new workload spec. The device will be rebooted before running a new workload spec.
Note: this acts the same as each_iteration when execution order is set to by_iteration
.. note:: this acts the same as each_iteration when execution order
is set to by_iteration
``"each_iteration"`` ``"each_iteration"``
The device will be rebooted before each new iteration. The device will be rebooted before each new iteration.
'''), '''),
ConfigurationPoint('device', kind=str, mandatory=True, ConfigurationPoint(
'device',
kind=str,
mandatory=True,
description=''' description='''
This setting defines what specific Device subclass will be used to interact This setting defines what specific Device subclass will be used to
the connected device. Obviously, this must match your setup. interact the connected device. Obviously, this must match your
'''), setup.
ConfigurationPoint('retry_on_status', kind=list_of(JobStatus), ''',
),
ConfigurationPoint(
'retry_on_status',
kind=list_of(JobStatus),
default=['FAILED', 'PARTIAL'], default=['FAILED', 'PARTIAL'],
allowed_values=JobStatus.values, allowed_values=JobStatus.values,
description=''' description='''
This is list of statuses on which a job will be cosidered to have failed and This is list of statuses on which a job will be cosidered to have
will be automatically retried up to ``max_retries`` times. This defaults to failed and will be automatically retried up to ``max_retries``
``["FAILED", "PARTIAL"]`` if not set. Possible values are: times. This defaults to ``["FAILED", "PARTIAL"]`` if not set.
Possible values are::
``"OK"`` ``"OK"``
This iteration has completed and no errors have been detected This iteration has completed and no errors have been detected
@ -731,14 +761,19 @@ class RunConfiguration(Configuration):
``"ABORTED"`` ``"ABORTED"``
The user interupted the workload The user interupted the workload
'''), ''',
ConfigurationPoint('max_retries', kind=int, default=2, ),
ConfigurationPoint(
'max_retries',
kind=int,
default=2,
description=''' description='''
The maximum number of times failed jobs will be retried before giving up. If The maximum number of times failed jobs will be retried before
not set. giving up. If not set.
.. note:: this number does not include the original attempt .. note:: this number does not include the original attempt
'''), ''',
),
] ]
configuration = {cp.name: cp for cp in config_points + meta_data} configuration = {cp.name: cp for cp in config_points + meta_data}