thin-edge / tedge-container-plugin

thin-edge.io community plugin to manage containers and container groups (aka docker compose)
MIT License
6 stars 2 forks source link

How to clear deleted containers? #49

Open zhong-ys opened 6 days ago

zhong-ys commented 6 days ago

I had some exited containers inside the Raspberry Pi. After installing this container plugin, they all showed up on the platform. I have deleted them from the hardware but they still exist on the platform.

I can see that there are retained mqtt messages in the thin-edge's broker. Is sending a blank message to each service topic the only way to delete them on the platform? Is there a smarter way to delete them or keep the container list up to date?

(Containers in the screenshot no longer exist)

Screenshot 2024-09-24 at 16 25 22
reubenmiller commented 5 days ago

Technically deleting the container's "should" be fairly easy, though it is probably more involved than desired (we want to add some more convenient way to do this in thin-edge.io), but the docs are here for now:

https://thin-edge.github.io/thin-edge.io/operate/registration/deregister/

However, I think we're reaching the limit of the container and container-group scripts (as they are written in posix shell)...it might be time that we start rewriting these elements using either Rust or golang (I would prefer golang in this case as it can re-use the official docker libs as they are also written in go).

reubenmiller commented 8 hours ago

FYI: There is a proposal to introduce new api to help register and deregister components. https://github.com/thin-edge/thin-edge.io/pull/2779

zhong-ys commented 7 hours ago

Thank you Reuben!