mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[Cleanup] Use Constant instead of "RAY_ADDRESS" in code (#16257)
This commit is contained in:
parent
1c94906efc
commit
c2f5ca399f
2 changed files with 6 additions and 6 deletions
|
@ -235,10 +235,8 @@ def get_ray_address_to_use_or_die():
|
|||
Returns:
|
||||
A string to pass into `ray.init(address=...)`
|
||||
"""
|
||||
if "RAY_ADDRESS" in os.environ:
|
||||
return os.environ.get("RAY_ADDRESS")
|
||||
|
||||
return find_redis_address_or_die()
|
||||
return os.environ.get(ray_constants.RAY_ADDRESS_ENVIRONMENT_VARIABLE,
|
||||
find_redis_address_or_die())
|
||||
|
||||
|
||||
def find_redis_address_or_die():
|
||||
|
|
|
@ -711,9 +711,11 @@ def init(
|
|||
logger.debug("Could not import resource module (on Windows)")
|
||||
pass
|
||||
|
||||
if "RAY_ADDRESS" in os.environ:
|
||||
address_env_var = os.environ.get(
|
||||
ray_constants.RAY_ADDRESS_ENVIRONMENT_VARIABLE)
|
||||
if address_env_var:
|
||||
if address is None or address == "auto":
|
||||
address = os.environ["RAY_ADDRESS"]
|
||||
address = address_env_var
|
||||
# Convert hostnames to numerical IP address.
|
||||
if _node_ip_address is not None:
|
||||
node_ip_address = services.address_to_ip(_node_ip_address)
|
||||
|
|
Loading…
Add table
Reference in a new issue