Support model versions in worker runs
Depends https://gitlab.com/arkindex/backend/-/issues/1018
Once we have the WorkerVersion.model_usage, the dataimport.WorkerRun model must support a nullable field model_version that is a FK towards training.ModelVersion.
This field must be manageable through the admin interface.
It must also be set when the flag WorkerVersion.model_usage is set to True on the associated worker_version.
A few changes are then required on these API endpoints:
-
StartProcessmust fail (400) if any of its worker run has a worker version withmodel_usage = Trueand nomodel_versionassociated.- The error message must be explicit as it will be displayed to the end user in the frontend
-
UpdateWorkerRunmust support an optionalmodel_version_idUUID that will be allowed only when the associated worker version hasmodel_usage = True.
CreateWorkerRun has no changes: it would be hard to implement in the frontend to select both a worker & model selection and THEN create the run. I think it's easier to keep the code as-is, display a warning, allow selecting a model.
The build_task_recipe is not extended yet (no changes on the process itself here).