Skip to content

Commit 0ed794b

Browse files
authored
Merge branch 'master' into SERVE-657-update-naming
2 parents d8c9481 + 1a37dc1 commit 0ed794b

12 files changed

+116
-261
lines changed

python/ray/_private/test_utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -1714,6 +1714,7 @@ def check_local_files_gced(cluster, whitelist=None):
17141714
if whitelist and set(items).issubset(whitelist):
17151715
continue
17161716
if len(items) > 0:
1717+
print(f"runtime_env files not GC'd from subdir '{subdir}': {items}")
17171718
return False
17181719
return True
17191720

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/dashboard/client/src/pages/overview/OverviewPage.component.test.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,22 @@ import React, { PropsWithChildren } from "react";
33
import { MemoryRouter } from "react-router-dom";
44
import { GlobalContext } from "../../App";
55
import { STYLE_WRAPPER } from "../../util/test-utils";
6+
import { useRayStatus } from "../job/hook/useClusterStatus";
67
import { useJobList } from "../job/hook/useJobList";
78
import { OverviewPage } from "./OverviewPage";
89

910
jest.mock("../job/hook/useJobList");
11+
jest.mock("../job/hook/useClusterStatus");
12+
13+
const mockedUseRayStatus = jest.mocked(useRayStatus);
1014

1115
describe("OverviewPage", () => {
16+
beforeEach(() => {
17+
mockedUseRayStatus.mockReturnValue({
18+
clusterStatus: undefined,
19+
});
20+
});
21+
1222
it("renders", async () => {
1323
expect.assertions(3);
1424

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

python/ray/tests/test_runtime_env_conda_and_pip_3.py

-44
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import pytest
33
import sys
4-
import time
54

65
from ray._private.test_utils import (
76
wait_for_condition,
@@ -10,7 +9,6 @@
109
)
1110
import ray
1211

13-
from unittest import mock
1412

1513
if not os.environ.get("CI"):
1614
# This flags turns on the local development that link against current ray
@@ -145,48 +143,6 @@ def test_import(self):
145143
assert not check_local_files_gced(cluster)
146144

147145

148-
# Set scope to "class" to force this to run before start_cluster, whose scope
149-
# is "function". We need these env vars to be set before Ray is started.
150-
@pytest.fixture(scope="class")
151-
def skip_local_gc():
152-
with mock.patch.dict(
153-
os.environ,
154-
{
155-
"RAY_RUNTIME_ENV_SKIP_LOCAL_GC": "1",
156-
},
157-
):
158-
print("RAY_RUNTIME_ENV_SKIP_LOCAL_GC enabled.")
159-
yield
160-
161-
162-
class TestSkipLocalGC:
163-
@pytest.mark.skipif(
164-
os.environ.get("CI") and sys.platform != "linux",
165-
reason="Requires PR wheels built in CI, so only run on linux CI machines.",
166-
)
167-
@pytest.mark.parametrize("field", ["conda", "pip"])
168-
def test_skip_local_gc_env_var(self, skip_local_gc, start_cluster, field, tmp_path):
169-
cluster, address = start_cluster
170-
runtime_env = generate_runtime_env_dict(field, "python_object", tmp_path)
171-
ray.init(address, namespace="test", runtime_env=runtime_env)
172-
173-
@ray.remote
174-
def f():
175-
import pip_install_test # noqa: F401
176-
177-
return True
178-
179-
assert ray.get(f.remote())
180-
181-
ray.shutdown()
182-
183-
# Give enough time for potentially uninstalling a conda env
184-
time.sleep(10)
185-
186-
# Check nothing was GC'ed
187-
assert not check_local_files_gced(cluster)
188-
189-
190146
if __name__ == "__main__":
191147
if os.environ.get("PARALLEL_CI"):
192148
sys.exit(pytest.main(["-n", "auto", "--boxed", "-vs", __file__]))

0 commit comments

Comments
 (0)