[core] Better support multi-nic environments by respecting user-provided IP (#8512)

This commit is contained in:
Xianyang Liu
2020-06-26 03:03:12 +08:00
committed by GitHub
parent 46962f5db1
commit 0bfcc2e5ba
4 changed files with 28 additions and 4 deletions
+3
View File
@@ -324,6 +324,9 @@ def get_node_ip_address(address="8.8.8.8:53"):
Returns:
The IP address of the current node.
"""
if ray.worker._global_node is not None:
return ray.worker._global_node.node_ip_address
ip_address, port = address.split(":")
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try: