dragon.infrastructure.node_desc
A class that uniquely defines properties of a managed hardware node for infrastructure communication.
This is a stub at the moment, and should be extended for dynamic hardware allocations/elasticity aka The Cloud (TM) and more complex node properties (accelerators, networks, encryption).
Classes
Globally available description of a 'managed node'. |
- class NodeDescriptor
Bases:
object
Globally available description of a ‘managed node’.
- class State
Bases:
IntEnum
An enumeration.
- NULL = 1
- DISCOVERABLE = 2
- PENDING = 3
- ACTIVE = 4
- IDLE = 5
- ERROR = 6
- DOWN = 7
- __init__(state: State = State.NULL, h_uid: int | None = None, name: str = '', ip_addrs: list[str] | None = None, fabric_ep_addrs_available: bool = False, fabric_ep_addrs: list[str] | None = None, fabric_ep_addr_lens: list[int] | None = None, port: int | None = None, num_cpus: int = 0, physical_mem: int = 0, is_primary: bool = False, host_id: int | None = None, shep_cd: str = '', overlay_cd: str = '', host_name: str = '', cpu_devices: list[int] | None = None, accelerators: AcceleratorDescriptor | None = None)
- classmethod get_localservices_node_conf(name: str | None = None, host_name: str | None = None, host_id: int | None = None, is_primary: bool = False, ip_addrs: list[str] | None = None, shep_cd: str | None = None, cpu_devices: list[int] | None = None, accelerators: AcceleratorDescriptor | None = None)
Return a NodeDescriptor object for Local Services to pass into its SHChannelsUp message
Populates the values in a NodeDescriptor object that Local Services needs to provide to the launcher frontend as part of infrastructure bring-up
- Parameters:
name (Optional[str], optional) – Name for node. Often resorts to hostname, defaults to None
host_name (Optional[str], optional) – Hostname for the node, defaults to gethostname()
host_id (Optional[int], optional) – unique host ID of this node, defaults to get_host_id()
is_primary (bool, optional) – denote if this is the primary node running GS, defaults to False
ip_addrs (Optional[list[str]], optional) – IP addresses used for backend messaging by transport agents, defaults to [“127.0.0.1”]
shep_cd (Optional[str], optional) – Channel descriptor for this node’s Local Services, defaults to None
cpu_devices (Optional[list[int]], optional) – List of CPUs and IDs on this node, defaults to list(os.sched_getaffinity(0))
accelerators (Optional[AcceleratorDescriptor], optional) – List of any accelerators available on this node, defaults to find_accelerators()
- classmethod get_local_node_network_conf(network_prefix: str = '^(hsn|ipogif|ib)\\d+$', port_range: Tuple[int, int] | int = (6565, 7565))
Return NodeDescriptor with IP for given network prefix, hostname, and host ID
- Parameters:
network_prefix (str, optional) – network prefix used to find IP address of this node. Defaults to DEFAULT_TRANSPORT_NETIF
port_range (tuple[int, int] | int, optional) – Port and port range to use for communication. Defaults to (DEFAULT_OVERLAY_NETWORK_PORT, DEFAULT_OVERLAY_NETWORK_PORT+DEFAULT_PORT_RANGE) If just the port is passed as an int, the range will be assumed to be DEFAULT_PORT_RANGE
- Returns:
Filled with local network info for node of execution
- Return type:
- property sdesc
- get_sdict()
- classmethod from_sdict(sdict)