buildtest.executors.setup
¶
This module is responsible for setup of executors defined in buildtest configuration. The BuildExecutor class initializes the executors and chooses the executor class (LocalExecutor, LSFExecutor, SlurmExecutor) to call depending on executor name.
Module Contents¶
Classes¶
|
A BuildExecutor is a base class some type of executor, for example, |
-
class
buildtest.executors.setup.
BuildExecutor
(config_opts)¶ A BuildExecutor is a base class some type of executor, for example, the types “local”, “lsf”, “slurm” would map to
LocalExecutor
,LSFExecutor
andSlurmExecutor
here, each expecting a particular set of variables under the config options. If options are required and not provided, we exit on error. If they are optional and not provided, we use reasonable defaults.-
__repr__
(self)¶ Return repr(self).
-
__str__
(self)¶ Return str(self).
-
_choose_executor
(self, builder)¶ Choose executor is called at the onset of a run or dryrun. We look at the builder metadata to determine if a default is set for the executor, and fall back to the default.
- Parameters
builder (buildtest.buildsystem.BuilderBase (or subclass)) – the builder with the loaded Buildspec.
-
get
(self, name)¶ Given the name of an executor return the executor for running a buildtest build, or get the default.
-
poll
(self, builder)¶ Poll all jobs for batch executors (LSF, Slurm). For slurm we poll until job is in
PENDING
orRUNNING
state. If it is not in these states, we assume job is complete and gather results. For LSF jobs we poll job if its in job-statePEND
andRUN
. The method returnsTrue
orFalse
depending on the input builder.- Parameters
builder (BuilderBase (subclass)) – an instance of BuilderBase (subclass)
- Returns
Return a boolean to indicate if builder needs further polling
- Return type
bool
-
run
(self, builder)¶ Given a BuilderBase (subclass) go through the steps defined for the executor to run the build. This should be instantiated by the subclass. For a simple script run, we expect a setup, build, and finish.
- Parameters
builder (buildtest.buildsystem.BuilderBase (or subclass)) – the builder with the loaded test configuration.
-
setup
(self)¶ This method creates directory
var/executors/<executor-name>
for every executor defined in buildtest configuration and write scripts before_script.sh and after_script.sh if the fieldsbefore_script
andafter_script
are specified in executor section. This method is called after executors are initialized in the class __init__ method
-