Let me summarize the process (Assume there’s a new release available):
User initiates update by pressing a button on their device
Create a lock file
Pin the device to the new release
Trigger update download using the endpoint: /v1/update
Show “Downloading update…” message to user
After download finishes, show “Reboot” button to user
User pressed “Reboot” button
Trigger device reboot using the endpoint: /v1/reboot with {'force': true}
Device boots back, old containers are started (Old UI shows)
Supervisor kills/deletes the old containers and applies updates
New containers are started
The step we’re having problem is step 9. When device boots back the old containers are started and shows our old UI for a few seconds until after supervisor finishes applying the update.
Is there a way we can make it so the old containers are not started?
So we’d have a following for step 9:
Device boots back, old containers are not started (Blank screen)
Step 8 is the “onclick” action for Step 7.
We call /v1/reboot with {'force': true} to force a reboot. Device won’t reboot without {'force': true} flag since we still have the lockfile present.
We’re not removing the lockfile because it is removed automatically on reboot by the supervisor anyway.
Hi there, I was just asking as if the reboot wasn’t strictly necessary, you could disable the lockfile without rebooting, and the device would update to the new container and UI - this might provide a smoother experience
If the exact steps you detailed are all strictly required, then I don’t think there is a way to force the device to not start the old containers as it boots. As it seems like the main issue is the old UI is being displayed pot update, maybe you could disable the screen using an env var you set during step 7 and then remove when the running release matches the target one?
I ended up using this following solution. It works well.
On boot, from my old container poll /v2/state/status to detect if an update is being applied (appState == "applying") and show “Updating please wait…” UI. Then continue rendering regular UI when update finishes.