Configure GPU usage on WorkerRun
Refs https://redmine.teklia.com/issues/7534
We now want to configure GPU assignation on ponos tasks directly from worker runs, thus removing the use_gpu configuration on the Process model.
Model changes & migration:
- remove
use_gpufromProcess - add a boolean field
use_gpuonWorkerRun, default toFalse - for processes where
Process.use_gpuis set to True, migrate the information to worker runs of these processes when their versiongpu_usageis eitherrequired|supported
Upon WorkerRun creation, the following rules are applied (through a pre_save signal ?):
- when worker version gpu usage is
required, it's forced toTrue - when worker version gpu usage is
disabled, it's forced toFalse - when worker version gpu usage is
supported, it's set toFalsebut will be modfiable
The WorkerRun.use_gpu field can only be changed by UpdateWorkerRun endpoint, when and only when the worker run version gpu usage is supported . The user can either set it to true or false.
When process tasks are starting they now must get a GPU assigned if their worker run has use_gpu set to True. Otherwise they stay pending