4.2 KiB
Over-The-Air (OTA) Updates
How over-the-air updates work on Umbrel.
Execution Flow
-
New developments across the any/entire fleet of Umbrel's services (bitcoind, lnd, dashboard, middleware, etc) are made, which maintain their own independent version-control and release-schedule. Subsequently, their new docker images are built, tagged and pushed to Docker Hub.
-
The newly built and tagged images are updated in the main repository's (i.e. this repo)
docker-compose.yml
file. -
Any new developments to the main repository (i.e. this repo) are made, eg. adding a new directory or a new config file.
-
To prepare a new release of Umbrel, called
vX.Y.Z
, a PR is opened that updates theinfo.json
file to:
{
"version": "X.Y.Z",
"name": "Umbrel vX.Y.Z",
"notes": "This release contains a number of bug fixes and new features."
"requires": ">=A.B.C"
}
-
Once the PR is merged, the master branch is immediately tagged
vX.Y.Z
and released on GitHub. -
Thus the new
info.json
will automatically be available athttps://raw.githubusercontent.com/getumbrel/umbrel/master/info.json
. This is what triggers the OTA update. -
When the user opens his
umbrel-dashboard
, it periodically pollsumbrel-manager
to check for new updates. -
umbrel-manager
fetches the latestinfo.json
from umbrel's main repo's master branch usingGET https://raw.githubusercontent.com/getumbrel/umbrel/master/info.json
, compares it'sversion
with theversion
of the local$UMBREL_ROOT/info.json
file, and exits if both the versions are same. -
If fetched
version
> localversion
,umbrel-manager
checks if localversion
satisfies therequires
condition in the fetchedinfo.json
. -
If not, umbrel-manager makes a
GET
request tohttps://raw.githubusercontent.com/getumbrel/umbrel/vX.Y.Z/info.json
and repeats step 8 and 9 until localversion
< fetchedversion
and localversion
doesn't fulfill the fetchedrequires
condition. -
umbrel-manager
then returns the satisfactoryinfo.json
toumbrel-dashboard
. -
umbrel-dashboard
then alerts the user regarding the new update, and after the user consents, it makes aPOST
request toumbrel-manager
to start the update process. -
umbrel-manager
creates a signal file on the mounted host OS volume ($UMBREL_ROOT/signals/update
) with the versionX.Y.Z
, and returns200 OK
to theumbrel-dashboard
. -
fswatch
, a file monitoring tool that's continuosly monitoring the$UMBREL_ROOT/signals/update
file notices the change, and immeditaly runs$UMBREL_ROOT/bin/update/start.sh
as root. -
$UMBREL_ROOT/bin/update/start.sh
clones releasevX.Y.Z
from github in/tmp/umbrel-vX.Y.Z
. -
$UMBREL_ROOT/bin/update/start.sh
then executes all of the following update scripts from the new release/tmp/umbrel-vX.Y.Z
one-by-one:
/tmp/umbrel-vX.Y.Z/bin/update/00-run.sh
: Pre-update preparation script (does things like make a backup)/tmp/umbrel-vX.Y.Z/bin/update/01-run.sh
: Install update script (installs the update)/tmp/umbrel-vX.Y.Z/bin/update/02-run.sh
: Post-update script (used to run unit-tests to make sure the update was successfully installed)/tmp/umbrel-vX.Y.Z/bin/update/03-run.sh
: Success script (runs after the updated has been successfully downloaded and installeed)
All of the above scripts continuosly update $UMBREL_ROOT/statuses/update-status.json
with the progress of upgrade, which the dashboard periodically fetches every 2s via umbrel-manager
to notify the user on the progress of update.