"""Constants declared for different statuses, types and codes throughout Jobmon."""
from enum import Enum
[docs]
class TaskResourcesType:
"""Constant Types for Task Resources."""
[docs]
class TaskInstanceStatus:
"""Statuses used for Task Instances."""
[docs]
NO_DISTRIBUTOR_ID = "W"
[docs]
class TaskStatus:
"""Statuses used for Tasks."""
[docs]
ERROR_RECOVERABLE = "E"
[docs]
ADJUSTING_RESOURCES = "A"
[docs]
LABEL_DICT = {
"G": "REGISTERING",
"Q": "QUEUED",
"I": "INSTANTIATING",
"O": "LAUNCHED",
"R": "RUNNING",
"D": "DONE",
"E": "ERROR_RECOVERABLE",
"A": "ADJUSTING_RESOURCES",
"F": "ERROR_FATAL",
}
[docs]
class WorkflowRunStatus:
"""Statuses used for Workflow Runs."""
[docs]
class WorkflowStatus:
"""Statuses used for Workflows."""
[docs]
class Direction(Enum):
"""A generic utility class.
Used to represent one-dimensional direction,
such as upstream/downstream.
"""
[docs]
class SpecialChars:
"""A generic utility class.
Used to define special chars.
"""
[docs]
ILLEGAL_SPECIAL_CHARACTERS = r"/\\'\" "
[docs]
class ExecludeTTVs:
"""A hard-coded list.
Used to exclude task template versions with huge tasks that cause DB crash.
"""
[docs]
EXECLUDE_TTVS = {1} # bashtask
[docs]
class MaxConcurrentlyRunning:
"""A hard limit of array concurrency.
Currently set to max int, but can change as INFRA requests.
"""
import sys
[docs]
MAXCONCURRENTLYRUNNING = 2_147_483_647 # mysql int(11) max