HPC Libs
- José Julián Espina Del Ángel
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.is_container
-
- Last updated 10 Jul 2024
- Revision Library version 0.1
Detect if machine is a container instance.
Even though Juju supports using LXD containers as the backing cloud for deploying charmed operators, not all HPC applications work within system containers, and some need additional configuration. This simple charm library provides utilities for identifying the virtualization runtime for a charmed operator.
Example Usage:
from charms.hpc_libs.v0.is_container import is_container
class ApplicationCharm(CharmBase):
def __init__(self, *args):
super().__init__(*args)
self.framework.observe(self.on.install, self._on_install)
def _on_install(self, _: InstallEvent) -> None:
if is_container():
self.unit.status = BlockedStatus("app does not support container runtime")
# Proceed with installation.
...
class UnknownVirtStateError
Description
Raise error if unknown virtualization state is returned. None
Methods
UnknownVirtStateError. message( self )
Description
Return message passed as argument to exception. None
def is_container()
Detect if the machine is a container instance.