Skip to content

Commit

Permalink
Merge branch 'main' into k-mistele/add-compose-configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Mistele authored Jan 28, 2025
2 parents 5bf8fff + 86f3b37 commit e0ec0b3
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 428 deletions.
10 changes: 6 additions & 4 deletions node/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ async def graceful_shutdown(self, sig=None):
self.shutdown_event.set()

try:
if self.communication_protocol == "http":
logger.info("HTTP server shutting down, attempting to unregister node...")
if self.communication_protocol == "http" and REGISTER_NODE_WITH_HUB:
logger.info("HTTP server shutting down, will unregister node")
# Add timeout to unregister operation
try:
await asyncio.wait_for(self.unregister_node(), timeout=20.0)
Expand All @@ -188,6 +188,8 @@ async def graceful_shutdown(self, sig=None):
logger.error("Node unregistration timed out")
except Exception as e:
logger.error(f"Failed to unregister node during shutdown: {e}")
else:
logger.info("HTTP server shutting down, node unregistration not required")

# Handle server-specific shutdown
if isinstance(self.server, HTTPServer):
Expand Down Expand Up @@ -226,8 +228,8 @@ def signal_handler(sig):
lambda s=sig: signal_handler(s)
)

if REGISTER_NODE_WITH_HUB:
logger.info(f"Registering node with hub")
if REGISTER_NODE_WITH_HUB and node_server.communication_protocol == "http":

if node_server.node_config.ip == "localhost":
logger.error("Unable to register a localhost server with the hub")
raise Exception("Cannot register node on hub with NODE_IP localhost. Either change REGISTER_NODE_WITH_HUB to False, or set NODE_IP to your public IP address or domain name in config.py.")
Expand Down
Empty file removed ops/ansible/.env.hub.sample
Empty file.
Empty file removed ops/ansible/.env.node.sample
Empty file.
3 changes: 0 additions & 3 deletions ops/ansible/ansible.cfg

This file was deleted.

347 changes: 0 additions & 347 deletions ops/ansible/deploy.yml

This file was deleted.

2 changes: 0 additions & 2 deletions ops/ansible/inventory

This file was deleted.

3 changes: 0 additions & 3 deletions ops/ansible/requirements.yaml

This file was deleted.

Loading

0 comments on commit e0ec0b3

Please sign in to comment.