[Plugin] CA Application Auto Update


Squid

Recommended Posts

24 minutes ago, Squid said:

Because until (very recently) it has been impossible to determine (and still can't be determined for everything).  I'm adding it to the white board to include this now.  (Thanks for bringing it to my attention)

 I figured there'd be a technical reason behind it. It's definitely a requested feature from me but I get it.

Link to comment

For some reason my Docker containers aren't updating automatically with this plugin. I get the notifications to say whenever a container has an update available but it doesn't update itself. Not sure if I've configured something wrong here...

 

unraid-docker-auto-update-settings.thumb.png.dde67c2d46c58683fbf103223211a5db.png

 

Currently it's the qbittorrent and postgresql containers that have an update on my server.

Link to comment
On 2/10/2022 at 3:46 PM, doguitar said:

Is there a practical reason why there's not "Delay" option for docker images?

So I started thinking about this today and ran into an immediate problem

 

Let's take netdata as an example.  It's updated pretty much every day.  So, since any delay period causes the update "days" counter to restart again this would never actually get updated.  How would you handle this?

 

 

Link to comment
  • 4 weeks later...
  • 2 weeks later...

I'm looking for an option to have a container autoupdate most of the time, but not all of the time. For context, the use case is homeassistant updates are on a frequent minor revision with bug fixes and a monthly major revision with potential breaking changes. I'd like to have the autoupdate on while the latest version is only a minor revision but off when it's a major revision so I can manually review the breaking changes before updating.

 

I've already figured a way for homeassistant itself to see a new version available and decide if autoupdate should be allowed or not. My plan was to have it modify the contents of "/boot/config/plugins/ca.update.applications/DockerUpdateSettings.json" to turn on/off the autoupdates. I can confirm this works by editing the file through the terminal, but I've been unable to give a docker container write access to this (or any) files on the flash drive. If someone knows how to achieve this, my problem is solved please let me know how.

 

Failing this approach, is there another way that I can toggle the settings? My docker container can make http requests, send tcp or udp packets, connect via a websocket, and probably many more through extensions if there's a good way to accomplish this. It can also execute shell commands, but as far as I know that won't help because the shell will be jailed. If I'm wrong about any of this, please let me know.

 

Basically if anyone has any idea how I could do this, please let me know.

 

 

Side note: when editing the DockerUpdateSettings.json file, I noticed that setting a container '"update": false' makes the settings page show that the container is not autoupdating, but it still does. To stop it, the entire key must be deleted from the file. I'm sure this isn't high priority since you aren't intending for anyone to edit this file directly, but I thought I'd let you know anyway.

Link to comment
2 minutes ago, Squid said:

Completely impossible to be able to determine what version of the application is actually within the container

 

You would want to delete the references to the container within the update settings (while maintaining proper json formatting)

Yes, I'm aware of that. I'm asking what other ways I can toggle on or off the update. Can I give a Docker container write access to the settings file? If so, how? chmod doesn't seem to do anything. 

Link to comment
On 12/6/2019 at 6:17 AM, m8ty said:

In the "Docker Auto Update Settings" settings tab, there is the setting "Time to wait for docker graceful stop before killing".  What unit of time does this use?  Seconds or minutes?

 

Hi, I very much would like to know this, too. :) Though I'm 90% sure it's seconds, a specific unit in the description would indeed be helpul.

Link to comment
On 2/23/2022 at 12:34 AM, Squid said:

So I started thinking about this today and ran into an immediate problem

 

Let's take netdata as an example.  It's updated pretty much every day.  So, since any delay period causes the update "days" counter to restart again this would never actually get updated.  How would you handle this?

 

 

The logic should/could be to look for the latest version which is older than the delay period and install it. This is heavily depending on bad versions being removed from the repositories once major problems have been discovered (I do not know if this is the case). If they only release a newer fix version without removing the bad release then there is no solution.

I just got bit by latest qBittorent version defaulting to save the downloads into config folder, filling my cache drive and bringing all dockers down. Thankfully it seems like nothing was corrupted and I didn't have to restore anything from backups.

I like the autoupdating plugins/dockers but really would like to have a delay on dockers too. I do not constantly tinker with my server so manual updates resulted in very long update intervals with multitude of problems when making the jump.

Link to comment
5 hours ago, henris said:

The logic should/could be to look for the latest version which is older than the delay period and install it.

Can't be done.  If it's using :latest (which everything does that any update is going to be used for) the "date" is the time of the last update, and even if it could be discerned, the update would wind up installing the latest version since that's how the container is tagged.

 

I'll still think about implementing.  Netdata and some others would never actually wind up updating because they are constantly updated.

Link to comment
13 hours ago, Squid said:

Can't be done.  If it's using :latest (which everything does that any update is going to be used for) the "date" is the time of the last update, and even if it could be discerned, the update would wind up installing the latest version since that's how the container is tagged.

 

I'll still think about implementing.  Netdata and some others would never actually wind up updating because they are constantly updated.

I was more thinking to use the Github API to determine which release and when to grab. So we would not be pulling the release with the latest tag but the newest release which is newer than the current but older than the defined delay period. I have no idea how the current mechanism is implemented but this would most likely be much more complex.

 

