Skip to content

Commit d939878

Browse files
fix
1 parent 6e823e4 commit d939878

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed

packages/models-library/src/models_library/projects_state.py

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,32 @@ class RunningState(str, Enum):
2222
"""State of execution of a project's computational workflow
2323
2424
SEE StateType for task state
25-
"""
26-
27-
UNKNOWN = "UNKNOWN" # Error state: the task disappeared from the system (Dask backend lost the task and its state is unknown)
28-
NOT_STARTED = "NOT_STARTED" # Default state when the project is created
29-
30-
PUBLISHED = (
31-
"PUBLISHED" # The project is awaiting the compute scheduler to pick up the task
32-
)
33-
34-
PENDING = "PENDING" # The compute scheduler has taken over, and the task is waiting for a worker to pick it up
3525
36-
WAITING_FOR_CLUSTER = "WAITING_FOR_CLUSTER" # No cluster is available to run the task; waiting for one to become available
37-
WAITING_FOR_RESOURCES = "WAITING_FOR_RESOURCES" # No worker is available to run the task; waiting for one to become available
38-
# PENDING -> WAITING_FOR_CLUSTER -> PENDING -> WAITING_FOR_RESOURCES -> PENDING -> STARTED
26+
# Computational backend states explained:
27+
- UNKNOWN - The backend doesn't know about the task anymore, it has disappeared from the system or it was never created (eg. when we are asking for the task)
28+
- NOT_STARTED - Default state when the task is created
29+
- PUBLISHED - The task has been submitted to the computational backend (click on "Run" button in the UI)
30+
- PENDING - Task has been transferred to the Dask scheduler and is waiting for a worker to pick it up (director-v2 --> Dask scheduler)
31+
- But! it is also transition state (ex. PENDING -> WAITING_FOR_CLUSTER -> PENDING -> WAITING_FOR_RESOURCES -> PENDING -> STARTED)
32+
- WAITING_FOR_CLUSTER - No cluster (Dask scheduler) is available to run the task; waiting for one to become available
33+
- WAITING_FOR_RESOURCES - No worker (Dask worker) is available to run the task; waiting for one to become available
34+
- STARTED - A worker has picked up the task and is executing it
35+
- SUCCESS - Task finished successfully
36+
- FAILED - Task finished with an error
37+
- ABORTED - Task was aborted before completion
3938
40-
STARTED = "STARTED" # A worker has picked up the task and is executing it
39+
"""
4140

42-
SUCCESS = "SUCCESS" # Task finished successfully
43-
FAILED = "FAILED" # Task finished with an error
44-
ABORTED = "ABORTED" # Task was aborted before completion
41+
UNKNOWN = "UNKNOWN"
42+
NOT_STARTED = "NOT_STARTED"
43+
PUBLISHED = "PUBLISHED"
44+
PENDING = "PENDING"
45+
WAITING_FOR_CLUSTER = "WAITING_FOR_CLUSTER"
46+
WAITING_FOR_RESOURCES = "WAITING_FOR_RESOURCES"
47+
STARTED = "STARTED"
48+
SUCCESS = "SUCCESS"
49+
FAILED = "FAILED"
50+
ABORTED = "ABORTED"
4551

4652
@staticmethod
4753
def list_running_states() -> list["RunningState"]:

services/web/server/src/simcore_service_webserver/director_v2/_computations_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
get_project_uuids_by_root_parent_project_id,
4242
)
4343
from ..rabbitmq import get_rabbitmq_rpc_client
44-
from ._comp_runs_collections_service import get_comp_run_collection_or_none_by_id
44+
from ._comp_run_collections_service import get_comp_run_collection_or_none_by_id
4545

4646

4747
async def _get_projects_metadata(

services/web/server/src/simcore_service_webserver/director_v2/_controller/rest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
from ...utils_aiohttp import envelope_json_response, get_api_base_url
3535
from .. import _director_v2_service
3636
from .._client import DirectorV2RestClient
37-
from .._comp_runs_collections_models import CompRunCollectionDBGet
38-
from .._comp_runs_collections_service import (
37+
from .._comp_run_collections_models import CompRunCollectionDBGet
38+
from .._comp_run_collections_service import (
3939
create_comp_run_collection,
4040
get_comp_run_collection_or_none_by_client_generated_id,
4141
)

0 commit comments

Comments
 (0)