[Core] Allow IPv6 in VLLM_HOST_IP with zmq (#8575)

Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
Russell Bryant
2024-09-23 15:15:41 -04:00
committed by GitHub
parent 9b0e3ec970
commit b05f5c9238
2 changed files with 15 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import datetime
import enum
import gc
import inspect
import ipaddress
import os
import random
import socket
@@ -533,6 +534,14 @@ def get_ip() -> str:
return "0.0.0.0"
def is_valid_ipv6_address(address: str) -> bool:
try:
ipaddress.IPv6Address(address)
return True
except ValueError:
return False
def get_distributed_init_method(ip: str, port: int) -> str:
# Brackets are not permitted in ipv4 addresses,
# see https://github.com/python/cpython/issues/103848