server.web.routes.v2.fsm.task_instance

Routes for TaskInstances.

Attributes

logger

Functions

log_running(→ Any)

Log a task_instance as running.

log_ti_report_by(→ Any)

Log a task_instance as being responsive with a new report_by_date.

log_ti_report_by_batch(→ Any)

Log task_instances as being responsive with a new report_by_date.

log_done(→ Any)

Log a task_instance as done.

log_error_worker_node(→ Any)

Log a task_instance as errored.

get_task_instance_error_log(→ Any)

Route to return all task_instance_error_log entries of the task_instance_id.

get_array_task_instance_id(→ Any)

Given an array ID and an index, select a single task instance ID.

log_no_distributor_id(→ Any)

Log a task_instance_id that did not get an distributor_id upon submission.

log_distributor_id(→ Any)

Log a task_instance's distributor id.

log_known_error(→ Any)

Log a task_instance as errored.

log_unknown_error(→ Any)

Log a task_instance as errored.

instantiate_task_instances(→ Any)

Sync status of given task intance IDs.

_update_task_instance_state(→ Any)

Advance the states of task_instance and it's associated Task.

_log_error(→ Any)

Module Contents

server.web.routes.v2.fsm.task_instance.logger[source]
server.web.routes.v2.fsm.task_instance.log_running(task_instance_id: int) Any[source]

Log a task_instance as running.

Parameters:

task_instance_id – id of the task_instance to log as running

server.web.routes.v2.fsm.task_instance.log_ti_report_by(task_instance_id: int) Any[source]

Log a task_instance as being responsive with a new report_by_date.

This is done at the worker node heartbeat_interval rate, so it may not happen at the same rate that the reconciler updates batch submitted report_by_dates (also because it causes a lot of traffic if all workers are logging report by_dates often compared to if the reconciler runs often).

Parameters:

task_instance_id – id of the task_instance to log

server.web.routes.v2.fsm.task_instance.log_ti_report_by_batch() Any[source]

Log task_instances as being responsive with a new report_by_date.

This is done at the worker node heartbeat_interval rate, so it may not happen at the same rate that the reconciler updates batch submitted report_by_dates (also because it causes a lot of traffic if all workers are logging report by_dates often compared to if the reconciler runs often).

Parameters:

task_instance_id – id of the task_instance to log

server.web.routes.v2.fsm.task_instance.log_done(task_instance_id: int) Any[source]

Log a task_instance as done.

Parameters:

task_instance_id – id of the task_instance to log done

server.web.routes.v2.fsm.task_instance.log_error_worker_node(task_instance_id: int) Any[source]

Log a task_instance as errored.

Parameters:
  • task_instance_id (str) – id of the task_instance to log done

  • error_message (str) – message to log as error

server.web.routes.v2.fsm.task_instance.get_task_instance_error_log(task_instance_id: int) Any[source]

Route to return all task_instance_error_log entries of the task_instance_id.

Parameters:

task_instance_id (int) – ID of the task instance

Returns:

jsonified task_instance_error_log result set

server.web.routes.v2.fsm.task_instance.get_array_task_instance_id(array_id: int, batch_num: int, step_id: int) Any[source]

Given an array ID and an index, select a single task instance ID.

Task instance IDs that are associated with the array are ordered, and selected by index. This route will be called once per array task instance worker node, so must be scalable.

server.web.routes.v2.fsm.task_instance.log_no_distributor_id(task_instance_id: int) Any[source]

Log a task_instance_id that did not get an distributor_id upon submission.

server.web.routes.v2.fsm.task_instance.log_distributor_id(task_instance_id: int) Any[source]

Log a task_instance’s distributor id.

Parameters:

task_instance_id – id of the task_instance to log

server.web.routes.v2.fsm.task_instance.log_known_error(task_instance_id: int) Any[source]

Log a task_instance as errored.

Parameters:

task_instance_id (int) – id for task instance.

server.web.routes.v2.fsm.task_instance.log_unknown_error(task_instance_id: int) Any[source]

Log a task_instance as errored.

Parameters:

task_instance_id (int) – id for task instance

server.web.routes.v2.fsm.task_instance.instantiate_task_instances() Any[source]

Sync status of given task intance IDs.

server.web.routes.v2.fsm.task_instance._update_task_instance_state(task_instance: jobmon.server.web.models.task_instance.TaskInstance, status_id: str) Any[source]

Advance the states of task_instance and it’s associated Task.

Return any messages that should be published based on the transition.

Parameters:
  • task_instance (TaskInstance) – object of time models.TaskInstance

  • status_id (int) – id of the status to which to transition

server.web.routes.v2.fsm.task_instance._log_error(session: sqlalchemy.orm.Session, ti: jobmon.server.web.models.task_instance.TaskInstance, error_state: str, error_msg: str, distributor_id: int | None = None, nodename: str | None = None) Any[source]