Parked: build a rootless Red-DiscordBot image (arm64) for Frostlink #52
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Status: parked — needs review before any work starts.
Self-host a Red-DiscordBot instance on Frostlink (single-node ARM64 Talos, Oracle Cloud — always reachable). Instead of a community image that runs as root, build our own image in this repo following home-operations/containers conventions.
Researched 2026-09-29. Nothing built, applied, or committed.
Decisions already made
tools(currently only atuin). No new namespace.OneDrive/Documents/duskbot-temp) is not migrated — too old, and its cog requirements were built for Python 3.8 on x86_64.phasecorex/red-discordbotorghcr.io/rhomelab/red-discordbot(both start as root and drop privileges themselves; phasecorex exits if started non-root, sorunAsNonRoot+ read-only root breaks both).Open decision — BLOCKER: arm64 builds
This repo's pipeline can only produce amd64 today:
platforms = ["linux/amd64"]indocker-bake.hclimage-all.Artemis-Cluster/kubernetes/apps/forgejo/buildkit). Every Artemis node isamd64(checked live) and no QEMU/binfmt is configured.pip installin the Dockerfile, which executes on the target platform — flipping the platform list alone will not work.Image design
Base:
python:3.11-slim(Debian), not Alpine.python:3.11-alpineexists with arm64, and Red's own 13 compiled deps all have musllinux aarch64 wheels, but cogs pip-install their requirements at runtime. Example: matplotlib has nomusllinuxaarch64 wheel for cp311 (verified on PyPI — onlymanylinux_2_28_aarch64), so it would compile inside a read-only container and fail. home-operations usespython:*-slimfor the same reason (their esphome image).home-operations rules applied:
65534(nobody:nogroup), config under/config.catatonit→entrypoint.sh→exec redbot .... Single process, logs to stdout./tmpas emptyDir.rollingtags, digest-pinned, amd64 + arm64.VERSIONindocker-bake.hclwith a Renovate# renovate: datasource=pypi depName=Red-DiscordBotcomment (like forgesync).Config via env/flags (verified in Red 3.5.24 source):
RED_TOKENenv var (redbot/__main__.py:348) — from 1Password ExternalSecret, never written to disk.--prefixflag only (no env var). Owner:--owner. Add--no-prompt.PIP_NO_CACHE_DIR=1so pip doesn't write to HOME.$XDG_CONFIG_HOME/Red-DiscordBot/config.json. A normal run only reads it (onlyredbot-setup,--edit,--no-instancewrite it), so it can be a read-only ConfigMap from Git.Filesystem layout on Frostlink
$XDG_CONFIG_HOME/Red-DiscordBot/config.jsonsettings.json,Audio/Audio.dbcogs/RepoManager/repos,cogs/CogManager/cogs,cogs/Downloader/libcore/logs,Audio/logs,/tmpWhy cogs can't be emptyDir: Red finds cog repos by scanning the repos folder (URLs live only inside each clone, not in settings). On boot, any cog that is missing or fails to import is permanently removed from the saved load list, and
[p]cog installthen refuses ("already installed") until uninstalled. Red has no reinstall-on-startup.cogs/Downloader/libis only repopulated by[p]cog install/update,[p]pipinstall, or[p]cog reinstallreqs.Metrics
discord-ext-prometheus(discord.py extension, last activity 2025-02)./metrics— guilds, latency, command counts, errors. Bake it into the image (--cog-path+--load-cogs) so it's versioned in Git; user cogs stay on the PVC.PodMonitor— Frostlink already uses VictoriaMetrics operator and PodMonitors (seekubernetes/apps/database/postgres/cluster/podmonitor.yaml).Frostlink deploy notes
kubernetes/apps/matrix/continuwuity/(single container + Kopiur-backed PVC + 1Password ExternalSecret). Drop its route/service/config templating.openebs-zfs. Kopiur component atkubernetes/components/kopiur/takesKOPIUR_APP(notAPP).Recreatestrategy.mainafter test-apply (PRs are Renovate-only).Risks / gotchas
[p]llset heapsize 512M, or run Lavalink as its own Deployment. Audio also needs Java 17/21 in the image, which a no-audio image avoids.duskbot-temp/core/settings.jsonon OneDrive and possibly incore/logs. Generate a new one and store it in 1Password.redbot-setup restoreonly exists in unreleased 3.5.25 — irrelevant since we're starting fresh.Order of work
apps/red-discordbot/— Dockerfile (python:3.11-slim, UID 65534, catatonit),entrypoint.sh,docker-bake.hclwith pinnedVERSION+ Renovate commenttools/red-discordbot— ks.yaml, HelmRelease, OCIRepository, ExternalSecret, ConfigMap (config.json), Kopiur PVC, emptyDirs, PodMonitorReference
ghcr.io/rhomelab/red-discordbot:3.5.24,phasecorex/red-discordbotarm64 build research — parked 2026-10-11, nothing built or changed.
Recommended pipeline shape: build each arch on its own native builder, push by digest, merge with
docker buildx imagetools create, cosign-sign the index. Keep a separate registry cache per app and arch, written on release builds only. This matches how home-operations/containers does it. Don't use a single multi-node buildx builder: registry cache export keeps only the last platform's cache (buildx#1044), and one failed arch fails the whole build.Option A — buildkitd on Frostlink (native arm64), ~3–4h. ClusterMesh and Headscale have removed the network blocker:
10.42.0.0/16 → 10.244.0.0/24on all ports, so Artemis Tekton pods can reach a Frostlink pod.policyDefaultLocalClusteris on.cilium-clustermesh-ca) to issue the Frostlink server cert and the Artemis client cert.privileged, because Frostlink defaults tobaseline.user.max_user_namespacesis already set on both clusters.registry.dcunha.iothrough the towonel edge.Option B — all on Artemis, ~1–2h.
FROM --platform=$BUILDPLATFORMplus xx.forgejo-runneralready does this;forgesyncwould need the same change.RUNsteps (apk add) can run.pip installfor Red would run under QEMU. That is still minutes, not hours, because its compiled deps have aarch64 wheels.Either option also needs:
linux/arm64added toimage-allin eachdocker-bake.hcl.buildx-bakeStepAction and thecontainer-build/container-validatepipelines changed to per-arch builds plus a merge step.enable-api-fields: beta.Artemis-Cluster/.agents/references/tekton-ci.md.