Skip to content

Commit 7beea56

Browse files
davidxiarueian
andauthored
[core][autoscaler] always add Total to ray status section titles (#52458)
in Autoscaler V2 closes #52361 --------- Signed-off-by: David Xia <david@davidxia.com> Signed-off-by: Rueian <rueiancsie@gmail.com> Co-authored-by: Rueian <rueiancsie@gmail.com>
1 parent 683ad33 commit 7beea56

8 files changed

+31
-35
lines changed

python/ray/autoscaler/_private/util.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -940,11 +940,11 @@ def format_info_string(
940940
941941
Resources
942942
{separator}
943-
{"Total " if verbose else ""}Usage:
943+
Total Usage:
944944
{usage_report}
945-
{"Total " if verbose else ""}Constraints:
945+
Total Constraints:
946946
{constraints_report}
947-
{"Total " if verbose else ""}Demands:
947+
Total Demands:
948948
{demand_report}"""
949949

950950
if verbose:

python/ray/autoscaler/v2/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,11 @@ def format(cls, data: ClusterStatus, verbose: bool = False) -> str:
344344
"",
345345
"Resources",
346346
separator,
347-
f"{'Total ' if verbose else ''}Usage:",
347+
"Total Usage:",
348348
cluster_usage_report,
349-
f"{'Total ' if verbose else ''}Constraints:",
349+
"Total Constraints:",
350350
constraints_report,
351-
f"{'Total ' if verbose else ''}Demands:",
351+
"Total Demands:",
352352
demand_report,
353353
node_usage_report,
354354
]

python/ray/tests/test_autoscaler_e2e.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,7 @@ def ping(self):
123123
actor = Actor.remote()
124124
ray.get(actor.ping.remote())
125125

126-
assert "Demands" in subprocess.check_output("ray status", shell=True).decode()
127-
assert (
128-
"Total Demands"
129-
not in subprocess.check_output("ray status", shell=True).decode()
130-
)
126+
assert "Total Demands" in subprocess.check_output("ray status", shell=True).decode()
131127
assert (
132128
"Total Demands" in subprocess.check_output("ray status -v", shell=True).decode()
133129
)

python/ray/tests/test_cli_patterns/test_ray_status.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Recent failures:
1212

1313
Resources
1414
---------------------------------------------------------------
15-
Usage:
15+
Total Usage:
1616
0.0/3.0 CPU
1717
0.+
1818
0.+
1919

20-
Constraints:
20+
Total Constraints:
2121
\(no request_resources\(\) constraints\)
22-
Demands:
22+
Total Demands:
2323
\(no resource demands\)

python/ray/tests/test_cli_patterns/test_ray_status_multinode.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ Recent failures:
1515

1616
Resources
1717
---------------------------------------------------------------
18-
Usage:
18+
Total Usage:
1919
0.0/8.0 CPU
2020
0.+
2121
0.+
2222

23-
Constraints:
23+
Total Constraints:
2424
\(no request_resources\(\) constraints\)
25-
Demands:
25+
Total Demands:
2626
\(no resource demands\)

python/ray/tests/test_cli_patterns/test_ray_status_multinode_v1.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Recent failures:
1313

1414
Resources
1515
---------------------------------------------------------------
16-
Usage:
16+
Total Usage:
1717
0.0/8.0 CPU
1818
0.+
1919
0.+
2020

21-
Constraints:
21+
Total Constraints:
2222
\(no request_resources\(\) constraints\)
23-
Demands:
23+
Total Demands:
2424
\(no resource demands\)

python/ray/tests/test_cli_patterns/test_ray_status_v1.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Recent failures:
1010

1111
Resources
1212
---------------------------------------------------------------
13-
Usage:
13+
Total Usage:
1414
0.0/3.0 CPU
1515
0.+
1616
0.+
1717

18-
Constraints:
18+
Total Constraints:
1919
\(no request_resources\(\) constraints\)
20-
Demands:
20+
Total Demands:
2121
\(no resource demands\)

python/ray/tests/test_resource_demand_scheduler.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -3159,16 +3159,16 @@ def test_info_string():
31593159
31603160
Resources
31613161
--------------------------------------------------------
3162-
Usage:
3162+
Total Usage:
31633163
0/2 AcceleratorType:V100
31643164
530.0/544.0 CPU
31653165
2/2 GPU
31663166
2.00GiB/8.00GiB memory
31673167
3.14GiB/16.00GiB object_store_memory
31683168
3169-
Constraints:
3169+
Total Constraints:
31703170
{'CPU': 16}: 100 from request_resources()
3171-
Demands:
3171+
Total Demands:
31723172
{'CPU': 1}: 150+ pending tasks/actors
31733173
{'CPU': 4} * 5 (PACK): 420+ pending placement groups
31743174
""".strip()
@@ -3217,16 +3217,16 @@ def test_info_string_multiple_constraints():
32173217
32183218
Resources
32193219
--------------------------------------------------------
3220-
Usage:
3220+
Total Usage:
32213221
530.0/544.0 CPU
32223222
2/2 GPU
32233223
2.00GiB/8.00GiB memory
32243224
3.14GiB/16.00GiB object_store_memory
32253225
3226-
Constraints:
3226+
Total Constraints:
32273227
{'CPU': 16}: 100 from request_resources()
32283228
{'CPU': 1, 'GPU': 16}: 10 from request_resources()
3229-
Demands:
3229+
Total Demands:
32303230
{'CPU': 1}: 150+ pending tasks/actors
32313231
{'CPU': 4} * 5 (PACK): 420+ pending placement groups
32323232
""".strip()
@@ -3610,16 +3610,16 @@ def test_info_string_with_launch_failures():
36103610
36113611
Resources
36123612
--------------------------------------------------------
3613-
Usage:
3613+
Total Usage:
36143614
0/2 AcceleratorType:V100
36153615
530.0/544.0 CPU
36163616
2/2 GPU
36173617
2.00GiB/8.00GiB memory
36183618
3.14GiB/16.00GiB object_store_memory
36193619
3620-
Constraints:
3620+
Total Constraints:
36213621
{'CPU': 16}: 100 from request_resources()
3622-
Demands:
3622+
Total Demands:
36233623
{'CPU': 1}: 150+ pending tasks/actors
36243624
{'CPU': 4} * 5 (PACK): 420+ pending placement groups
36253625
""".strip()
@@ -3792,16 +3792,16 @@ def test_info_string_failed_node_cap():
37923792
37933793
Resources
37943794
--------------------------------------------------------
3795-
Usage:
3795+
Total Usage:
37963796
0/2 AcceleratorType:V100
37973797
530.0/544.0 CPU (2.0 used of 2.0 reserved in placement groups)
37983798
2/2 GPU
37993799
2.00GiB/8.00GiB memory
38003800
3.14GiB/16.00GiB object_store_memory
38013801
3802-
Constraints:
3802+
Total Constraints:
38033803
{'CPU': 16}: 100 from request_resources()
3804-
Demands:
3804+
Total Demands:
38053805
{'CPU': 2.0}: 153+ pending tasks/actors (3+ using placement groups)
38063806
{'GPU': 0.5}: 100+ pending tasks/actors (100+ using placement groups)
38073807
{'CPU': 4} * 5 (PACK): 420+ pending placement groups

0 commit comments

Comments
 (0)