Package: docker-shaper
Docker ShaperThis is a spin-off package for thedocker-shapertool, which can be used to monitor Docker stuff
like containers, images and volumes and automatically enforce certain cleanup-rules.Installation[<PYTHON>-m]pip[3]install[--user][--upgrade]docker-shaperUsagedocker-shaper serve`=> Navigate to e.g.http://my-build-node:5432/Development & ContributionPrerequisitesPython 3.8.10+ (e.g. viapyenv)poetryandpre-commitpython3 -m pip install --upgrade --user poetry pre-commitgitclonehttps://github.com/Checkmk/checkmk-dev-toolscdcheckmk-dev-tools/additional_packages/docker_shaper
pre-commitinstall# if you need a specific version of Python inside your dev environmentpoetryenvuse~/.pyenv/versions/3.8.10/bin/python3
poetryinstallWorkflow(once and only for publishing to PyPi) Get token on PyPi.org(maybe) setup distinct repository setuppoetry config repositories.checkmk https://upload.pypi.org/legacy/(once and only for publishing to PyPi)poetry config pypi-token.checkmk pypi-<LONG-STRING>(will write to~/.config/pypoetry/auth.toml)modify and check commits viapre-commitafter work is done locally:adapt version inpyproject.tomlbuild and check a packagepoetrybuild&&\twinecheckdist/*&&python3-mpipuninstall-ycheckmk_dev_tools&&\python3-mpipinstall--userdist/checkmk_dev_tools-$(grep-E"^version.?="pyproject.toml|cut-d'"'-f2)-py3-none-any.whlcheck installed packagego through review processpublish the new packagepoetry publish --build --repository checkmkcommit new version && pushTodoFix: stuck auto-reload: was: postpone=True + monitoring logFix: crawl-images should fix parents not having them listed[-] Fix: stuck crawl images (too many async requests, does not happen in production)Fix:'677aff0727' could not be removed: DockerError(404, 'No such image: 677aff0727:latest')Fix:tried to remove container 4f5fb0848c unknown to usFix: Crashes (see runlog)Image update message only if neededNew TUImake ongoing progress visiblereview log levels (too verbose)installable viapip installQuart interface (instead offlask)auto-apply changes to source and configuration filesoutsourced config filebring in features of formerdgcdbring in features of formerdockermonuntag certain tagscontainer cleanupFixnoneimage lookupExceptions to messagesClipIncrease/decrease logging via web / signalLink: cleanup (images/containers) nowAdd volumes list (with recent owners)Containers: Store CPU / Memory usage over timeContainers: store historyPersist messagesRemove old message/container logsShow different color for unmatched imagesWarn about use of unpinned / upstream imagesHandle 'build cache objects' (found on system prune)Bring in volume monitoring: which volumes have been created and used by which containers?Containers: show total CPU usageContainers: list volumesImages: list parents / childrenVolumes: list usageInstructions to readmeList unmatched / overmatched tagsLinks todelete/removeLinks to jobsLink: inspectGraph: cpu / containers (idle/up)Authenticate (at least if we can modify behavior, like stopping/removing images/containers)Knowledge(just misc links to articles that helped me out)How to delete docker images from Nexus Repository 3Showing Text Box On Hover (In Table)Beautiful Interactive Tables for your Flask Templateshttps://github.com/torfsen/python-systemd-tutorialhttps://www.digitalocean.com/community/tutorials/how-to-use-templates-in-a-flask-applicationhttps://stackoverflow.com/questions/49957034/live-updating-dynamic-variable-on-html-with-flaskhttps://pgjones.gitlab.io/quart/how_to_guides/templating.htmlLogginghttps://pgjones.gitlab.io/hypercorn/how_to_guides/logging.html#how-to-log