Repository navigation
Conversation
install.sh deleted /opt/DWE_OS_2 before installing anything, so a failed download or dependency install left the device with no dweOS at all. The release is now downloaded to a temp directory and installed to /opt/DWE_OS_2.new, and only swapped in once its requirements and venv are set up. The old install is restored if the swap fails. Camera settings and preferences are carried over to the new install.
The Updates tab lists the releases on GitHub with their notes, marks the installed and latest ones, and installs any release (pre-releases behind a toggle). The install runs install.sh in its own systemd unit, since it restarts the dwe_os_2 service, and streams its output to the page. The page reloads into the new version once the backend comes back. The updater can be disabled with --no-updater, which the BlueOS image uses, since BlueOS updates its extensions itself.
Open
|
Preview build: curl -s https://raw.githubusercontent.com/DeepWaterExploration/dweOS/main/install.sh | sudo bash -s preview-pr-579Rebuilt on every push. Closing this pull request deletes the preview. |
The install buttons sat after each release's accordion header, which only took the width of its contents, so they never lined up. Each row is now a full width header with the date and a fixed width button on the right. The list also showed every release ever published with duplicate tags and pre-release badges. It now shows the 5 most recent, with the rest behind a button, and only marks the latest and installed releases. Long commands in release notes wrap instead of widening the page.
On a pre-release the Updates tab offered the latest release as an update, even though a preview like v0.7.7-pr579 is built on v0.7.7. An update is now only offered when the latest release's X.Y.Z is newer than the installed version's, ignoring any pre-release suffix. The tab says when a pre-release is installed, and shows pre-releases by default so the installed one is in the list.
3 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a builtin updater, so dweOS can be updated from the web UI instead of over SSH.
New Updates tab (
/updater)-prN.<sha>matchespreview-pr-N.Backend (
/api/updater/{releases,status,install})UpdateManagergets the releases from the GitHub API. It installs a release with the samecurl … install.sh | bash -s <tag>command as the README. The install runs in its own systemd unit (dwe_os_2_update), becauseinstall.shrestartsdwe_os_2and would otherwise kill itself.updaterfeature flag, which--no-updaterturns off. The BlueOS Dockerfile now passes--no-updater, because BlueOS updates its own extensions. The tab then shows the usual "not supported" card.install.sh/opt/DWE_OS_2before it installed anything, so a failed download orpip installleft the device with no dweOS. Now it downloads the release to a temporary directory and builds the new install in/opt/DWE_OS_2.new. It swaps the new install in only after the requirements and the venv are installed, and restores the old install if the swap fails.device_settings.jsonandserver_preferences.jsonare now kept across installs. Before, every install reset them. An in-app update that cleared all camera settings would be unexpected, so this behavior change needs a reviewer to agree.frontend/src/schemas/dwe_os_2.d.tswas regenerated from the backend. It also includes earlier endpoints that were missing from the committed schema.Fixes #578
Type of change
Quick Checklist
Tested
ruff,ty,bandit -lll,tsc,eslint, andnpm run buildpass.UpdateManager.get_releases()against the live GitHub API,get_status(), and the tag validation.Not yet tested
systemd-runupdate, theinstall.shswap and rollback, and the page reloading after the restart.install.shfrommain, so the safer install only applies to updates after this PR is merged.