server.web.routes.v2.cli.task

Routes for Tasks.

Attributes

logger

_task_instance_label_mapping

_reversed_task_instance_label_mapping

Functions

get_task_status(→ Any)

Get the status of a task.

get_task_subdag(→ Any)

Used to get the sub dag of a given task.

update_task_statuses(→ Any)

Update the status of the tasks.

get_task_dependencies(→ Any)

Get task's downstream and upstream tasks and their status.

get_tasks_recursive(→ Any)

Get all input task_ids'.

get_task_resource_usage(→ Any)

Return the resource usage for a given Task ID.

_get_tasks_recursive(→ set)

Get all input task_ids'.

_get_dag_and_wf_id(→ tuple)

_get_node_dependencies(→ Set[int])

Get all upstream nodes of a node.

_get_subdag(→ list)

Get all descendants of a given nodes.

_get_tasks_from_nodes(→ dict)

Get task ids of the given node ids.

get_downstream_tasks(→ Any)

Get only the direct downstreams of a task.

get_task_details(→ Any)

Get information about TaskInstances associated with specific Task ID.

get_task_details_viz(→ Any)

Get status of Task from Task ID.

Module Contents

server.web.routes.v2.cli.task.logger[source]
server.web.routes.v2.cli.task._task_instance_label_mapping[source]
server.web.routes.v2.cli.task._reversed_task_instance_label_mapping[source]
server.web.routes.v2.cli.task.get_task_status() Any[source]

Get the status of a task.

server.web.routes.v2.cli.task.get_task_subdag() Any[source]

Used to get the sub dag of a given task.

It returns a list of sub tasks as well as a list of sub nodes.

server.web.routes.v2.cli.task.update_task_statuses() Any[source]

Update the status of the tasks.

server.web.routes.v2.cli.task.get_task_dependencies(task_id: int) Any[source]

Get task’s downstream and upstream tasks and their status.

server.web.routes.v2.cli.task.get_tasks_recursive(direction: str) Any[source]

Get all input task_ids’.

Either downstream or upsteam tasks based on direction; return all recursive(including input set) task_ids in the defined direction.

server.web.routes.v2.cli.task.get_task_resource_usage() Any[source]

Return the resource usage for a given Task ID.

server.web.routes.v2.cli.task._get_tasks_recursive(task_ids: Set[int], direction: jobmon.core.constants.Direction, session: sqlalchemy.orm.Session) set[source]

Get all input task_ids’.

Either downstream or upsteam tasks based on direction; return all recursive(including input set) task_ids in the defined direction.

server.web.routes.v2.cli.task._get_dag_and_wf_id(task_id: int, session: sqlalchemy.orm.Session) tuple[source]
server.web.routes.v2.cli.task._get_node_dependencies(nodes: set, dag_id: int, session: sqlalchemy.orm.Session, direction: jobmon.core.constants.Direction) Set[int][source]

Get all upstream nodes of a node.

Parameters:
  • nodes (set) – set of nodes

  • dag_id (int) – ID of DAG

  • session (Session) – SQLAlchemy session

  • direction (Direction) – either up or down

server.web.routes.v2.cli.task._get_subdag(node_ids: list, dag_id: int, session: sqlalchemy.orm.Session) list[source]

Get all descendants of a given nodes.

It only queries the primary keys on the edge table without join.

Parameters:
  • node_ids (list) – list of node IDs

  • dag_id (int) – ID of DAG

  • session (Session) – SQLAlchemy sessions

server.web.routes.v2.cli.task._get_tasks_from_nodes(workflow_id: int, nodes: List, task_status: List, session: sqlalchemy.orm.Session) dict[source]

Get task ids of the given node ids.

Parameters:
  • workflow_id (int) – ID of the workflow

  • nodes (list) – list of nodes

  • task_status (list) – list of task statuses

  • session (Session) – SQLAlchemy session

server.web.routes.v2.cli.task.get_downstream_tasks() Any[source]

Get only the direct downstreams of a task.

server.web.routes.v2.cli.task.get_task_details(task_id: int) Any[source]

Get information about TaskInstances associated with specific Task ID.

server.web.routes.v2.cli.task.get_task_details_viz(task_id: int) Any[source]

Get status of Task from Task ID.