Source code for core.constants

"""Constants declared for different statuses, types and codes throughout Jobmon."""

from enum import Enum


[docs] class ArgType:
[docs] NODE_ARG = 1
[docs] TASK_ARG = 2
[docs] OP_ARG = 3
[docs] class TaskResourcesType: """Constant Types for Task Resources."""
[docs] ORIGINAL = "O"
[docs] VALIDATED = "V"
[docs] ADJUSTED = "A"
[docs] class TaskInstanceStatus: """Statuses used for Task Instances."""
[docs] DONE = "D"
[docs] ERROR = "E"
[docs] ERROR_FATAL = "F"
[docs] INSTANTIATED = "I"
[docs] KILL_SELF = "K"
[docs] LAUNCHED = "O"
[docs] QUEUED = "Q"
[docs] RUNNING = "R"
[docs] TRIAGING = "T"
[docs] SUBMITTED_TO_BATCH_DISTRIBUTOR = "B"
[docs] UNKNOWN_ERROR = "U"
[docs] NO_DISTRIBUTOR_ID = "W"
[docs] NO_HEARTBEAT = "X"
[docs] RESOURCE_ERROR = "Z"
[docs] class TaskStatus: """Statuses used for Tasks."""
[docs] REGISTERING = "G"
[docs] QUEUED = "Q"
[docs] INSTANTIATING = "I"
[docs] LAUNCHED = "O"
[docs] RUNNING = "R"
[docs] DONE = "D"
[docs] ERROR_RECOVERABLE = "E"
[docs] ADJUSTING_RESOURCES = "A"
[docs] ERROR_FATAL = "F"
[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] REGISTERED = "G"
[docs] LINKING = "L"
[docs] BOUND = "B"
[docs] ABORTED = "A"
[docs] RUNNING = "R"
[docs] DONE = "D"
[docs] STOPPED = "S"
[docs] ERROR = "E"
[docs] COLD_RESUME = "C"
[docs] HOT_RESUME = "H"
[docs] TERMINATED = "T"
[docs] INSTANTIATED = "I"
[docs] LAUNCHED = "O"
[docs] class WorkflowStatus: """Statuses used for Workflows."""
[docs] REGISTERING = "G"
[docs] QUEUED = "Q"
[docs] ABORTED = "A"
[docs] INSTANTIATING = "I"
[docs] LAUNCHED = "O"
[docs] RUNNING = "R"
[docs] DONE = "D"
[docs] HALTED = "H"
[docs] FAILED = "F"
[docs] class Direction(Enum): """A generic utility class. Used to represent one-dimensional direction, such as upstream/downstream. """
[docs] UP = "up"
[docs] DOWN = "down"
[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