From 19675ca5289f9895a97361a06ad577971aebaa6e Mon Sep 17 00:00:00 2001 From: Manon Blanco <blanco@teklia.com> Date: Mon, 18 Dec 2023 16:05:33 +0000 Subject: [PATCH] Update model_usage to an enum --- docs/contents/workers/yaml.md | 11 ++++++++++- tests/conftest.py | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/contents/workers/yaml.md b/docs/contents/workers/yaml.md index b4ce1bc9..b7018c7c 100644 --- a/docs/contents/workers/yaml.md +++ b/docs/contents/workers/yaml.md @@ -80,7 +80,16 @@ include: : This worker does not support GPUs. It may run on a host that has a GPU, but it will ignore it. `model_usage` -: Boolean. Whether or not this worker requires a model version to run. Defaults to `false`. +: Whether or not this worker requires a model version to run. Defaults to `disabled`. May take one of the following values: + + `required` + : This worker requires a model version, and will only be run on processes with a model. + + `supported` + : This worker supports a model version, but may run on any processes, including those without model. + + `disabled` + : This worker does not support model version. It may run on a process that has a model, but it will ignore it. `docker` : Regroups Docker-related configuration attributes: diff --git a/tests/conftest.py b/tests/conftest.py index 92dc7378..4155fbe1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -139,7 +139,7 @@ def _mock_worker_run_api(responses): "docker_image_name": None, "state": "created", "gpu_usage": "disabled", - "model_usage": False, + "model_usage": "disabled", "worker": { "id": "deadbeef-1234-5678-1234-worker", "name": "Fake worker", @@ -206,7 +206,7 @@ def _mock_worker_run_no_revision_api(responses): "docker_image_name": None, "state": "created", "gpu_usage": "disabled", - "model_usage": False, + "model_usage": "disabled", "worker": { "id": "deadbeef-1234-5678-1234-worker", "name": "Fake worker", -- GitLab