Skip to content

Commit

Permalink
Add deprecation warning for the CobaltProvider (#3101)
Browse files Browse the repository at this point in the history
Cobalt scheduler is no longer in use in any of the major ALCF machines. At this point only JLSE uses Cobalt.
Since we don't know for sure if there are any parsl users on JLSE, I'm adding a deprecation notice with intent to remove the CobaltProvider by 2024-04.
  • Loading branch information
yadudoc authored Feb 23, 2024
1 parent 3203888 commit d1b8510
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions parsl/providers/cobalt/cobalt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import os
import time
import warnings

from parsl.providers.errors import ScaleOutFailed
from parsl.channels import LocalChannel
Expand All @@ -24,6 +25,8 @@
class CobaltProvider(ClusterProvider, RepresentationMixin):
""" Cobalt Execution Provider
WARNING: CobaltProvider is deprecated and will be removed by 2024.04
This provider uses cobalt to submit (qsub), obtain the status of (qstat), and cancel (qdel)
jobs. Theo script to be used is created from a template file in this
same module.
Expand Down Expand Up @@ -86,6 +89,9 @@ def __init__(self,
self.queue = queue
self.scheduler_options = scheduler_options
self.worker_init = worker_init
warnings.warn("CobaltProvider is deprecated; This will be removed after 2024-04",
DeprecationWarning,
stacklevel=2)

def _status(self):
"""Returns the status list for a list of job_ids
Expand Down
16 changes: 16 additions & 0 deletions parsl/tests/test_providers/test_cobalt_deprecation_warning.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import warnings
import pytest
from parsl.providers import CobaltProvider


@pytest.mark.local
def test_deprecation_warning():

with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")

CobaltProvider()

assert len(w) == 1
assert issubclass(w[-1].category, DeprecationWarning)
assert "CobaltProvider" in str(w[-1].message)

0 comments on commit d1b8510

Please sign in to comment.