address link2xt review comments

This commit is contained in:
holger krekel
2026-03-07 21:16:49 +01:00
parent ea7b875eb1
commit cd16ef8c4a
3 changed files with 7 additions and 12 deletions

View File

@@ -230,12 +230,7 @@ class Incus:
class Container: class Container:
"""Lightweight handle for an Incus container. """The base container handle wraps all interactions with incus."""
Carries the container *name* and provides convenience methods
for running commands, managing lifecycle, and extracting state
so callers don't repeat the name everywhere.
"""
def __init__(self, incus, name, domain=None, memory="100MiB"): def __init__(self, incus, name, domain=None, memory="100MiB"):
self.incus = incus self.incus = incus
@@ -385,6 +380,7 @@ class RelayContainer(Container):
def disable_ipv6(self): def disable_ipv6(self):
"""Disable IPv6 inside the container via sysctl.""" """Disable IPv6 inside the container via sysctl."""
# incus provides net.* virtalization
self.bash("""\ self.bash("""\
sysctl -w net.ipv6.conf.all.disable_ipv6=1 sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1 sysctl -w net.ipv6.conf.default.disable_ipv6=1
@@ -469,7 +465,7 @@ class RelayContainer(Container):
class DNSContainer(Container): class DNSContainer(Container):
"""Specialised container handle for the PowerDNS name server.""" """Container handle for the PowerDNS name server."""
def __init__(self, incus): def __init__(self, incus):
super().__init__(incus, DNS_CONTAINER_NAME, domain=DNS_DOMAIN) super().__init__(incus, DNS_CONTAINER_NAME, domain=DNS_DOMAIN)

View File

@@ -10,7 +10,7 @@ from cmdeploy.lxc import cli
from cmdeploy.lxc.incus import Incus from cmdeploy.lxc.incus import Incus
pytestmark = pytest.mark.skipif( pytestmark = pytest.mark.skipif(
not shutil.which("incus") or not shutil.which("lxc"), not shutil.which("incus"),
reason="incus/lxc not installed", reason="incus/lxc not installed",
) )

View File

@@ -93,13 +93,12 @@ CLI reference
2. ``cmdeploy run``: deploy chatmail services on each relay 2. ``cmdeploy run``: deploy chatmail services on each relay
3. publish ``localchat-relay`` image after first successful deploy 3. locally cache ``localchat-relay`` image after first successful deploy
4. ``cmdeploy dns --zonefile``: generate standard 4. ``cmdeploy dns --zonefile``: generate standard
BIND-format zone files, load full DNS records BIND-format zone files, load full DNS records
5. ``cmdeploy test``: run full test suite 5. ``cmdeploy test``: run full test suite
with ``-n4 -x``
By default creates, deploys, and tests both ``test0`` and ``test1`` By default creates, deploys, and tests both ``test0`` and ``test1``
for dual-domain federation testing (sets ``CHATMAIL_DOMAIN2=_test1.localchat``). for dual-domain federation testing (sets ``CHATMAIL_DOMAIN2=_test1.localchat``).
@@ -221,12 +220,12 @@ per-container ``chatmail-*.ini`` files, zone files, and ``ssh-config``.
The only state *outside* the repository is the Incus containers and images themselves The only state *outside* the repository is the Incus containers and images themselves
(managed via the ``incus`` CLI, labelled with ``user.localchat-managed=true``). (managed via the ``incus`` CLI, labelled with ``user.localchat-managed=true``).
Two cached images are published to the local Incus image store: The Incus image store retains the following snapshot images:
* ``localchat-base``: Debian 12 with openssh-server and Python (built on first run) * ``localchat-base``: Debian 12 with openssh-server and Python (built on first run)
* ``localchat-relay``: fully deployed relay snapshot, * ``localchat-relay``: fully deployed relay snapshot,
published after the first successful ``cmdeploy run``. cached after the first successful ``cmdeploy run``.
Subsequent relay containers launch from this image Subsequent relay containers launch from this image
so the deploy step is mostly no-ops (roughly 3× faster than a fresh deploy). so the deploy step is mostly no-ops (roughly 3× faster than a fresh deploy).
Relay containers are limited to **500 MiB RAM** and the DNS container to **100 MiB**. Relay containers are limited to **500 MiB RAM** and the DNS container to **100 MiB**.