Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dashboard] Fixes dashboard issues when environments have set http_proxy #12598

Merged
merged 6 commits into from
Jan 22, 2021

Conversation

ConeyLiu
Copy link
Contributor

@ConeyLiu ConeyLiu commented Dec 3, 2020

Why are these changes needed?

Fixes dashboard issues when environments have set http_proxy. Without this patch:

In [1]: import ray

In [2]: address_info = ray.init(include_dashboard=True)
2020-12-03 15:45:03,102 INFO services.py:1171 -- View the Ray dashboard at http:https://127.0.0.1:8265

In [3]: 2020-12-03 15:45:05,846 WARNING worker.py:1011 -- The agent on node xyliu failed with the following error:
Traceback (most recent call last):
  File "/home/lxy/git_repository/ray/python/ray/new_dashboard/agent.py", line 300, in <module>
    loop.run_until_complete(agent.run())
  File "/home/lxy/miniconda3/envs/ray/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "/home/lxy/git_repository/ray/python/ray/new_dashboard/agent.py", line 174, in run
    agent_ip_address=self.ip))
  File "/home/lxy/miniconda3/envs/ray/lib/python3.7/site-packages/grpc/experimental/aio/_call.py", line 285, in __await__
    self._cython_call._status)
grpc.experimental.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
        status = StatusCode.UNKNOWN
        details = "Stream removed"
        debug_error_string = "{"created":"@1606981505.836508871","description":"Error received from peer ipv4:10.239.4.100:913","file":"src/core/lib/surface/call.cc","file_line":1056,"grpc_message":"Stream removed","grpc_status":2}"
>

(pid=raylet) Traceback (most recent call last):
(pid=raylet)   File "/home/lxy/git_repository/ray/python/ray/new_dashboard/agent.py", line 310, in <module>
(pid=raylet)     raise e
(pid=raylet)   File "/home/lxy/git_repository/ray/python/ray/new_dashboard/agent.py", line 300, in <module>
(pid=raylet)     loop.run_until_complete(agent.run())
(pid=raylet)   File "/home/lxy/miniconda3/envs/ray/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
(pid=raylet)     return future.result()
(pid=raylet)   File "/home/lxy/git_repository/ray/python/ray/new_dashboard/agent.py", line 174, in run
(pid=raylet)     agent_ip_address=self.ip))
(pid=raylet)   File "/home/lxy/miniconda3/envs/ray/lib/python3.7/site-packages/grpc/experimental/aio/_call.py", line 285, in __await__
(pid=raylet)     self._cython_call._status)
(pid=raylet) grpc.experimental.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
(pid=raylet)    status = StatusCode.UNKNOWN
(pid=raylet)    details = "Stream removed"
(pid=raylet)    debug_error_string = "{"created":"@1606981505.836508871","description":"Error received from peer ipv4:10.239.4.100:913","file":"src/core/lib/surface/call.cc","file_line":1056,"grpc_message":"Stream removed","grpc_status":2}"
(pid=raylet) >
In [3]: 2020-12-03 15:45:07,709 WARNING worker.py:1011 -- The agent on node xyliu failed with the following error:
Traceback (most recent call last):
  File "/home/lxy/git_repository/ray/python/ray/new_dashboard/agent.py", line 300, in <module>
    loop.run_until_complete(agent.run())
  File "/home/lxy/miniconda3/envs/ray/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "/home/lxy/git_repository/ray/python/ray/new_dashboard/agent.py", line 174, in run
    agent_ip_address=self.ip))
  File "/home/lxy/miniconda3/envs/ray/lib/python3.7/site-packages/grpc/experimental/aio/_call.py", line 285, in __await__
    self._cython_call._status)
grpc.experimental.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
        status = StatusCode.UNKNOWN
        details = "Stream removed"
        debug_error_string = "{"created":"@1606981507.704827237","description":"Error received from peer ipv4:10.239.4.100:913","file":"src/core/lib/surface/call.cc","file_line":1056,"grpc_message":"Stream removed","grpc_status":2}"
>

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@ConeyLiu
Copy link
Contributor Author

ConeyLiu commented Dec 7, 2020

Hi @mfitton, is there any way to trigger the dashboard UT tests locally?

@mfitton
Copy link
Contributor

mfitton commented Dec 8, 2020

Hey @ConeyLiu, from your ray directory you can run pytest dashboard/tests to execute the top-level unit-tests and also pytest dashboard/modules/MODULE_NAME/tests for tests in individual modules.

@ConeyLiu
Copy link
Contributor Author

ConeyLiu commented Dec 8, 2020

Hi @mfitton, I got the following errors:

ImportError while loading conftest '/Users/xianyang/git/ray/dashboard/tests/conftest.py'.
dashboard/tests/conftest.py:3: in <module>
    from ray.tests.conftest import *  # noqa
E   ModuleNotFoundError: No module named 'ray.tests'

With bazel test python/ray/new_dashboard/..., I got similar errors.

@mfitton
Copy link
Contributor

mfitton commented Dec 8, 2020

@ConeyLiu hm, strange. Okay, well the dashboard code is symlinked to ray/python/ray/new_dashboard, so if you use that as the base rather than ray/dashboard as I had mentioned above, it should definitely be able to find the conftest file, as it'll be in the same hierarchy.

Not sure why running them at the other level doesn't work in your install, sorry for the inconvenience.

@ConeyLiu
Copy link
Contributor Author

ConeyLiu commented Dec 9, 2020

Hi @mfitton, thanks for the help.

@@ -71,7 +70,7 @@ async def _update_stubs(self, change):
node_id, node_info = change.new
address = "{}:{}".format(node_info["nodeManagerAddress"],
int(node_info["nodeManagerPort"]))
channel = aiogrpc.insecure_channel(address)
channel = dashboard_utils.create_insecure_channel(address)
Copy link
Contributor

@fyrestone fyrestone Jan 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's cleaner to set an option here instead of providing a special channel. If the existing API cannot meet our requirements, then we create a new API.

options = (("grpc.enable_http_proxy", 0), )
channel = aiogrpc.insecure_channel(address, options=options)

@rkooo567 May be these two lines are enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am OK to change it back. And create_insecure_channel is just a wrapper function.

@rkooo567
Copy link
Contributor

cc @fyrestone Please ping me after you approve the PR!

Copy link
Contributor

@fyrestone fyrestone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rkooo567 rkooo567 merged commit 4ecd29e into ray-project:master Jan 22, 2021
@ConeyLiu ConeyLiu deleted the ui_proxy branch January 25, 2021 05:43
fishbone pushed a commit to fishbone/ray that referenced this pull request Feb 16, 2021
…oxy (ray-project#12598)

* fixes ray start with http_proxy

* format

* fixes

* fixes

* increase timeout

* address comments
fishbone added a commit to fishbone/ray that referenced this pull request Feb 16, 2021
fishbone added a commit to fishbone/ray that referenced this pull request Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants