Skip to content

Containers, Namespaces & cgroups

For both roles: Warmwind runs each user session in an isolated container (Kubernetes + Docker). The Linux Platform role needs deep namespace/cgroup knowledge for security hardening. The Backend role needs Docker fluency for deployment and service architecture.

How Containers Work (Linux Primitives)

Containers are not VMs. They're processes with restricted views of the system, built from three kernel features:

graph LR
    Container["Container"] --> NS["Namespaces"]
    Container --> CG["cgroups"]
    Container --> SEC["seccomp"]
    NS --> PID["PID"]
    NS --> NET["Network"]
    NS --> MNT["Mount"]
    NS --> USER["User"]
    CG --> MEM["Memory"]
    CG --> CPU["CPU"]

Namespaces (isolation)

Namespace What it isolates Syscall flag
pid Process IDs (container has its own PID 1) CLONE_NEWPID
net Network stack (interfaces, routing, iptables) CLONE_NEWNET
mnt Filesystem mounts CLONE_NEWNS
user UID/GID mapping (root in container ≠ root on host) CLONE_NEWUSER
uts Hostname CLONE_NEWUTS
ipc System V IPC, POSIX message queues CLONE_NEWIPC
cgroup cgroup root view CLONE_NEWCGROUP

Namespaces = your OCI runtime

When your bash framework calls docker run, the OCI runtime (runc/youki) calls clone() with these exact CLONE_NEW* flags. Your framework already orchestrates this -- now you understand what's underneath.

cgroups v2 (resource limits)

# Limit container to 2 GB RAM and 1.5 CPUs:
echo "2G" > /sys/fs/cgroup/my_container/memory.max
echo "150000 100000" > /sys/fs/cgroup/my_container/cpu.max  # 150ms per 100ms period

Warmwind's Container Model

Each AI agent session is a Kubernetes pod containing: - Custom Linux distro (read-only rootfs) - Sway compositor (Wayland) - Chromium (kiosk mode) - WayVNC (streaming) - Persistent user storage (volume mount)

The container boots in seconds (minimal distro, no hardware drivers).

Glossary

cgroup (control group)
Kernel mechanism to limit, account, and isolate resource usage (CPU, memory, I/O) of a collection of processes. v2 is the modern unified hierarchy; v1 had separate hierarchies per resource.
seccomp-bpf
Secure Computing mode with BPF filters. Restricts which system calls a process can make. Chromium uses this heavily -- its renderer processes can only make ~60 out of ~400+ syscalls.
overlay filesystem (overlayfs)
Union mount filesystem used by Docker. Layers a writable "upper" dir on top of read-only "lower" dirs. Container images are stacks of read-only layers; the running container adds a writable layer on top.
Kubernetes pod
The smallest deployable unit in Kubernetes. One or more containers sharing a network namespace and storage volumes. Warmwind likely runs one pod per user session.