apps.utils.system_info ================================ .. autoapi-nested-parse:: Utility class for fetching data and interacting with the parent system. Module Contents --------------- .. py:class:: Shell Methods for interacting with the runtime shell. .. py:method:: readchar() -> str :staticmethod: Read a single character from the command line :returns: The character entered by the user .. py:method:: run_command(command: str, include_err: bool = False) -> Union[str, Tuple[str, str]] :staticmethod: Run a command in a dedicated shell :param command: The command to execute as a string :param include_err: Include output to stderr in the returned values :returns: The output to stdout and (optionally) stderr .. py:class:: Slurm Class for fetching Slurm config data. .. py:attribute:: ignore_clusters .. py:attribute:: ignore_partitions .. py:method:: is_installed() -> bool :staticmethod: Return whether ``sacctmgr`` is installed on the host machine .. py:method:: get_cluster_names(include_all_clusters: bool = False) -> Set[str] :classmethod: Return cluster names configured with slurm :param include_all_clusters: Include clusters that are otherwise marked as ignored :returns: A set of cluster names .. py:method:: get_partition_names(cluster_name: str, include_all_partitions: bool = False) -> Set[str] :classmethod: Return a tuple of partition names associated with a given slurm cluster :param cluster_name: The name of a slurm cluster :param include_all_partitions: Include partitions that are otherwise marked as ignored :returns: A set of partition names .. py:method:: check_slurm_account_exists(account_name: str) -> None :classmethod: Check if the provided slurm account exists .. py:method:: get_cluster_usage_by_user(account_name: str, start_date: datetime.date, cluster: str) -> dict :classmethod: Return the total billable usage in hours for a given Slurm account :param account_name: The name of the account to get usage for :param start_date: date object for the start date to supply to sreport :param cluster: The name of the cluster to get usage on :returns: An integer representing the total (historical + current) billing TRES hours usage from sshare