Update when user interacts


Yes, the pinned approach is what I am going for and I have my basic setup working.
Since the change is less immediate as you put it, I was trying to have the device itself detect when a download is in progress , but I ran into this problem: Supervisor response for v2/applications/state is incorrect

But thx for the discussion in this thread, I will consider it closed for now, and again I apologize to @vedicium for what ended up as hijacking this thread.



Hi all,

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:

  1. When device is registered with cloudBalena, it downloads the newest available release and pins itself to that release ID.
  2. The device checks if an update is available via a custom API that’s linked to balenaCloud.
  3. 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.
  4. 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!