HPC Libs
- HPC Charm Team
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 1 | 03 Jul 2024 |
juju deploy hpc-libs
Deploy universal operators easily with Juju, the Universal Operator Lifecycle Manager.
Platform:
charms.hpc_libs.v0.slurm_ops
-
- Last updated 11 Dec 2024
- Revision Library version 0.11
Abstractions for managing Slurm operations via snap or systemd.
This library contains manager classes that provide high-level interfaces for managing Slurm operations within charmed operators.
Note
This charm library depends on the charms.operator_libs_linux.v0.apt
charm library, which can
be imported by running charmcraft fetch-lib charms.operator_libs_linux.v0.apt
.
Example Usage
Managing the slurmctld
service
The SlurmctldManager
class manages the operations of the Slurm controller service.
You can pass the boolean keyword argument snap=True
or snap=False
to instruct
SlurmctldManager
to either use the Slurm snap package or Debian package respectively.
from charms.hpc_libs.v0.slurm_ops import SlurmctldManager
class ApplicationCharm(CharmBase):
# Application charm that needs to use the Slurm snap.
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self._slurmctld = SlurmctldManager(snap=True)
self.framework.observe(self.on.install, self._on_install)
def _on_install(self, _) -> None:
self._slurmctld.install()
self.unit.set_workload_version(self._slurmctld.version())
with self._slurmctld.config.edit() as config:
config.cluster_name = "cluster"
Index
class SlurmOpsError
Description
Exception raised when a slurm operation failed. None
Methods
SlurmOpsError. message( self )
Description
Return message passed as argument to exception. None
class SackdManager
Description
Manager for the sackd
service. None
Methods
SackdManager. __init__( self )
SackdManager. config_server( self )
Description
Get the configuration server address of this sackd
node. None
SackdManager. config_server( self , addr: str )
Set the configuration server address of this sackd
node.
Description
Sets the --conf-server
option for sackd
.
SackdManager. config_server( self )
Description
Unset the configuration server address of this sackd
node. None
class SlurmctldManager
Description
Manager for the slurmctld
service. None
Methods
SlurmctldManager. __init__( self )
class SlurmdManager
Description
Manager for the slurmd
service. None
Methods
SlurmdManager. __init__( self )
SlurmdManager. user( self )
Description
Get the SlurmdUser
. None
SlurmdManager. group( self )
Description
Get the SlurmdUser
group. None
SlurmdManager. config_server( self )
Description
Get the configuration server address of this slurmd
node. None
SlurmdManager. config_server( self , addr: str )
Set the configuration server address of this slurmd
node.
Description
Sets the --conf-server
option for slurmd
.
SlurmdManager. config_server( self )
Description
Unset the configuration server address of this slurmd
node. None
class SlurmdbdManager
Description
Manager for the slurmdbd
service. None
Methods
SlurmdbdManager. __init__( self )
SlurmdbdManager. mysql_unix_port( self )
Description
Get the URI of the unix socket slurmdbd
uses to communicate with MySQL. None
SlurmdbdManager. mysql_unix_port( self , socket_path )
Description
Set the unix socket URI that slurmdbd
will use to communicate with MySQL. None
SlurmdbdManager. mysql_unix_port( self )
Description
Delete the configured unix socket URI. None
class SlurmrestdManager
Description
Manager for the slurmrestd
service. None
Methods
SlurmrestdManager. __init__( self )
SlurmrestdManager. user( self )
Description
Get the user that the slurmrestd
service will run as. None
SlurmrestdManager. group( self )
Description
Get the group that the slurmrestd
service will run as. None