Skip to content

Django command to migrate worker versions towards generic one

Refs https://redmine.teklia.com/issues/3678

We'll create a new interactive django command to help instance administrators to migrate worker and their versions (for a given repository).

Steps:

  1. find generic worker:
    • from CLI input
    • find an existing worker in that repo with name generic
    • ask user for UUID
  2. iterate over workers & their versions, excluding the generic worker
    1. find matching model by name
    2. find last model version available
    3. create a worker run for that model version + generic worker
    4. update all ML results to use that worker run + generic worker version

CLI input parameters:

  • repo_url, required
  • --generic-worker-id, optional worker that is the target belonging to that repo