Skip to content

Draft: Improve cleanup to remove stale containers

Karel Koci requested to merge args-tag into master

This improves cleanup to not only remove old images but also a stale containers.

There are two types of containers nsfarm spawns. Those are bootstrap and regular containers. The bootstrap containers are spawned with intention to create image while regular containers are just spawned to be later removed. The difference is that while regular containers are always tied to one specific process (the instance of nsfarm) the bootstrap is intentionally global to serialize multiple instances on single image creation. The cleanup algorithm can remove any regular container that's parent is no longer running. The bootstrap containers do not contain info about parent process and thus we use time to remove just old containers.

Warning: This changes the template for regular container name. The change is needed for reliable PID parsing from template name. The unclear state is when image would end with dash and number.

Merge request reports