Skip to content
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

OTA Updates #32

Merged
merged 95 commits into from
Jul 22, 2020
Merged

OTA Updates #32

merged 95 commits into from
Jul 22, 2020

Conversation

mayankchhabra
Copy link
Member

@mayankchhabra mayankchhabra commented Jul 15, 2020

Over-The-Air Updates

This PR adds the functionality to allow the user to update their Umbrel installation on the go, without having to manually install new releases or re-flash Umbrel OS image.

The execution flow of the update process is documented here.

How to test

4 demo releases have been made on the mayankchhabra/getumbrel repo.

Umbrel v0.1.4-beta.2 (base release)
Umbrel v0.1.4-beta.3 (requires >= v0.1.4-beta.2)
Umbrel v0.1.4-beta.4 (requires >= v0.1.4-beta.3)
Umbrel v0.1.4-beta.5 (requires >= v0.1.4-beta.3)

You should install the base release - Umbrel v0.1.1-beta.2.

Expected behavior

After installing v0.1.4-beta.2 (base release), you should be able to install v0.1.4-beta.3 and then v0.1.4-beta.5, thereby skipping v0.1.4-beta.4.

Step-by-step testing instructions

If testing on umbrel-dev, make sure rsync and jq are installed.

  1. Create a new directory and install the base testing release inside it with:
wget -qO- "https://raw.githubusercontent.com/mayankchhabra/umbrel/v0.1.4-beta.2/install-box.sh" | sh
  1. Configure the installation for regtest
REGTEST=1 ./configure-box.sh

If testing on umbrel-dev, update the hostname to umbrel-dev.local by running sed -i "s/umbrel.local/umbrel-dev.local/g;" docker-compose.yml

  1. Run karen
sudo ./karen
  1. Start the services (in another tab)
docker-compose up -d
  1. Finish the onboarding and reach the dashboard. Go to the settings page and verify that you're running Umbrel version 0.1.4-beta.2 as seen on the "system" card.

  2. Meanwhile, you should also see an alert notifying about a new Umbrel release available. It should be Umbrel v0.1.4-beta.3. Click "install" to install the update.

  3. After the update is complete, verify that the Umbrel version on the settings page is 0.1.4-beta.3.

  4. Meanwhile, you'll get another alert notifying about a new Umbrel release available. It should be Umbrel v0.1.4-beta.5. Click "install" to install the update.

  5. After the update is complete, verify that the Umbrel version on the settings page is 0.1.4-beta.5.


Further improvements:

  1. Creating a rollback.sh script in bin/update/ that rollbacks the update if:
    - The update fails for whatever reason (network issue, any error, etc)
    - The device is unplugged or there's a power interruption in the middle of an ongoing update

  2. Selectively prune Docker images and volumes by filtering using labels.

  3. Verify release signatures (should also be done in install-box.sh too).


Before Merging

  • Update GitHub repository links to the official repository
  • Update Docker images to the official images
  • Enable pruning of all Docker images on successful update
  • Update configuration to run on mainnet

Related OTA Update PRs:


Will close #1 on merge.

@mayankchhabra mayankchhabra requested a review from lukechilds July 15, 2020 07:12
Copy link
Member

@lukechilds lukechilds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor tweaks but looks really good overall.

The only important thing I see missing is signature verification.

bin/update/00-run.sh Outdated Show resolved Hide resolved
bin/update/00-run.sh Show resolved Hide resolved
bin/update/00-run.sh Outdated Show resolved Hide resolved
bin/update/00-run.sh Outdated Show resolved Hide resolved
bin/update/00-run.sh Outdated Show resolved Hide resolved
events/triggers/update Outdated Show resolved Hide resolved
events/triggers/update Outdated Show resolved Hide resolved
events/triggers/update Outdated Show resolved Hide resolved
events/triggers/update Outdated Show resolved Hide resolved
events/triggers/update Outdated Show resolved Hide resolved
@mayankchhabra mayankchhabra marked this pull request as ready for review July 21, 2020 11:46
Copy link
Member

@lukechilds lukechilds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be doing wget | sh as part of the update process. See review comment for details.

events/triggers/update Show resolved Hide resolved
@lukechilds
Copy link
Member

@mayankchhabra
Copy link
Member Author

mayankchhabra commented Jul 21, 2020

Awesome, looking ready to merge...

@mayankchhabra mayankchhabra added feature A brand new feature and removed feature A brand new feature labels Jul 22, 2020
@mayankchhabra mayankchhabra merged commit 7e4fb34 into getumbrel:master Jul 22, 2020
@mayankchhabra mayankchhabra deleted the ota-updates branch July 22, 2020 06:25
@lukechilds lukechilds mentioned this pull request Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OTA Updates
3 participants