buildtest.executors.cobalt

This method implements CobaltExecutor class which is defines how cobalt executor submit job to Cobalt scheduler.

Module Contents

Classes

CobaltExecutor

The CobaltExecutor class is responsible for submitting jobs to Cobalt Scheduler.

Attributes

logger

buildtest.executors.cobalt.logger
class buildtest.executors.cobalt.CobaltExecutor(name, settings, site_configs, account=None, maxpendtime=None, timeout=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

  • timeout (str, optional) – Test timeout in number of seconds

  • maxpendtime (int, optional) – Maximum Pending Time until job is cancelled. The default is 1 day (86400s)

  • account (str, optional) – Account to use for job submission

  • maxpendtime – Maximum Pending Time until job is cancelled. The default is 1 day (86400s)

type = 'cobalt'
launcher_command(numprocs, numnodes)[source]
run(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 to CobaltJob class. At job submission, cobalt will report the output and error file which can be retrieved using qstat. We retrieve the cobalt job record using builder.job.gather().

Parameters:

builder (buildtest.buildsystem.base.BuilderBase) – An instance object of BuilderBase type

poll(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 exceeds maxpendtime time limit and cancel job.

Parameters:

builder (buildtest.buildsystem.base.BuilderBase) – An instance object of BuilderBase type

gather(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