alab_management.task_manager.task_manager module#

TaskLauncher is the core module of the system, which actually executes the tasks.

class TaskManager[source]#

Bases: object

TaskManager will.

  1. find all the ready tasks and submit them,

  2. handle all the resource requests

clean_up_tasks_from_previous_runs()[source]#

Cleans up incomplete tasks that exist from the last time the taskmanager was running. Note that this will block the task queue until all samples in these tasks have been removed from the physical lab (confirmed via user requests on the dashboard).

This typically occurs if the taskmanager was exited using SIGTERM (ctrl-c), in which case some tasks may still be in the RUNNING or CANCELLING state. These will be set to CANCELLED now.

handle_tasks_to_be_canceled()[source]#

Check if there are any tasks needs to be stopped.

run()[source]#

Start the loop.

submit_ready_tasks()[source]#

Checking if there are any tasks that are ready to be submitted. (STATUS = READY) If so, submit them to task actor (dramatiq worker).