-
Notifications
You must be signed in to change notification settings - Fork 9
build: run one base across the whole stack (debian:trixie-slim) #731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- | ||
| "ftw": minor | ||
| --- | ||
|
|
||
| Move the whole container stack to one base: Debian 13 "trixie" slim. | ||
|
|
||
| Core was `alpine:3.22`, the updater sidecar was `docker:27-cli` (also alpine), | ||
| and the optimizer was `python:3.12-slim-bookworm` — two libcs, three unrelated | ||
| base images and three security streams in one deployment. Core, updater and | ||
| optimizer now all sit on `debian:trixie-slim`, verified to share a single base | ||
| layer, so a host pulls that rootfs once and there is one suite to track. It also | ||
| matches the Raspberry Pi OS release the SD image is built from. | ||
|
|
||
| What the move buys: glibc, so the image can run ordinary prebuilt vendor | ||
| binaries, which musl cannot; a full userland, which makes `docker exec` | ||
| debugging on a live site practical; and `libnss-mdns` wired into | ||
| `/etc/nsswitch.conf`, so `.local` names resolve for glibc tools inside the | ||
| container — `getent hosts zap.local`, `curl`, `wget` — once an avahi socket is | ||
| mounted. Alpine has no NSS plugin mechanism at all, so none of that was | ||
| available before. | ||
|
|
||
| That covers tools in the image, not the FTW process itself: the binary is built | ||
| `CGO_ENABLED=0` and so never consults NSS. It stays fully static and still | ||
| cross-compiles on the build platform. | ||
|
|
||
| `wget` is now installed explicitly and asserted by the container boundary test. | ||
| It is contractual rather than incidental: `ftw-updater` `docker exec`s it inside | ||
| the core image to decide whether an update commits, and updaters already | ||
| deployed in the field will keep doing so. The zoneinfo database is also embedded | ||
| in the binary as a fallback, so a base image without `tzdata` can never silently | ||
| push `time.Local` to UTC and mis-time price and plan windows. | ||
|
|
||
| Size: the core image grows from about 53 MB to about 133 MB uncompressed. The | ||
| updater is unchanged at about 203 MB — `docker:27-cli` was never a small image — | ||
| and now shares its base with the other two, so the per-host download is well | ||
| below the nominal sum. | ||
|
|
||
| Data ownership is unchanged: the process still runs as the bare numeric uid 100 | ||
| / gid 101, and gid 101 is still what grants access to the optimizer's socket. | ||
|
|
||
| The optimizer is versioned independently and moves to 1.4.0, because its image | ||
| is a materially different artifact once the base changes. Its release workflow | ||
| verifies that a published image's revision label matches the commit it claims, | ||
| so the new base could not have shipped under the old version number at all. | ||
|
|
||
| The base is pinned to the `trixie` codename rather than a `stable` alias so a | ||
| major-version jump can never arrive silently on a rebuild. A new scheduled | ||
| `debian base currency` workflow watches for a newer Debian stable and opens a | ||
| tracking issue when one appears. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -180,6 +180,31 @@ Verify the broker address from the same network namespace as core, then inspect | |
| broker and driver logs. Device credentials and topic mappings belong to the | ||
| driver configuration. | ||
|
|
||
| ### `.local` names inside the container | ||
|
|
||
| The image ships `libnss-mdns`, so ordinary glibc tools inside the container — | ||
| `getent hosts zap.local` and `wget` — resolve `.local` the way they do on | ||
| the host. `apt` wires `mdns4_minimal [NOTFOUND=return]` into | ||
| `/etc/nsswitch.conf` when the package is installed; nothing else is needed at | ||
| build time. | ||
|
|
||
| At run time that path talks to `avahi-daemon` over a Unix socket, and a socket | ||
| is not shared by host networking the way a port is. Mount it explicitly: | ||
|
|
||
| ```yaml | ||
| volumes: | ||
| - /run/avahi-daemon/socket:/run/avahi-daemon/socket:ro | ||
| ``` | ||
|
|
||
| Only add this on a host that actually runs `avahi-daemon` — the Raspberry Pi | ||
| image does. Without the daemon Docker creates a *directory* at that path, which | ||
| resolves nothing and is harmless but confusing; `ls -l` there is the quickest | ||
| way to tell the two apart. | ||
|
|
||
| This makes the container's own tooling agree with the host. Whether the FTW | ||
| process itself resolves a device's `.local` name is a separate question, | ||
| answered by `internal/mdnsresolve`. | ||
|
Comment on lines
+204
to
+206
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The added troubleshooting guidance directs operators to AGENTS.md reference: AGENTS.md:L139-L140 Useful? React with 👍 / 👎. |
||
|
|
||
| ### Configuration rejected | ||
|
|
||
| Read the validation error, compare with | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,14 @@ import ( | |
| "syscall" | ||
| "time" | ||
|
|
||
| // Embed the zoneinfo database as a fallback. The image's system tree still | ||
| // wins whenever it is present; this exists so time.Local can never silently | ||
| // degrade to UTC and mis-time price and plan windows if a base image ships | ||
| // without tzdata. The failure it guards against is invisible — production | ||
| // code reads time.Local, and the tzdata tests skip rather than fail — so the | ||
| // ~450 KB is worth it. | ||
| _ "time/tzdata" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
|
|
||
| "github.com/srcfl/ftw/go/internal/api" | ||
| "github.com/srcfl/ftw/go/internal/arp" | ||
| "github.com/srcfl/ftw/go/internal/battery" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no
debian base currencyworkflow—or any equivalent Debian-stable check—under.github/workflowsin this commit. Becausetrixieis deliberately pinned, a future Debian stable release will not produce the tracking issue promised here, leaving the base on the old suite without the stated notification; either include the watcher or remove this assurance until it lands.Useful? React with 👍 / 👎.