I haven’t had the time to test some update methods, but all the comments are useful for new thoughts!
I’m currently figuring out how to set the lockfiles on all my containers, or isn’t that necessary? Because I have a multi-container application and just 1 container has direct interaction with the frontend. It is possible for that container to set the lockfile at
/tmp/balena/updates.lock, but other containers (e.g. a Redis or MySQL container), it’s really hard to set the lockfile, quite impossible. Is there an example available on how to do this?
And @krix, no worries about hijacking the thread! It really helps that some other users are also busy with implementing an other update system where the user has to interact to update.
But I don’t seem to fully understand what’s meant by the
pinned approach, so help me out here as I’m summing up the required steps:
- When device is registered with cloudBalena, it downloads the newest available release and pins itself to that release ID.
- The device checks if an update is available via a custom API that’s linked to balenaCloud.
- If an update is available, the user can accept the update and the custom API sets the pinned release for that device to the newest available release. The device sets the lockfile until the download is completed.
- When update is completed, the device removes the lockfile and sends a request to
/v1/update to initiate the update to be installed.
The creation of a custom API is no problem, but I’d like to fully understand the steps and requirements before spending my time on a custom API. All the posts are great, but I’m really losing the oversight on what steps has to be taken and what’s the best approach on how to do it. But nevertheless, thanks for that @pdcastro & @CameronDiver!