Skip to content

Commit

Permalink
Merge pull request #1773 from buildtesters/remove_cobalt
Browse files Browse the repository at this point in the history
Remove Cobalt Scheduler
  • Loading branch information
shahzebsiddiqui committed May 10, 2024
2 parents 0084d27 + 963ed84 commit ee6971b
Show file tree
Hide file tree
Showing 27 changed files with 10 additions and 815 deletions.
45 changes: 0 additions & 45 deletions .gitlab/jlse.yml

This file was deleted.

12 changes: 2 additions & 10 deletions buildtest/builders/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def __init__(
self.logger.debug(f"Processing Buildspec File: {self.buildspec}")
self.logger.debug(f"Processing Test: {self.name}")

# get type attribute from Executor class (local, slurm, cobalt, pbs, lsf)
# get type attribute from Executor class (local, slurm, pbs, lsf)
self.executor_type = buildexecutor.executors[self.executor].type
self.buildexecutor = buildexecutor

Expand Down Expand Up @@ -748,7 +748,7 @@ def _default_test_variables(self):
return lines

def sched_init(self):
"""This method will resolve scheduler fields: 'sbatch', 'pbs', 'bsub', 'cobalt'"""
"""This method will resolve scheduler fields: 'sbatch', 'pbs', 'bsub'"""
self.sbatch = deep_get(
self.recipe, "executors", self.executor, "sbatch"
) or self.recipe.get("sbatch")
Expand All @@ -758,9 +758,6 @@ def sched_init(self):
self.pbs = deep_get(
self.recipe, "executors", self.executor, "pbs"
) or self.recipe.get("pbs")
self.cobalt = deep_get(
self.recipe, "executors", self.executor, "cobalt"
) or self.recipe.get("cobalt")

self.burstbuffer = self.recipe.get("BB") or deep_get(
self.recipe, "executors", self.executor, "BB"
Expand Down Expand Up @@ -796,11 +793,6 @@ def get_job_directives(self):
lines.append(f"#PBS -o {self.name}.o")
lines.append(f"#PBS -e {self.name}.e")

if self.cobalt:
for line in self.cobalt:
lines.append(f"#COBALT {line}")
lines.append(f"#COBALT --jobname={self.name}")

return lines

def _get_burst_buffer(self, burstbuffer):
Expand Down
47 changes: 1 addition & 46 deletions buildtest/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
console,
)
from buildtest.exceptions import BuildTestError, ConfigurationError
from buildtest.scheduler.detection import LSF, PBS, Cobalt, Slurm, Torque
from buildtest.scheduler.detection import LSF, PBS, Slurm, Torque
from buildtest.schemas.defaults import custom_validator
from buildtest.schemas.utils import load_recipe, load_schema
from buildtest.utils.file import resolve_path
Expand Down Expand Up @@ -46,7 +46,6 @@ def __init__(self, settings_file=None, verbose=None):
"slurm": {},
"lsf": {},
"pbs": {},
"cobalt": {},
"torque": {},
"container": {},
}
Expand Down Expand Up @@ -172,7 +171,6 @@ def _executor_check(self):
self._validate_local_executors()
self._validate_slurm_executors()
self._validate_lsf_executors()
self._validate_cobalt_executors()
self._validate_pbs_executors()
self._validate_torque_executors()
self._validate_container_executors()
Expand Down Expand Up @@ -331,49 +329,6 @@ def _validate_slurm_executors(self):
"setting": slurm_executor[executor]
}

def _validate_cobalt_executors(self):
"""Validate cobalt queue property by running ```qstat -Ql <queue>``. If
its a non-zero exit code then queue doesn't exist otherwise it is a valid
queue.
"""

cobalt_executor = deep_get(self.target_config, "executors", "cobalt")
if not cobalt_executor:

if self.verbose:
console.print(
"No Cobalt executors found in configuration file", style="bold blue"
)

return

executor_type = "cobalt"

cobalt = Cobalt(custom_dirs=deep_get(self.target_config, "paths", "cobalt"))
if not cobalt.active():
return

queue_info = cobalt.queues()

for executor in cobalt_executor:
executor_name = f"{self.name()}.{executor_type}.{executor}"

if self.is_executor_disabled(cobalt_executor[executor]):
self.disabled_executors.append(executor_name)
continue

queue = cobalt_executor[executor].get("queue")
# if queue property defined in cobalt executor name check if it exists
if queue not in queue_info:
logger.error(
f"Cobalt queue '{queue}' does not exist. Available Cobalt queues: {queue_info} "
)
continue

self.valid_executors[executor_type][executor_name] = {
"setting": cobalt_executor[executor]
}

def _validate_pbs_executors(self):
"""Validate pbs queue property by running by checking if queue is found and
queue is 'enabled' and 'started' which are two properties found in pbs queue
Expand Down
207 changes: 0 additions & 207 deletions buildtest/executors/cobalt.py

This file was deleted.

Loading

0 comments on commit ee6971b

Please sign in to comment.