MigratorManager#

class nublado.controller.services.migrator.MigratorManager(*, config, lab_builder, migrator_storage, slack_client, logger)#

Bases: object

Manage filesystem migrator.

This singleton manages the migrator environment and maintains a cache for particular user migrations.

Parameters:
  • config (Config) – Nublado configuration (used for home volume and timeout).

  • lab_builder (LabBuilder) – Lab builder (used for home volume).

  • migrator_storage (MigratorStorage) – Shared storage driver for migrator K8s objects.

  • slack_client (Optional[SlackWebhookClient]) – Optional Slack webhook client for alerts.

  • logger (BoundLogger) – Logger to use.

Methods Summary

create(old_user, new_user)

Ensure the migrator environment exists.

get_status(old_user, new_user)

Return the status for the migrator container for a particular user pair, or None if no migration has been attempted.

Methods Documentation

async create(old_user, new_user)#

Ensure the migrator environment exists.

If we don’t have a migration environment for this user pair, create it. If we do, just return. This gets called by the handler when someone POSTs to the /migrator/v1/service ingress.

Returns:

Status for the created pod.

Return type:

MigratorStatus

Raises:
Parameters:
  • old_user (str)

  • new_user (str)

async get_status(old_user, new_user)#

Return the status for the migrator container for a particular user pair, or None if no migration has been attempted.

Raises:
Parameters:
  • old_user (str)

  • new_user (str)

Return type:

Optional[MigratorStatus]