diff --git a/dashboard/modules/reporter/profile_manager.py b/dashboard/modules/reporter/profile_manager.py index bb750b1cc97d..b6da47f13938 100644 --- a/dashboard/modules/reporter/profile_manager.py +++ b/dashboard/modules/reporter/profile_manager.py @@ -353,6 +353,9 @@ async def detach_profiler( cmd.append("--verbose") cmd.append(str(pid)) + if await _can_passwordless_sudo(): + cmd = ["sudo", "-n"] + cmd + process = await asyncio.create_subprocess_exec( *cmd, stdout=subprocess.PIPE, diff --git a/dashboard/optional_deps.py b/dashboard/optional_deps.py index 1dfaaca4d627..2e2a596223fd 100644 --- a/dashboard/optional_deps.py +++ b/dashboard/optional_deps.py @@ -8,6 +8,7 @@ import opencensus # noqa: F401 import prometheus_client # noqa: F401 +import memray # noqa: F401 import aiohttp # noqa: F401 import aiohttp.web # noqa: F401 diff --git a/python/ray/tests/test_minimal_install.py b/python/ray/tests/test_minimal_install.py index c83765d34efd..547faae5a6a4 100644 --- a/python/ray/tests/test_minimal_install.py +++ b/python/ray/tests/test_minimal_install.py @@ -80,6 +80,7 @@ def test_module_import_with_various_non_minimal_deps(pydantic_version: str): "aiohttp_cors", "pydantic", "grpc", + "memray", ] for i in range(len(optional_modules)): for install_modules in itertools.combinations(optional_modules, i): diff --git a/python/requirements.txt b/python/requirements.txt index 59858f8f177f..3c2c2c6ce01b 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -58,3 +58,4 @@ pandas>=1.3 pydantic!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,<3 # Serve users can use pydantic<2 py-spy>=0.2.0 watchfiles +memray diff --git a/python/setup.py b/python/setup.py index 0ae613aaef7e..cbf9b2189f86 100644 --- a/python/setup.py +++ b/python/setup.py @@ -250,6 +250,7 @@ def get_packages(self): "prometheus_client >= 0.7.1", "smart_open", "virtualenv >=20.0.24, !=20.21.1", # For pip runtime env. + "memray", ], "client": [ # The Ray client needs a specific range of gRPC to work: