buildtest.system
¶
This module detects System changes defined in class BuildTestSystem.
Module Contents¶
Classes¶
BuildTestSystem is a class that detects system configuration |
|
This is a base Scheduler class used for implementing common methods for |
|
The Slurm class implements common functions to query Slurm cluster |
|
The LSF class checks for LSF binaries and returns a list of LSF queues |
|
The Cobalt class checks for Cobalt binaries and gets a list of Cobalt queues |
|
The PBS class checks for PBS binaries and gets a list of available queues |
- class buildtest.system.BuildTestSystem[source]¶
BuildTestSystem is a class that detects system configuration
Constructor method for BuildTestSystem(). Defines all system configuration using class variable system which is a dictionary.
- system¶
- supported_platforms = ['Linux', 'Darwin']¶
- check(self)[source]¶
Based on the module “distro” get system details like linux distro, processor, hostname, etc…
- check_scheduler(self)[source]¶
Check existence of batch scheduler and if so determine which scheduler it is. Currently we support Slurm, LSF, and Cobalt we invoke each class and see if its valid state. The checks determine if scheduler binaries exist in $PATH.
- detect_module_tool(self)[source]¶
Check if module tool exists, we check for Lmod or environment-modules by checking if environment variable
LMOD_VERSION
,MODULE_VERSION
orMODULES_CMD
exist. We check this with input specification in buildtest configuration. If user specifies lmod as the module tool but detected environment-modules, buildtest should pick this up and report this as part of configuration check
- class buildtest.system.Scheduler[source]¶
This is a base Scheduler class used for implementing common methods for detecting Scheduler details. The subclass implement specific queries that are scheduler specific. The
Slurm
,LSF
,PBS
andCobalt
class inherit from Base ClassScheduler
.- logger¶
- class buildtest.system.Slurm[source]¶
Bases:
Scheduler
The Slurm class implements common functions to query Slurm cluster including partitions, qos, cluster. We check existence of slurm binaries in $PATH and return if slurm cluster is in valid state.
- binaries = ['sbatch', 'sacct', 'sacctmgr', 'sinfo', 'scancel']¶
- active(self)[source]¶
Slurm scheduler is active if we are able to retrieve partitions or qos from scheduler. This method will return a boolean type where
True
indicates that slurm executors can be validated.
- _get_partitions(self)[source]¶
Get list of all partitions slurm partitions using
sinfo -a -h -O partitionname
. The output is a list of queue names$ sinfo -a -h -O partitionname system system_shared debug_hsw debug_knl jupyter
- class buildtest.system.LSF[source]¶
Bases:
Scheduler
The LSF class checks for LSF binaries and returns a list of LSF queues
- binaries = ['bsub', 'bqueues', 'bkill', 'bjobs']¶
- _get_queues(self)[source]¶
Return json dictionary of available LSF Queues and their queue states. The command we run is the following:
bqueues -o 'queue_name status' -json
which returns a JSON record of all queue details.$ bqueues -o 'queue_name status' -json { "COMMAND":"bqueues", "QUEUES":2, "RECORDS":[ { "QUEUE_NAME":"batch", "STATUS":"Open:Active" }, { "QUEUE_NAME":"test", "STATUS":"Open:Active" } ] }
- class buildtest.system.Cobalt[source]¶
Bases:
Scheduler
The Cobalt class checks for Cobalt binaries and gets a list of Cobalt queues
- binaries = ['qsub', 'qstat', 'qdel', 'nodelist', 'showres', 'partlist']¶