mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 01:59:23 +08:00
[core] Better support multi-nic environments by respecting user-provided IP (#8512)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user