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

BuildExecutor(config_opts)

A BuildExecutor is a base class some type of executor, defined under

class buildtest.executors.setup.BuildExecutor(config_opts)

A BuildExecutor is a base class some type of executor, defined under the buildtest/settings/default-config.json schema. For example, the types “local” and “slurm” would map to LocalExecutor and SlurmExecutor 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:

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)
run(self, builder)

Given a buildtest.buildsystem.BuildspecParser (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 fields before_script and after_script defined in executor. This method is called after executors are initialized in the class __init__ method