class controller.background.BackgroundTaskManager(*, image_service, prepuller, lab_manager, fileserver_manager, slack_client, logger)#

Bases: object

Manage Nublado controller background tasks.

While the Nublado controller is running, it needs to perform several periodic or continuous background tasks, namely:

  1. Refresh the list of available remote images and local cached images.

  2. Prepull images to all eligible nodes.

  3. Reconcile Kubernetes lab state with internal data structures.

  4. Reap tasks that were monitoring lab spawning or deletion.

  5. Watch file servers for changes in pod status (startup or timeout).

  6. Reconcile Kubernetes file server state with internal data structures.

This class manages all of these background tasks including, where relevant, their schedules. It only does the task management; all of the work of these tasks is done by methods on the underlying service objects.

This class is created during startup and tracked as part of the ProcessContext.


Methods Summary


Start all background tasks.


Stop the background tasks.

Methods Documentation

async start()#

Start all background tasks.

Intended to be called during Nublado controller startup. Several of the background tasks are run in the foreground first to ensure internal state is valid before starting to serve requests. :rtype: None

async stop()#

Stop the background tasks. :rtype: None