Begin Firecracker microVM support

This commit is contained in:
Joakim Hellsén 2026-04-25 06:34:37 +02:00
commit ed8ad1bee9
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
11 changed files with 290 additions and 7 deletions

59
config/checks.py Normal file
View file

@ -0,0 +1,59 @@
from __future__ import annotations
import shutil
from typing import TYPE_CHECKING
from django.conf import settings
from django.core.checks import Tags
from django.core.checks import Warning as DjangoWarning
from django.core.checks import register
if TYPE_CHECKING:
from django.core.checks import CheckMessage
REQUIRED_DEV_COMMANDS: tuple[str, ...] = (
"uname",
"curl",
"basename",
"grep",
"sort",
"tail",
"wget",
"unsquashfs",
"ssh-keygen",
"sudo",
"chown",
"truncate",
"mkfs.ext4",
"e2fsck",
)
@register(Tags.compatibility)
def check_required_dev_commands(*_: object, **__: object) -> list[CheckMessage]:
"""Warn in dev-like runtime when host tooling for init script is missing.
Returns:
A list of CheckMessage objects representing any issues found.
"""
if not (settings.DEBUG or getattr(settings, "TESTING", False)):
return []
missing_commands: list[str] = [
command for command in REQUIRED_DEV_COMMANDS if shutil.which(command) is None
]
if not missing_commands:
return []
return [
DjangoWarning(
"Missing host commands used by get_rootfs.bash.",
hint=(
"Dev-only tooling missing: "
f"{', '.join(missing_commands)}. "
"These are required for local VM/rootfs setup during development, not production runtime."
),
id="tussilago.W001",
),
]