Skip to content

Commit

Permalink
Remove unnecessary handling of setproctitle and psutil. (#7702)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertnishihara committed Mar 23, 2020
1 parent 4d722bf commit 8b4c2b7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 27 deletions.
4 changes: 2 additions & 2 deletions ci/travis/test-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if [[ "$platform" == "linux" ]]; then
$PYTHON_EXE "$TEST_SCRIPT"

# Run the UI test to make sure that the packaged UI works.
$PIP_CMD install -q aiohttp google grpcio psutil requests setproctitle
$PIP_CMD install -q aiohttp google grpcio requests
$PYTHON_EXE "$UI_TEST_SCRIPT"

# Check that the other wheels are present.
Expand Down Expand Up @@ -88,7 +88,7 @@ elif [[ "$platform" == "macosx" ]]; then

if (( $(echo "$PY_MM >= 3.0" | bc) )); then
# Run the UI test to make sure that the packaged UI works.
$PIP_CMD install -q aiohttp google grpcio psutil requests setproctitle
$PIP_CMD install -q aiohttp google grpcio requests
$PYTHON_EXE "$UI_TEST_SCRIPT"
fi

Expand Down
2 changes: 0 additions & 2 deletions doc/requirements-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ opencv-python-headless
pandas
pickle5
pygments
psutil
pyyaml
recommonmark
redis
setproctitle
sphinx
sphinx-click
sphinx-copybutton
Expand Down
7 changes: 0 additions & 7 deletions doc/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,6 @@ via pip.
pip install ray[dashboard]
If you are using Anaconda and have trouble installing ``psutil`` or
``setproctitle``, the try

.. code-block:: bash
conda install psutil setproctitle
The command ``ray.init()`` or ``ray start --head`` will print out the address of
the dashboard. For example,

Expand Down
4 changes: 1 addition & 3 deletions python/ray/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ def __init__(self,
"""Initialize a RayTaskError."""
if proctitle:
self.proctitle = proctitle
elif setproctitle:
self.proctitle = setproctitle.getproctitle()
else:
self.proctitle = "ray_worker"
self.proctitle = setproctitle.getproctitle()
self.pid = pid or os.getpid()
self.ip = ip or ray.services.get_node_ip_address()
self.function_name = function_name
Expand Down
2 changes: 1 addition & 1 deletion python/ray/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ def start_dashboard(require_webui,
webui_dependencies_present = False
warning_message = (
"Failed to start the dashboard. The dashboard requires Python 3 "
"as well as 'pip install aiohttp psutil setproctitle grpcio'.")
"as well as 'pip install aiohttp grpcio'.")
if require_webui:
raise ImportError(warning_message)
else:
Expand Down
15 changes: 3 additions & 12 deletions python/ray/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,12 +677,6 @@ def init(address=None,
else:
driver_mode = SCRIPT_MODE

if setproctitle is None:
logger.warning(
"WARNING: Not updating worker name since `setproctitle` is not "
"installed. Install this with `pip install setproctitle` "
"(or ray[debug]) to enable monitoring of worker processes.")

if global_worker.connected:
if ignore_reinit_error:
logger.error("Calling ray.init() again after it has already been "
Expand Down Expand Up @@ -1142,8 +1136,7 @@ def connect(node,
job_id = JobID.nil()
# TODO(qwang): Rename this to `worker_id_str` or type to `WorkerID`
worker.worker_id = _random_string()
if setproctitle:
setproctitle.setproctitle("ray::IDLE")
setproctitle.setproctitle("ray::IDLE")
elif mode is LOCAL_MODE:
if job_id is None:
job_id = JobID.from_int(random.randint(1, 65535))
Expand Down Expand Up @@ -1369,11 +1362,9 @@ def disconnect(exiting_interpreter=False):

@contextmanager
def _changeproctitle(title, next_title):
if setproctitle:
setproctitle.setproctitle(title)
setproctitle.setproctitle(title)
yield
if setproctitle:
setproctitle.setproctitle(next_title)
setproctitle.setproctitle(next_title)


def register_custom_serializer(cls,
Expand Down

0 comments on commit 8b4c2b7

Please sign in to comment.