diff --git a/setup.py b/setup.py index 90fccff..c16f72b 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ with open('test-requirements.txt', 'r') as fh: test_dev_install = [l.rstrip('\n') for l in fh.readlines()] -version = "0.0.11" +version = "0.0.12" setup( name="lrmaCUX", version=version, @@ -20,7 +20,7 @@ long_description=open("README.md").read(), long_description_content_type="text/markdown", - python_requires=">=3.7", + python_requires=">=3.9", install_requires=to_be_installed, tests_require=test_dev_install, @@ -37,9 +37,9 @@ "License :: OSI Approved :: BSD 3-Clause", "Natural Language :: English", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ], ) diff --git a/src/lrmaCU/terra/submission/submission_utils.py b/src/lrmaCU/terra/submission/submission_utils.py index 9ffe14e..594d3b7 100644 --- a/src/lrmaCU/terra/submission/submission_utils.py +++ b/src/lrmaCU/terra/submission/submission_utils.py @@ -442,12 +442,20 @@ def get_submissions_for_method_config(ns: str, ws: str, method_config: str, days class WorkflowExeStatus(str, Enum): """ Modeling the status of a particular workflow execution. + The str values are taken from the Terra UI. """ + + # transition state + QUEUED = 'Queued' + SUBMITTED = 'Submitted' + LAUNCHING = 'Launching' + RUNN = 'Running' + ABORTING = 'Aborting' + + # terminal state FAIL = 'Failed' SUCC = 'Succeeded' - RUNN = 'Running' ABORTED = 'Aborted' - ABORTING = 'Aborting' class EntityStatuses: @@ -525,6 +533,10 @@ def get_entities_in_a_submission(ns: str, ws: str, submission_id: str, aborted = list() aborting = list() running = list() + queued = list() + submitted = list() + launching = list() + for w in batch_submission_json['workflows']: e = w['workflowEntity']['entityName'] t = parser.parse(w['statusLastChangedDate']) @@ -539,6 +551,12 @@ def get_entities_in_a_submission(ns: str, ws: str, submission_id: str, aborting.append((e, t)) elif WorkflowExeStatus.RUNN.value == st: running.append((e, t)) + elif WorkflowExeStatus.QUEUED.value == st: + queued.append((e, t)) + elif WorkflowExeStatus.SUBMITTED.value == st: + submitted.append((e, t)) + elif WorkflowExeStatus.LAUNCHING.value == st: + launching.append((e, t)) else: raise ValueError(f"Seeing workflow execution status not seen before: {st}. lrmaCUX needs to be updated.") @@ -546,7 +564,10 @@ def get_entities_in_a_submission(ns: str, ws: str, submission_id: str, WorkflowExeStatus.FAIL: failure, WorkflowExeStatus.ABORTED: aborted, WorkflowExeStatus.ABORTING: aborting, - WorkflowExeStatus.RUNN: running} + WorkflowExeStatus.RUNN: running, + WorkflowExeStatus.QUEUED: queued, + WorkflowExeStatus.SUBMITTED: submitted, + WorkflowExeStatus.LAUNCHING: launching, } # todo: this gather is quite slow, anyway to speed it up? @@ -632,6 +653,9 @@ def update(dd: Dict[WorkflowExeStatus, List[Tuple[str, datetime.datetime]]], update(dd, WorkflowExeStatus.SUCC) update(dd, WorkflowExeStatus.FAIL) update(dd, WorkflowExeStatus.ABORTED) + update(dd, WorkflowExeStatus.QUEUED) + update(dd, WorkflowExeStatus.SUBMITTED) + update(dd, WorkflowExeStatus.LAUNCHING) return list( entity_statuses.values() )