diff --git a/lib/charms/hpc_libs/v0/slurm_ops.py b/lib/charms/hpc_libs/v0/slurm_ops.py index fa07d21..b48f0a3 100644 --- a/lib/charms/hpc_libs/v0/slurm_ops.py +++ b/lib/charms/hpc_libs/v0/slurm_ops.py @@ -84,7 +84,7 @@ def _on_install(self, _) -> None: # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 4 +LIBPATCH = 5 # Charm library dependencies to fetch during `charmcraft pack`. PYDEPS = ["pyyaml>=6.0.1"] @@ -180,6 +180,7 @@ class ServiceType(Enum): """Type of Slurm service to manage.""" MUNGED = "munged" + PROMETHEUS_EXPORTER = "slurm-prometheus-exporter" SLURMD = "slurmd" SLURMCTLD = "slurmctld" SLURMDBD = "slurmdbd" @@ -285,6 +286,13 @@ def generate_key(self) -> None: _mungectl("key", "generate") +class PrometheusExporterManager(ServiceManager): + """Manage `slurm-prometheus-exporter` service operations.""" + + def __init__(self) -> None: + self._service = ServiceType.PROMETHEUS_EXPORTER + + class SlurmManagerBase(ServiceManager): """Base manager for Slurm services.""" @@ -292,6 +300,7 @@ def __init__(self, service: ServiceType) -> None: self._service = service self.config = ConfigurationManager(service.config_name) self.munge = MungeManager() + self.exporter = PrometheusExporterManager() @property def hostname(self) -> str: