Install/uninstall: only remove the containers and images lager owns#146
Merged
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
The deploy script stopped and force-removed EVERY container on the box (docker rm -f $(docker ps -aq)) and pruned every unused image (docker image prune -af); uninstall's image cleanup ran the same prune. On a box that also runs third-party containers — a management agent, a user's own services — this destroyed infrastructure the tooling cannot restore, and the image prune has previously deleted a user's own images. Scope the cleanup to what lager creates: - setup_and_deploy_box.sh: stop/remove only lager, pigpio, and the legacy controller container; image prune drops -a (dangling only). - uninstall.py: replace the blanket image prune with `docker rmi lager` plus a dangling-only prune, and correct the removal summary text. Found by the box-lifecycle CI's first supervised reinstall, which took down the box's own management agent mid-run.
danielrmerskine
force-pushed
the
de/deploy-scoped-cleanup
branch
from
July 23, 2026 20:37
3c76b33 to
34cb1ed
Compare
Merged
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lager install(viasetup_and_deploy_box.sh) stopped and force-removed every container on the box (docker rm -f $(docker ps -aq)) and pruned every unused image (docker image prune -af);lager uninstall's image cleanup ran the same blanket prune. On a box that also runs third-party containers — a management agent, a user's own databases — this destroys infrastructure the tooling cannot restore. The uninstall prune has previously deleted a user's own images in the field; the box-lifecycle CI's first supervised reinstall (#144) reproduced the class directly by taking down the box's own management agent mid-run.Changes
cli/deployment/scripts/setup_and_deploy_box.sh: container cleanup is scoped to what the deployment owns —lager,pigpio, and the legacycontroller— instead of everything on the machine; the image prune drops-a(dangling layers only).cli/commands/utility/uninstall.py: the blanketdocker image prune -afbecomesdocker rmi -f lager+ a dangling-only prune, and the "will be REMOVED" summary now states the true scope.The principle in both: never remove a container or image this tooling did not create. No knowledge of what else runs on the box is needed or assumed.
Testing
bash -non the modified deploy script.test_uninstall_specpins the removal-step spec and passes unchanged).Checklist