Skip to content

Commit 8f22ff5

Browse files
ryanaolearyjaychia
authored andcommitted
[Core][Autoscaler] Refactor v2 Log Formatting (ray-project#49350)
Currently the V2 Autoscaler formats logs by converting the V2 data structure `ClusterStatus` to the V1 structures `AutoscalerSummary` and `LoadMetricsSummary` and then passing them to the legacy `format_info_string`. It'd be useful for the V2 autoscaler to directly format `ClusterStatus` to the correct output log format. This PR refactors `utils.py` to directly format `ClusterStatus`. Additionally, this PR changes the node reports to output `instance_id` rather than `ip_address`, since the latter is not necessarily unique for failed nodes. ## Related issue number Closes ray-project#37856 --------- Signed-off-by: ryanaoleary <[email protected]> Signed-off-by: Ryan O'Leary <[email protected]> Signed-off-by: Jay Chia <[email protected]>
1 parent 21ca414 commit 8f22ff5

File tree

2 files changed

+265
-119
lines changed

2 files changed

+265
-119
lines changed

python/ray/autoscaler/v2/tests/test_utils.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,10 @@ def test_cluster_status_formatter():
555555
Pending:
556556
worker_node, 1 launching
557557
worker_node_gpu, 1 launching
558-
127.0.0.3: worker_node, starting ray
558+
instance4: worker_node, starting ray
559559
Recent failures:
560560
worker_node: LaunchFailed (latest_attempt: 02:46:40) - Insufficient capacity
561-
worker_node: NodeTerminated (ip: 127.0.0.5)
561+
worker_node: NodeTerminated (instance_id: instance5)
562562
563563
Resources
564564
--------------------------------------------------------
@@ -573,18 +573,18 @@ def test_cluster_status_formatter():
573573
{'GPU': 2} * 1 (STRICT_PACK): 2+ pending placement groups
574574
{'GPU': 2, 'CPU': 100}: 2+ from request_resources()
575575
576-
Node: fffffffffffffffffffffffffffffffffffffffffffffffffff00001
576+
Node: fffffffffffffffffffffffffffffffffffffffffffffffffff00001 (head_node)
577577
Usage:
578578
0.5/1.0 CPU
579579
0.0/2.0 GPU
580580
5.42KiB/10.04KiB object_store_memory
581581
582-
Node: fffffffffffffffffffffffffffffffffffffffffffffffffff00002
582+
Node: fffffffffffffffffffffffffffffffffffffffffffffffffff00002 (worker_node)
583583
Usage:
584584
0/1.0 CPU
585585
0/2.0 GPU
586586
587-
Node: fffffffffffffffffffffffffffffffffffffffffffffffffff00003
587+
Node: fffffffffffffffffffffffffffffffffffffffffffffffffff00003 (worker_node)
588588
Usage:
589589
0.0/1.0 CPU"""
590590
assert actual == expected

0 commit comments

Comments
 (0)