Convert WorkerVersion.model_usage to tri-state enum
Refs https://redmine.teklia.com/issues/5478
We need the field WorkerVersion.model_usage to behave like WorkerVersion.gpu_usage:
- use a tri-state enum (disabled | supported | required)
- convert existing values:
true => requiredfalse => disabled
The WorkerVersionGPUUsage enum could be renamed to a more geenric FeatureUsage, but we coudl also simply create a dedicated enum with the same values.
These endpoints need to support the new flag:
- CreateDockerWorkerVersion
- CreateWorkerVersion
- ListWorkerVersions
- RetrieveWorkerVersion
- (Partial)UpdateWorkerVersion
You'll also need to check Process.build that uses the current model_usage boolean in pre-flight checks
For context, this is needed for training on datasets process: the worker version must support 3 states:
-
requiredmodel when training/inference needs an existing model -
supportedmodel when training can train from scracth OR fine tune an existing model -
disabledmodel when the worker has no support for any model whatsoever
Edited by Bastien Abadie