Skip to content

Commit 48f64fc

Browse files
Merge pull request #1318 from linsword13/abs-wm
Enforce that workflow manager should implement `get_status`
2 parents 9f942cf + 0707992 commit 48f64fc

File tree

6 files changed

+22
-1
lines changed

6 files changed

+22
-1
lines changed

var/ramble/repos/builtin.mock/workflow_managers/info/workflow_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,7 @@ def _after_make_experiments(self, workspace, app_inst=None):
135135
)
136136

137137
workflow_manager_family("info-workflow-manager")
138+
139+
def get_status(self, workspace):
140+
"""Return status of a given job"""
141+
return None

var/ramble/repos/builtin.mock/workflow_managers/when-workflow-manager/workflow_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,7 @@ class WhenWorkflowManager(WorkflowManagerBase):
6464
description="Test required key",
6565
when=["+wf_man_required_key"],
6666
)
67+
68+
def get_status(self, workspace):
69+
"""Return status of a given job"""
70+
return None

var/ramble/repos/builtin.mock/workflow_managers/wm-with-foms/workflow_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ def _prepare_analysis(self, workspace):
3232
log_file="{experiment_run_dir}/.wm_job_info",
3333
fom_type=FomType.INFO,
3434
)
35+
36+
def get_status(self, workspace):
37+
"""Return status of a given job"""
38+
return None

var/ramble/repos/builtin/base_classes/workflow-manager-base/base_class.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# except according to those terms.
88
"""Define base classes for workflow manager definitions"""
99

10+
import abc
1011
from typing import Collection, Iterator
1112

1213
import ramble.definitions.families
@@ -97,9 +98,9 @@ def set_application(self, app_inst):
9798
"""Set a reference to the associated app_inst"""
9899
self.app_inst = app_inst
99100

101+
@abc.abstractmethod
100102
def get_status(self, workspace):
101103
"""Return status of a given job"""
102-
return None
103104

104105
def conditional_expand(self, templates: Collection[str]) -> Iterator[str]:
105106
"""Return a (potentially empty) iterator of expanded strings

var/ramble/repos/builtin/workflow_managers/gke-mpi/workflow_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,7 @@ def _prepare_analysis(self, workspace):
184184
if os.path.exists(launcher_log):
185185
log_file = expander.expand_var_name("log_file")
186186
shutil.copy2(launcher_log, log_file)
187+
188+
def get_status(self, workspace):
189+
"""Return status of a given job"""
190+
return None

var/ramble/repos/builtin/workflow_managers/user-managed/workflow_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ class UserManaged(WorkflowManagerBase):
3737
default="{execute_experiment}",
3838
description="batch_submit script, mostly served as an overridable default",
3939
)
40+
41+
def get_status(self, workspace):
42+
"""Return status of a given job"""
43+
return None

0 commit comments

Comments
 (0)