What's up docker? How to keep your containers up to date

Hi, anyone solve an issue with number ordering?

v21.1-ls102 is the latest verion of an image but WUD keeps detecting v21.1-ls99 as the latest and I can’t wrap my head around it.

My regex is ^v\d+\.\d+\-ls\d+$$ which captures both but chronologically they are out of order.

I assume rolling back to 5.7.0 would solve this?

Edit: Just realised 5.7.0 was a while ago so doesn’t support features I am using so can’t test.

Edit2: figured it out, read up on transform tags and got this to work ^v(\d+)\.(\d+)-ls(\d+)$ => $1.$2.$3

Hi @whatdaybob ,

The explanation is that the semver specification implies to compare as numbers major,minor and patch digits only.
Everything after is compared alphabetically so -ls99 is greater than -ls102.

Linux server tags are a hell because they are far far far away from compliant semver versions.
The solution to make it work is the one you found by yourself in Edit 2; applying a transform function first to keep only the semver compliant part.

Edit: To be more clear, your tag v21.1-ls99 is parsed by wud as:

  • major: 21
  • minor: 1
  • patch: 0
  • prerelease/alpha: ls99
1 Like

Ha ha you aren’t joking about the naming conventions! Technically got it working now but noticed a few ui bugs, example is that the link made up using the version numbers show the current numbers and not the updates (threw me through a loop or two). Will get an issue raised when I have chance.

I will ask, using the transform method, does it break the update kind, all my others show minor/major but the ones I transformed all say unknown.

Looking back at my original one, ‘v21.1-ls101‘ I parsed out the 21.1.101 and can confirm that. But ‘v21.1-ls102‘ comes up as unknown.

I wrote about how wud would parse it “by default” (I mean without any transform function).
Once your transform function set up, yeah, you’re right. It’s parsed as you mention it.

For the bugs you’ve detected, please open the related issues on Github.
I’ll do my best :wink:

Can i also update the containers manually by api, post command, mqtt or something?

Hi,

Not for the moment.
The primary purpose of the tool was to notify only when updates are available.
Now it’s also possible to automatically replace a container with a newer version by using the Docker and Docker-Compose triggers.

Allowing to manually update a container is though interesting; I’ll think about the design of such a feature.

2 Likes

It would be perfect to control it with an api or mqtt to update containers. So i could control it within HA. :wink:

Hi ,

Love your work WUD is amazing for showing updates in HA.
WUD container working as expected.
Only the MQTT sensors are going unavailable at some point , and I believe they become available again when an update is available, any way to have the MQTT sensors up all the time ?
think my MQTT setting may be wrong ?

Have I missed some change recently?

My binary sensors from WUD are all gone.

I look at them only occasionally so I have no idea when they went away tho.

The sensors are created in MQTT and I’ve restarted both the WUD docker container and HA and made sure the WUD container is up to date but for some reason the binary sensors are no longer being discovered correctly.

Any ideas?

I haven’t experienced it.
My sensors are always available, mostly report up to date states and sometimes update available states when one of them can be updated.

I’m using an external mosquitto container without any specific configuration.

Please raise an issue on the Github so we can discuss further how to troubleshoot your problem:

  • Are you using the latest version of wud?
  • Are you using WUD for tracking semver or latest tags?
  • May you share your wud config and/or wud logs?

Thanks!

The sensors are created in MQTT and I’ve restarted both the WUD docker container and HA and made sure the WUD container is up to date but for some reason the binary sensors are no longer being discovered correctly.

Do you mean that when you’re looking at the MQTT topics, you can see the topics both for sensor discovery & for sensor values but nothing show up on Home-Assistant?

That’s weird; may you first upgrade to the latest version of wud?
Then please raise an issue on the Github so that I can help you troubleshooting.

Had to make wud container have a persistent storage mount /store
Now it works :+1:

1 Like

Hi there,

I’m just sharing with you some recent features that can be interesting for any HA user.

:tada:

1. Customize HA sensor labels/icons from WUD (version > 5.15.0)

You can now set the labels & the icons using Docker labels on your containers.

Example

version: '3'

services:

  mariadb:
    image: mariadb:10.6.4
    labels:
      - wud.display.name=Maria DB
      - wud.display.icon=mdi-database

Then your sensors are neatly displayed in the HA UI

Please find here the related documentation with examples

2. HA sensors are now defined with the update class (version > 5.14.1)

That means that now wud binary sensors values are displayed as Update available / Up-to-date

image

3. Container status are pushed realtime to HA (version > 5.12.1)

That means that you can now track realtime if the container is running, 'stopped`…

4. Pull the new versions ahead of time (version > 5.12.0)

You don’t want wud to automatically replace containers by the new ones because you want to keep the control?
This dry-run option can ben interesting for you; wud will only pull the new tag.
So when you decide to upgrade, the new image is already pulled locally and upgrading will take much less time.
This option is working for both the Docker trigger and the Docker-Compose trigger

Example

version: '3'

services:
  whatsupdocker:
    image: fmartinou/whats-up-docker
    ...
    volumes:
    - /etc/my-services/docker-compose.yml:/wud/docker-compose.yml
    environment:
      - WUD_TRIGGER_DOCKERCOMPOSE_LOCAL_FILE=/wud/docker-compose.yml
      - WUD_TRIGGER_DOCKERCOMPOSE_LOCAL_DRYRUN=true

