buildtest.executors.cobalt
¶
This method implements CobaltExecutor class which is defines how cobalt executor submit job to Cobalt scheduler.
Module Contents¶
Classes¶
The CobaltExecutor class is responsible for submitting jobs to Cobalt Scheduler. |
Attributes¶
- buildtest.executors.cobalt.logger¶
- class buildtest.executors.cobalt.CobaltExecutor(name, settings, site_configs, account=None, maxpendtime=None)[source]¶
Bases:
buildtest.executors.base.BaseExecutor
The CobaltExecutor class is responsible for submitting jobs to Cobalt Scheduler. The class implements the following methods:
load: load Cobalt executors from configuration file
dispatch: submit Cobalt job to scheduler
poll: poll Cobalt job via qstat and retrieve job state
gather: gather job record including output, error, exit code
Initiate a base executor, meaning we provide a name (also held by the BuildExecutor base that holds it) and the loaded dictionary of config opts to parse.
- Parameters
name (str) – name of executor
setting (dict) – setting for a given executor defined in configuration file
site_configs (buildtest.config.SiteConfiguration) – Instance of SiteConfiguration class
- type = cobalt¶
- run(self, builder)[source]¶
This method is responsible for dispatching job to Cobalt Scheduler by invoking
builder.run()
which runs the build script. If job is submitted to scheduler, we get the JobID and pass this toCobaltJob
class. At job submission, cobalt will report the output and error file which can be retrieved using qstat. We retrieve the cobalt job record usingbuilder.job.gather()
.- Parameters
builder (buildtest.buildsystem.base.BuilderBase) – An instance object of BuilderBase type
- poll(self, builder)[source]¶
This method is responsible for polling Cobalt job by invoking the builder method
builder.job.poll()
. We check the job state and existence of output file. If file exists or job is complete, we gather the results and return from function. If job is pending we check if job time exceedsmaxpendtime
time limit and cancel job.- Parameters
builder (buildtest.buildsystem.base.BuilderBase) – An instance object of BuilderBase type
- gather(self, builder)[source]¶
This method is responsible for moving output and error file in the run directory. We need to read
<JOBID>.cobaltlog
file which contains output of exit code by performing a regular expression(exit code of.)(\d+)(\;)
. The cobalt log file will contain a line: task completed normally with an exit code of 0; initiating job cleanup and removal- Parameters
builder (buildtest.buildsystem.base.BuilderBase) – An instance object of BuilderBase type