File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
services/autoscaling/src/simcore_service_autoscaling/modules Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 2828 node_host_name_from_ec2_private_dns ,
2929 node_ip_from_ec2_private_dns ,
3030)
31+ from .cluster_scaling ._utils_computational import (
32+ resources_from_dask_task ,
33+ )
3134
3235_logger = logging .getLogger (__name__ )
3336
@@ -285,20 +288,12 @@ async def get_worker_used_resources(
285288 if not worker_processing_tasks :
286289 return Resources .create_as_empty ()
287290
288- total_resources_used : collections .Counter [ str ] = collections .Counter ()
291+ total_resources_used : collections .Counter = collections .Counter ()
289292 for _ , task_resources in worker_processing_tasks :
290293 total_resources_used .update (task_resources )
291294
292295 _logger .debug ("found %s for %s" , f"{ total_resources_used = } " , f"{ worker_url = } " )
293- return Resources (
294- cpus = total_resources_used .get ("CPU" , 0 ),
295- ram = TypeAdapter (ByteSize ).validate_python (
296- total_resources_used .get ("RAM" , 0 )
297- ),
298- generic_resources = {
299- k : v for k , v in total_resources_used .items () if k not in {"CPU" , "RAM" }
300- },
301- )
296+ return resources_from_dask_task (total_resources_used )
302297
303298
304299async def compute_cluster_total_resources (
You can’t perform that action at this time.
0 commit comments