feat(firmware): offer the newest release of the line and install it with owut (NetOrk/netork#2615) #49

Merged
christianmanivong merged 4 commits from feature/openwrt-sysupgrade-2615 into main 2026-11-17 12:56:16 +00:00
Owner

For NetOrk/netork#2615: a package upgrade on OpenWrt writes the new package to the overlay while the old one stays in the read-only image, so the overlay only fills. A sysupgrade to the newest release of the device's own line brings those packages, and every package installed since, in the new image.

  • get_firmware_offer() (FirmwareOfferMixin): reads /etc/openwrt_release, the sysupgrade server the device is set to (attendedsysupgrade.@server[0].url, else the public one; http(s) only) and whether owut is installed, in one round trip. The release line is looked up in the server's /json/v1/overview.json, fetched by the caller at most once a day per server and process (a failed fetch is not retried for an hour). latest_version is the newest release of the device's line that builds its target (release candidates only where the line has no release), latest_major_version the newest later line, installable whether owut is there (left out before 24.10). A snapshot or a target the line no longer builds has no offer.
  • start_firmware_upgrade(version) (FirmwareUpgradeMixin): owut upgrade --version-to <version> as root, detached from the session and deaf to its hang-up, output in /tmp/owut-upgrade.log; refuses while one runs or owut is missing, and anything but a release version.
  • get_update_progress(): that log, running until owut prints "Installing … and rebooting" (done; sysupgrade then stops every process) or ends without it (failed).
  • Needs napalm-device-types 4.41.0. Release 0.8.0 (version and CHANGELOG).

Tests: tests/unit/test_firmware.py (26, the overview's real shape cut down); full suite, ruff and strict mypy for the new module green locally. All four APs on the netOrk test server already have owut.

For NetOrk/netork#2615: a package upgrade on OpenWrt writes the new package to the overlay while the old one stays in the read-only image, so the overlay only fills. A sysupgrade to the newest release of the device's own line brings those packages, and every package installed since, in the new image. - `get_firmware_offer()` (`FirmwareOfferMixin`): reads `/etc/openwrt_release`, the sysupgrade server the device is set to (`attendedsysupgrade.@server[0].url`, else the public one; http(s) only) and whether owut is installed, in one round trip. The release line is looked up in the server's `/json/v1/overview.json`, fetched by the caller at most once a day per server and process (a failed fetch is not retried for an hour). `latest_version` is the newest release of the device's line that builds its target (release candidates only where the line has no release), `latest_major_version` the newest later line, `installable` whether owut is there (left out before 24.10). A snapshot or a target the line no longer builds has no offer. - `start_firmware_upgrade(version)` (`FirmwareUpgradeMixin`): `owut upgrade --version-to <version>` as root, detached from the session and deaf to its hang-up, output in `/tmp/owut-upgrade.log`; refuses while one runs or owut is missing, and anything but a release version. - `get_update_progress()`: that log, `running` until owut prints "Installing … and rebooting" (`done`; sysupgrade then stops every process) or ends without it (`failed`). - Needs napalm-device-types 4.41.0. Release 0.8.0 (version and CHANGELOG). Tests: `tests/unit/test_firmware.py` (26, the overview's real shape cut down); full suite, ruff and strict mypy for the new module green locally. All four APs on the netOrk test server already have owut.
christianmanivong added 2 commits 2026-11-17 11:44:11 +00:00
get_firmware_offer() looks the device's release line up in the attended
sysupgrade server's overview.json, fetched at most once a day per server.
start_firmware_upgrade() runs owut upgrade detached from the session, and
get_update_progress() follows its log until owut hands the image to sysupgrade.
chore(release): 0.8.0
driver / lint (pull_request) Successful in 14s
driver / standard (pull_request) Failing after 15s
driver / types (pull_request) Failing after 22s
driver / test (3.13) (pull_request) Failing after 12s
driver / test (3.12) (pull_request) Failing after 14s
driver / lowest (pull_request) Failing after 13s
driver / build (pull_request) Successful in 24s
driver / security (pull_request) Failing after 33s
CI / driver (pull_request) Failing after 1m0s
driver / publish (pull_request) Skipped
6e7fe5ed5b
christianmanivong added 1 commit 2026-11-17 11:46:29 +00:00
refactor(firmware): the offer is built in parts, each under the complexity limit
driver / lint (pull_request) Successful in 18s
driver / standard (pull_request) Successful in 20s
driver / types (pull_request) Successful in 55s
driver / test (3.13) (pull_request) Successful in 58s
driver / test (3.12) (pull_request) Successful in 1m1s
driver / lowest (pull_request) Successful in 28s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Failing after 57s
CI / driver (pull_request) Failing after 2m15s
driver / publish (pull_request) Skipped
3e80f7d02a
christianmanivong added 1 commit 2026-11-17 12:53:19 +00:00
fix(security): say why the device's /tmp and the http(s) fetch are fine (bandit)
driver / lint (pull_request) Successful in 15s
driver / standard (pull_request) Successful in 17s
driver / types (pull_request) Successful in 56s
driver / test (3.13) (pull_request) Successful in 57s
driver / test (3.12) (pull_request) Successful in 1m3s
driver / lowest (pull_request) Successful in 28s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m4s
CI / driver (pull_request) Successful in 2m19s
driver / publish (pull_request) Skipped
6a8ebfe235
christianmanivong merged commit 5c91af6033 into main 2026-11-17 12:56:16 +00:00
christianmanivong deleted branch feature/openwrt-sysupgrade-2615 2026-11-17 12:56:16 +00:00
Sign in to join this conversation.