Skip to content

Commit

Permalink
LIU-438: Update CompositeManager and Node handling of DIM default ports.
Browse files Browse the repository at this point in the history
  • Loading branch information
myxie committed Dec 26, 2024
1 parent 20b29ec commit 7fa4f69
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
8 changes: 5 additions & 3 deletions daliuge-engine/dlg/manager/composite_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ def __init__(
dmHosts: list[str] = None,
pkeyPath=None,
dmCheckTimeout=10,
dump_graphs=False
dump_graphs=False,
hosts_are_dim=True
):
"""
Creates a new CompositeManager. The sub-DMs it manages are to be located
Expand All @@ -164,7 +165,7 @@ def __init__(
:param: dmCheckTimeout The timeout used before giving up and declaring
a sub-DM as not-yet-present in a given host
"""
self._dmHosts = [Node(host) for host in dmHosts]
self._dmHosts = [Node(host, dim=hosts_are_dim) for host in dmHosts]
if self._dmHosts and self._dmHosts[0].rest_port_specified:
dmPort = -1
self._dmPort = dmPort
Expand Down Expand Up @@ -683,6 +684,7 @@ def __init__(self, dmHosts: list[str] = None, pkeyPath=None, dmCheckTimeout=10,
dmHosts=dmHosts,
pkeyPath=pkeyPath,
dmCheckTimeout=dmCheckTimeout,
dump_graphs=dump_graphs
dump_graphs=dump_graphs,
hosts_are_dim=True
)
logger.info("Created MasterManager for DIM hosts: %r", self._dmHosts)
14 changes: 11 additions & 3 deletions daliuge-engine/dlg/manager/manager_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"""

import logging
from dlg import constants
import dlg.constants as constants
from enum import IntEnum

logger = logging.getLogger(__name__)
Expand All @@ -44,12 +44,15 @@ class Node:
inter-node communication.
"""

def __init__(self, host: str):
def __init__(self, host: str, dim=False):
try:
chunks = host.split(':')
num_chunks = len(chunks)
self.host = constants.NODE_DEFAULT_HOSTNAME
self.port = constants.NODE_DEFAULT_REST_PORT
self.port = (
constants.ISLAND_DEFAULT_REST_PORT if dim
else constants.NODE_DEFAULT_REST_PORT
)
self.events_port = constants.NODE_DEFAULT_EVENTS_PORT
self.rpc_port = constants.NODE_DEFAULT_RPC_PORT
self._rest_port_specified = False
Expand Down Expand Up @@ -116,6 +119,11 @@ def __str__(self):
"""
return self.serialize()

def __repr__(self):
"""
"""
return self.serialize()

def __eq__(self, other):
if isinstance(other, Node):
return hash(self) == hash(other)
Expand Down

0 comments on commit 7fa4f69

Please sign in to comment.