chi.hardware

The chi.hardware provides a set of functions and classes for interacting the hardware discovery module of Chameleon.

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)[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_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. (Not Currently implemented)

  • 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]