GitHub API provides the needed "published_at" attribute for releases:

https://api.github.com/repos/binhex/arch-qbittorrentvpn/releases

Edit: But all this might be in vain. The broken qBittorent 4.4.2 release is still up and marked as the latest in Binhex's repo. I guess this might work if you made an assumption that completely broken releases get a fix say within two weeks time. You could then make a safe delay of 4 weeks which should give you a buffer of additional two weeks for broken releases to receive a fix.

Edited by henris
Link to comment
  • 2 weeks later...
On 12/6/2019 at 12:17 AM, m8ty said:

I have a question about a setting:

 

In the "Docker Auto Update Settings" settings tab, there is the setting "Time to wait for docker graceful stop before killing".  What unit of time does this use?  Seconds or minutes?  What command is used for a graceful stop versus killing?  Does it kill dockerd or only containers currently running?

 

Thank you!

I'd also like to know this.

Link to comment

Seconds.  And this is primarily a legacy setting since 6.9+ also include this setting for Docker (defaults to 10 seconds)  

 

If the container doesn't stop gracefully when being asked to within 10 seconds, then docker itself kills the processes off.

Link to comment
  • 2 months later...
  • 1 month later...
On 3/16/2017 at 3:46 AM, Squid said:

Actually hadn't forgotten...

 

I have to wait until Friday's round of lsio updates, but what I'm going to do is this.

 

No GUI as I see this as rather limited in user needs

 

  • Prior to stopping containers, if it exists, something like "/boot/config/plugins/ca.update.applications/scripts/stopping/stop_all" will be called if it exists
  • Prior to stopping any particular container, a script called "/boot/config/plugins/ca.update.applications/scripts/stopping/nameOfContainer" will be called if it exists
  • After restarting any particular container, a script called "/boot/config/plugins/ca.update.applications/scripts/starting/nameOfContainer" will be called if it exists
  • After restarting all the containers, a script called "/boot/config/plugins/ca.update.applications/scripts/starting/start_all" will be called if it exists

 

Should allow you the flexibility to do just about anything you want.  Work for you?

 

Hi @Squid, may i just dont see the way to go here ;)

 

whenever i start, update or force update the docker plex here, i dont see anything happen inside the docker nor in the logs (when i understood correctly, at least a info that the script is executed should appear)

 

located like this

root@AlsServer:~# ls -la /boot/config/plugins/ca.update.applications/scripts/starting/
total 48
drwx------ 2 root root 16384 Aug  8 16:09 ./
drwx------ 4 root root 16384 Jul  7  2019 ../
-rw------- 1 root root    56 Aug  8 16:11 plex
root@AlsServer:~#

 

docker name is also plex lower case

root@AlsServer:~# docker exec -it plex bash
root@715fd6aaed70:/#

 

now, may just to clarify for me, this is just executed through the automatic updater, nothing else will execute the script ? not even a force update etc ... ? or do i havee to call the script different like plex.sh plex.bash ... ?

Link to comment
  • 4 weeks later...
On 3/27/2022 at 1:47 PM, Renegade605 said:

I'm looking for an option to have a container autoupdate most of the time, but not all of the time. For context, the use case is homeassistant updates are on a frequent minor revision with bug fixes and a monthly major revision with potential breaking changes. I'd like to have the autoupdate on while the latest version is only a minor revision but off when it's a major revision so I can manually review the breaking changes before updating.

 

I've already figured a way for homeassistant itself to see a new version available and decide if autoupdate should be allowed or not. My plan was to have it modify the contents of "/boot/config/plugins/ca.update.applications/DockerUpdateSettings.json" to turn on/off the autoupdates. I can confirm this works by editing the file through the terminal, but I've been unable to give a docker container write access to this (or any) files on the flash drive. If someone knows how to achieve this, my problem is solved please let me know how.

 

Failing this approach, is there another way that I can toggle the settings? My docker container can make http requests, send tcp or udp packets, connect via a websocket, and probably many more through extensions if there's a good way to accomplish this. It can also execute shell commands, but as far as I know that won't help because the shell will be jailed. If I'm wrong about any of this, please let me know.

 

Basically if anyone has any idea how I could do this, please let me know.

 

 

Side note: when editing the DockerUpdateSettings.json file, I noticed that setting a container '"update": false' makes the settings page show that the container is not autoupdating, but it still does. To stop it, the entire key must be deleted from the file. I'm sure this isn't high priority since you aren't intending for anyone to edit this file directly, but I thought I'd let you know anyway.

 

Easy go into your Dockers tab for this plugin. Disable auto updates for all and then manually check each docker and not Homeassistant so you can update that particular one when you want, but all others will be updated. 

 

Its the same thing I do. I have a VPN running with a killswitch to some of my dockers. When it updates it sometimes wrecks my connections to my other dockers. So I update all my other dockers and I manually update my VPN so I know to gracefully shut everything else down, update and restart my other dockers.  Same with the MyServer Plugin. I have that disabled as well because I've lost all outside connections before. So now I only update that one when I'm home. 

 

You just have to remember to enable/disable future Dockers or Plugins if you turn off the all update feature. This solution isn't perfect for HomeAssistant, but at least you have more control.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.