server.web.models.workflow_run

Workflow run database table.

Attributes

logger

Classes

WorkflowRun

Database table for recording Workflow Runs.

Module Contents

server.web.models.workflow_run.logger
class server.web.models.workflow_run.WorkflowRun

Bases: jobmon.server.web.models.Base

Database table for recording Workflow Runs.

to_wire_as_reaper_workflow_run() tuple

Serialize workflow run.

id: sqlalchemy.orm.Mapped[int]
workflow_id: sqlalchemy.orm.Mapped[int]
user
jobmon_version
jobmon_server_version
status: sqlalchemy.orm.Mapped[str]
created_date
status_date
heartbeat_date
workflow
valid_transitions
untimely_transitions
bound_error_states
active_states
property is_alive: bool

Workflow run is in a state that should be registering heartbeats.

property is_active: bool

Statuses where Workflow Run is active (bound or running).

terminable(current_time: datetime.datetime) bool

Whether a workflowrun can be terminated.

A workflowrun can be terminated if it is in Cold/Hot resume state and has missed the last reporting heartbeat.

heartbeat(next_report_increment: float, dialect: str, transition_status: str = WorkflowRunStatus.RUNNING) None

Register a heartbeat for the Workflow Run to show it is still alive.

Parameters:
  • next_report_increment – Number of seconds until next expected heartbeat

  • dialect – The database dialect (mysql, sqlite)

  • transition_status – The status to transition to

reap() None

Transition dead workflow runs to a terminal state.

transition(new_state: str) None

Transition the Workflow Run’s state.

hot_reset() None

Set Workflow Run to Hot Resume.

cold_reset() None

Set Workflow Run to Cold Resume.