From 9599f98b878d71c01362b577067b45aa4a2609d6 Mon Sep 17 00:00:00 2001 From: Ignacio Heredia Date: Tue, 27 Aug 2024 12:07:55 +0200 Subject: [PATCH] feat: rename `ai4-cvat` to `ai4os-cvat` for catalog consistency --- ai4papi/conf.py | 2 +- ai4papi/routers/v1/deployments/tools.py | 6 +++--- etc/tools/{ai4-cvat => ai4os-cvat}/nomad.hcl | 7 ++++++- etc/tools/{ai4-cvat => ai4os-cvat}/user.yaml | 0 4 files changed, 10 insertions(+), 5 deletions(-) rename etc/tools/{ai4-cvat => ai4os-cvat}/nomad.hcl (98%) rename etc/tools/{ai4-cvat => ai4os-cvat}/user.yaml (100%) diff --git a/ai4papi/conf.py b/ai4papi/conf.py index efa323a..dc789a7 100644 --- a/ai4papi/conf.py +++ b/ai4papi/conf.py @@ -83,7 +83,7 @@ def load_yaml_conf(fpath): # For tools, map the Nomad job name prefixes to tool IDs tools_nomad2id = { 'fl': 'ai4os-federated-server', - 'cvat': 'ai4-cvat', + 'cvat': 'ai4os-cvat', } for tool in TOOLS.keys(): if tool not in tools_nomad2id.values(): diff --git a/ai4papi/routers/v1/deployments/tools.py b/ai4papi/routers/v1/deployments/tools.py index c2a8c3d..c37ee71 100644 --- a/ai4papi/routers/v1/deployments/tools.py +++ b/ai4papi/routers/v1/deployments/tools.py @@ -138,7 +138,7 @@ def get_deployment( job['tool_name'] = tool_id # Additional checks - if tool_id == 'ai4-cvat': + if tool_id == 'ai4os-cvat': # Remove useless endpoints (they all point to same url) ignore = ['server', 'grafana'] job['active_endpoints'] = [k for k in job['active_endpoints'] if k not in ignore] @@ -201,7 +201,7 @@ def create_deployment( # Check if the provided configuration is within the job quotas # Skip this check with CVAT because it does not have a "hardware" section in the conf - if tool_name not in ['ai4-cvat']: + if tool_name not in ['ai4os-cvat']: quotas.check_jobwise( conf=user_conf, vo=vo, @@ -300,7 +300,7 @@ def create_deployment( usertask['Config']['args'] = [f'--{service}'] # Deploy a CVAT tool - elif tool_name == 'ai4-cvat': + elif tool_name == 'ai4os-cvat': # Enforce defining CVAT username and password cvat = {k: v for k, v in user_conf['general'].items() if k.startswith('cvat')} diff --git a/etc/tools/ai4-cvat/nomad.hcl b/etc/tools/ai4os-cvat/nomad.hcl similarity index 98% rename from etc/tools/ai4-cvat/nomad.hcl rename to etc/tools/ai4os-cvat/nomad.hcl index 14bb8e5..36711e7 100644 --- a/etc/tools/ai4-cvat/nomad.hcl +++ b/etc/tools/ai4os-cvat/nomad.hcl @@ -30,9 +30,14 @@ To avoid too much disruption, I'm only changing this inside the service field To avoid too much disruption, I'm only changing this in the "main" task (parameter `image`) - ${NOMAD_META_server_image}:${NOMAD_META_cvat_version}${NOMAD_META_cvat_version_custom} --> registry.services.ai4os.eu/ai4os/ai4-cvat-server:v2.7.3-AI4OS -[1]: https://github.com/ai4os/ai4-cvat/blob/v2.7.3-AI4OS/nomad/ai4-cvat.jobspec.nomad.hcl +[1]: https://github.com/ai4os/ai4os-cvat/blob/v2.7.3-AI4OS/nomad/ai4-cvat.jobspec.nomad.hcl [2]: https://stackoverflow.com/a/56957750/18471590 +Note: +In several part of the job we use the old name of the repo (ai4os/ai4-cvat) which +should redirect fine to the new repo name (ai4os/ai4os-cvat) +But it is important nevertheless to keep it in mind, just in case. + */ diff --git a/etc/tools/ai4-cvat/user.yaml b/etc/tools/ai4os-cvat/user.yaml similarity index 100% rename from etc/tools/ai4-cvat/user.yaml rename to etc/tools/ai4os-cvat/user.yaml