Feel free to open issues on the Github is you’re looking for new features or facing problems… !

Thank you for your support!

2 Likes

Sorry to leave you hanging on this reply…

I’m not sure what happened but as a last resort I tried once more restarting the container for WUD and sudenly things started working again.

so…problem solved…? :crossed_fingers:

I hope so! :grin:

1 Like

hmm I have made a persistant volume for your docker container , and when first starting the container the sensors are present and up-to-date or update available , but after a reboot they become unavailable ?

19:12:36.909  INFO whats-up-docker: What's up Docker? is starting (version = latest)
19:12:36.910  INFO whats-up-docker/store: Load store from (/store/wud.json)
19:12:36.926  INFO whats-up-docker/prometheus: Init Prometheus module
19:12:37.106  INFO whats-up-docker/registry: Register all components of kind trigger for provider mqtt
19:12:37.684  INFO whats-up-docker/trigger.mqtt.mosquitto: Register trigger with configuration {"url":"mqtt://192.168.*.*:1883","user":"******","password":"******","hass":{"enabled":true,"prefix":"homeassistant"},"topic":"wud/container","threshold":"all","mode":"single","once":true,"simpletitle":"New ${kind} found for container ${name}","simplebody":"Container ${name} running with ${kind} ${local} can be updated to ${kind} ${remote}\n${link}","batchtitle":"${count} updates available","key":"************"}
19:12:37.824  INFO whats-up-docker/registry: No Registry configured => Init a default one (Docker Hub with default options)
19:12:38.688  INFO whats-up-docker/registry.hub: Register registry with configuration {}
19:12:38.723  INFO whats-up-docker/registry: No Watcher configured => Init a default one (Docker with default options)
19:12:40.324  INFO whats-up-docker/watcher.docker.local: Register watcher with configuration {"socket":"/var/run/docker.sock","port":2375,"cron":"0 * * * *","watchbydefault":true,"watchall":false,"watchevents":true}
19:12:40.343  INFO whats-up-docker/watcher.docker.local: Cron scheduled (0 * * * *)
19:12:40.354  INFO whats-up-docker/registry: No authentication configured => Allow anonymous access
19:12:40.381  INFO whats-up-docker/authentication.anonymous.anonymous: Register authentication with configuration {}
19:12:40.411  WARN whats-up-docker: Anonymous authentication is enabled; please make sure that the app is not exposed to unsecure networks
19:12:40.456  INFO whats-up-docker/api: API/UI exposed on port 3000
19:12:41.376  INFO whats-up-docker/watcher.docker.local: Cron started (0 * * * *)
19:12:41.412  INFO whats-up-docker/watcher.docker.local: Listening to docker events
19:12:46.744  INFO whats-up-docker/watcher.docker.local: Cron finished (21 containers watched, 0 errors, 4 available updates)

Compose file:

version: '3'

services:
  whatsupdocker:
    image: fmartinou/whats-up-docker
    container_name: wud
    restart: unless-stopped
    volumes:
      - /home/*******/docker/WUD/store:/store
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - 3331:3000
    environment:
        - WUD_TRIGGER_MQTT_MOSQUITTO_URL=mqtt://*.*.*.*:1883
        - WUD_TRIGGER_MQTT_MOSQUITTO_HASS_ENABLED=true
        - WUD_TRIGGER_MQTT_MOSQUITTO_USER=*******
        - WUD_TRIGGER_MQTT_MOSQUITTO_PASSWORD=*******

Hi,

but after a reboot they become unavailable

  • What is your setup exactly?
  • Are HA, Mosquitto & WUD all running on the same host?
  • After your reboot, do you have any control on the sequence in which the services are started?
  • Can you see on the mosquitto topics whether the wud sensors are present (homeassistant/binary_sensors/)?

I’ve tried to:

  • stop wud => HA sensors were still there
  • restart wud => HA sensors were still there
  • destroy wud => HA sensors were still there
  • recreate wud => HA sensors were still there

Are you using the latest version of wud (`5.15.0``)?

I’ve got two watchers setup, one monitoring the local docker socket, and another watching a remote stack. Everything works and I can see the updates in the Web UI and in MQTT (I can view my broker via MQTT Explorer), however the updates for the remote docker stack does not get pushed to the homeassistant topic in MQTT, so those containers do not get pushed into homeassistant. Is this expected behavior? I can submit a FR if so.

@mcoleman001

It’s not the expected behavior; all containers should be pushed to HA regardless the watcher type.
Can you please raise an issue on Github?
(and provide all related info like the configuration on WUD, the labels on the containers, the logs…)

Thank you :slightly_smiling_face: !

Running everything in containers on the same host, HA, mosquitto broker and WUD and some more containers
Started most of them via docker-compose and no depends_on: are present.
mqtt explorer does


topics don’t seem in line with your homeassistant/binary_sensors/

Only watchtower showing up in homeassistant

Did a pull on your container so expecting the latest version

Just deleted the WUD container and recreated it, only watchtower and WUD showing in MQTT explorer Homeassistant/binary_sensor topic ?

Just deleted the wud.json from /WUD/Store and the sensors are back !
Wud did add HAS device for all my containers

Not sure why they don’t survive a reboot ?

Every reboot the MQTT does not add the sensors to homeassistant/Binary_sensors/
but in WUD/Container/local/
??