chi.hardware¶
The chi.hardware
provides a set of functions and classes for interacting the hardware discovery module of Chameleon.
- class chi.hardware.Device(device_name: str, device_type: str, supported_device_profiles: List[str], authorized_projects: Set[str], owning_project: str, uuid: str, reservable: bool)[source]¶
A dataclass for device information directly from the hardware browser.
- next_free_timeslot(minimum_hours: int = 1) Tuple[datetime, datetime | None] [source]¶
Finds the next available timeslot for the device using the Blazar client.
- Parameters:
minimum_hours (int, optional) – The minimum number of hours for this timeslot.
- Returns:
A tuple containing the start and end datetime of the next available timeslot. If no timeslot is available, returns (end_datetime_of_last_allocation, None).
- class chi.hardware.Node(site: str, name: str, type: str, architecture: dict, bios: dict, cpu: dict, gpu: dict, main_memory: dict, network_adapters: List[dict], placement: dict, storage_devices: List[dict], uid: str, version: str, reservable: bool)[source]¶
Represents the Chameleon hardware that goes into a single node. A dataclass for node information directly from the hardware browser.
- next_free_timeslot(minimum_hours: int = 1) Tuple[datetime, datetime | None] [source]¶
Finds the next available timeslot for the hardware using the Blazar client.
- Parameters:
minimum_hours (int, optional) – The minimum number of hours for this timeslot.
- Returns:
A tuple containing the start and end datetime of the next available timeslot. If no timeslot is available, returns (end_datetime_of_last_allocation, None).
- chi.hardware.get_device_types() List[str] [source]¶
Retrieve a list of unique device types.
- Returns:
A list of unique device types.
- Return type:
List[str]
- chi.hardware.get_devices(device_type: str | None = None, filter_reserved: bool = False, filter_unauthorized: bool = True) List[Device] [source]¶
Retrieve a list of devices based on the specified criteria.
- Parameters:
- Returns:
A list of Device objects that match the specified criteria.
- Return type:
List[Device]
- chi.hardware.get_node_types() List[str] [source]¶
Retrieve a list of unique node types.
- Returns:
A list of unique node types.
- Return type:
List[str]
- chi.hardware.get_nodes(all_sites: bool = False, filter_reserved: bool = False, gpu: bool | None = None, min_number_cpu: int | None = None, node_type: str | None = None) List[Node] [source]¶
Retrieve a list of nodes based on the specified criteria.
- Parameters:
all_sites (bool, optional) – Flag to indicate whether to retrieve nodes from all sites. Defaults to False.
filter_reserved (bool, optional) – Flag to indicate whether to filter out reserved nodes. Defaults to False.
gpu (bool, optional) – Flag to indicate whether to filter nodes based on GPU availability. Defaults to None.
min_number_cpu (int, optional) – Minimum number of CPU logical cores per node. Defaults to None.
node_type (str, optional) – The node type to filter by
- Returns:
A list of Node objects that match the specified criteria.
- Return type:
List[Node]