From 02646c46d50bfb290883c35a6115ccbca3d39ad6 Mon Sep 17 00:00:00 2001 From: Ignacio Heredia Date: Thu, 12 Dec 2024 16:37:13 +0100 Subject: [PATCH] fix: fix MinIO info --- ai4papi/routers/v1/inference/oscar.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ai4papi/routers/v1/inference/oscar.py b/ai4papi/routers/v1/inference/oscar.py index d436925..be2c247 100644 --- a/ai4papi/routers/v1/inference/oscar.py +++ b/ai4papi/routers/v1/inference/oscar.py @@ -30,7 +30,7 @@ class Service(BaseModel): image: str cpu: NonNegativeInt = 2 - memory: NonNegativeInt = 3000 + memory: NonNegativeInt = 30000 allowed_users: List[str] = [] # no additional users by default title: str = "" @@ -185,6 +185,9 @@ def get_services_list( client = get_client_from_auth(authorization.credentials, vo) r = client.list_services() + # Retrieve cluster config for MinIO info + client_conf = client.get_cluster_config().json() + # Filter services services = [] for s in json.loads(r.text): @@ -200,10 +203,14 @@ def get_services_list( if vo not in s.get("vo", []): continue - # Add service endpoint + # Add service endpoint for sync calls cluster_endpoint = MAIN_CONF["oscar"]["clusters"][vo]["endpoint"] s["endpoint"] = f"{cluster_endpoint}/run/{s['name']}" + # Info for async calls + # Replace MinIO info with the one retrieved from client (which is the correct one) + s["storage_providers"]["minio"]["default"] = client_conf["minio_provider"] + services.append(s) # Sort services by creation time, recent to old