Application notification when new image is downloaded


#1

Hi,
is there any trigger that can be received in the container application whenever a new images is available and download starts?
I’d like to do some application context cleanup before the new version is deployed and a trigger for that would be highly appreciated.
In the console window in the dashboard I can see the brown text “Downloading …” but can I also react from within the application?
I’m running a nodejs application in my container

Thanks
Fritz


#4

Looping in @camerondiver @richbayliss - can the update_pending property from supervisor’s /v1/device endpoint be used to query for pending updates (https://github.com/resin-io/resin-supervisor/blob/master/docs/API.md#get-v1device) ?

@fritz in your case I think you will need a combination of

  • staged releases , to make sure that no release is fetched from a device before the application cleanup happens

and

  • Querying API resources directly to see if new release are available (i.e.the release resource

#6

Hi @lekkas

Thanks, I will probably give it a try. In fact, I was more looking into some notification mechanism. For now, I have circumvented the issue by speeding up our cleanup procedure, so we can rely that it will take less than 10 seconds. Until now, I think the rebooting process was waiting like 10s or so until the app was killed and sometimes we did not finish cleaning up which was resulting in data loss on our application. That’s why I originally wanted to start the cleanup when download starts (which takes more like minutes instead of seconds and would have given plenty of time to clean up).

Thanks
Fritz


#19

Hi @fritz, since this topic was last visited the v2/applications/state endpoint has been added to the supervisor api, which will tell you if anything’s downloading. Documented here https://github.com/resin-io/resin-supervisor/blob/master/docs/API.md#get-v2applicationsstate