Skip to content

Commit

Permalink
fixing load balancer (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
venkatajagannath authored Jul 21, 2024
1 parent b4d1a7b commit d3241ff
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ray_provider/hooks/ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,21 @@ def wait_for_load_balancer(

if lb_details:
hostname = lb_details["ip_or_hostname"]
if all(self._is_port_open(hostname, port["port"]) for port in lb_details["ports"]):
all_ports_open = True
for port in lb_details["ports"]:
if not self._is_port_open(hostname, port["port"]):
self.log.info(f"Port {port['port']} is not open yet.")
all_ports_open = False
break

if all_ports_open:
self.log.info("All ports are open. LoadBalancer is ready.")
return lb_details
else:
self.log.info("Not all ports are open. Waiting...")
else:
self.log.info("LoadBalancer details not available yet.")

self.log.info("Not all ports are open. Waiting...")
except AirflowException:
self.log.info("LoadBalancer service is not available yet...")

Expand Down

0 comments on commit d3241ff

Please sign in to comment.