|
@@ -782,28 +782,33 @@ exclusive with `--build-node`.
|
|
|
|
|
|
|
|
**The add-on image** — the HA add-on store lives in the sibling
|
|
**The add-on image** — the HA add-on store lives in the sibling
|
|
|
**sm121-ha-integration** repo (`repository.json` + `sm121/` add-on dir +
|
|
**sm121-ha-integration** repo (`repository.json` + `sm121/` add-on dir +
|
|
|
-`.github/workflows/`, same pattern as `kilork/cups-addon`): a THIN image
|
|
|
|
|
-(debian-slim + git/jq/curl/gcc, no sm121 binary, no toolchain — small
|
|
|
|
|
-enough for GHCR's free tier). The **Pi is the build host**: the entrypoint
|
|
|
|
|
-installs rustup on first boot (cached in the add-on's data folder) and
|
|
|
|
|
-compiles sm121 from the launcher repo (`sm121_launcher_url` @
|
|
|
|
|
-`sm121_launcher_rev`, default main — set a commit to pin; `sm121_build_jobs`
|
|
|
|
|
-defaults to 2 so a Pi 4 doesn't OOM under HA). The arch always matches and
|
|
|
|
|
-the binary never goes stale; first boot = toolchain download + a release
|
|
|
|
|
-build (minutes on a Pi 5). **GitHub Actions builds + pushes**
|
|
|
|
|
-`ghcr.io/kilork/sm121-addon` (aarch64 + amd64 + manifest) on push to main
|
|
|
|
|
-via OIDC — no `docker login` anywhere (the GHCR package is created
|
|
|
|
|
-private: set it public once so HA pulls anonymously). Local dev:
|
|
|
|
|
-`make addon-image` (builds from the sibling repo) +
|
|
|
|
|
-`scripts/smoke-addon.sh` (entrypoint + `file://` recipe repo + `file://`
|
|
|
|
|
-launcher checkout + curl /api/state). The entrypoint writes the effective
|
|
|
|
|
-config from the add-on options (env), drops the SSH key (base64 option),
|
|
|
|
|
-`sm121 repos sync`, then `sm121 web --port 3100 --bind 0.0.0.0` (a bearer
|
|
|
|
|
-token is required) with a background re-sync loop
|
|
|
|
|
-(`SM121_REPO_RESYNC_MINUTES`). Its `custom_components/` custom-integration
|
|
|
|
|
-prototype is superseded (entities are a phase-2 nicety over the add-on's
|
|
|
|
|
-REST API). The cluster definitions (private IPs — never in the public
|
|
|
|
|
-recipe repo) are supplied as the **`sm121_config_extra` add-on option**
|
|
|
|
|
|
|
+`.github/workflows/`, same pattern as `kilork/cups-addon`). Multi-stage
|
|
|
|
|
+build (`sm121/Dockerfile`): a **rust:alpine** stage compiles sm121 from
|
|
|
|
|
+the launcher repo (CI checks it out as `launcher-src/` in the build
|
|
|
|
|
+context) with a trivial `cargo build --release` (pinned
|
|
|
|
|
+`rust:1.98.1-alpine3.22`, native arch per runner, dynamic musl); the
|
|
|
|
|
+**alpine:3.22** final
|
|
|
|
|
+image ships it + git/jq/curl + the entrypoint (~25 MB, no toolchain,
|
|
|
|
|
+no compile-on-boot — a 4 GB Pi must not OOM on a release build, so the
|
|
|
|
|
+Pi is *not* the build host). The CI matrix builds each arch natively
|
|
|
|
|
+(aarch64 on an arm runner, amd64 on x86) and composes the multi-arch
|
|
|
|
|
+manifest. **GitHub Actions builds + pushes**
|
|
|
|
|
+`ghcr.io/kilork/sm121-addon` (aarch64 + amd64 + `:latest`/`:1.1.0`
|
|
|
|
|
+manifest) on push to main via OIDC — no `docker login` anywhere (the
|
|
|
|
|
+GHCR package is created private: set it public once so HA pulls
|
|
|
|
|
+anonymously). A launcher change does not trigger the add-on CI
|
|
|
|
|
+(cross-repo) — re-run it (workflow_dispatch) to ship a new binary.
|
|
|
|
|
+Local dev: `make addon-image` (rsyncs this repo into the sibling's
|
|
|
|
|
+`launcher-src/` + docker build) + `scripts/smoke-addon.sh` (entrypoint +
|
|
|
|
|
+`file://` recipe repo + curl /api/state). The entrypoint writes the
|
|
|
|
|
+effective config from the add-on options (env), drops the SSH key
|
|
|
|
|
+(base64 option), `sm121 repos sync`, then `sm121 web --port 3100 --bind
|
|
|
|
|
+0.0.0.0` (a bearer token is required) with a background re-sync loop
|
|
|
|
|
+(`SM121_REPO_RESYNC_MINUTES`). Its `custom_components/`
|
|
|
|
|
+custom-integration prototype is superseded (entities are a phase-2
|
|
|
|
|
+nicety over the add-on's REST API). The cluster definitions (private IPs
|
|
|
|
|
+— never in the public recipe repo) are supplied as the
|
|
|
|
|
+**`sm121_config_extra` add-on option**
|
|
|
(raw TOML, appended to the generated config): `[[clusters]]`/nccl +
|
|
(raw TOML, appended to the generated config): `[[clusters]]`/nccl +
|
|
|
`[home_assistant]` + `[mikrotik]` live in HA's own option storage —
|
|
`[home_assistant]` + `[mikrotik]` live in HA's own option storage —
|
|
|
private, on the Pi, no second repo, no PAT. If that TOML carries
|
|
private, on the Pi, no second repo, no PAT. If that TOML carries
|