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
Globally available description of a ‘managed node’.
- class State
An enumeration.
- __init__(state: State = State.NULL, h_uid: Optional[int] = None, name: str = '', ip_addrs: Optional[list[str]] = None, port: Optional[int] = None, num_cpus: int = 0, physical_mem: int = 0, is_primary: bool = False, host_id: Optional[int] = None, shep_cd: str = '', overlay_cd: str = '', host_name: str = '', cpu_devices: Optional[list[int]] = None, accelerators: Optional[AcceleratorDescriptor] = None)
- classmethod get_localservices_node_conf(name: Optional[str] = None, host_name: Optional[str] = None, host_id: Optional[int] = None, is_primary: bool = False, ip_addrs: Optional[list[str]] = None, shep_cd: Optional[str] = None, cpu_devices: Optional[list[int]] = None, accelerators: Optional[AcceleratorDescriptor] = 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] = (6565, 7565))
Return NodeDescriptor with IP for given network prefix, hostname, and host ID
- Parameters
- Raises
RuntimeError – RuntimeError: Unable to find network prefix matching requested
- Returns
Filled with local network info for node of execution
- Return type