Add --remove-orphans to the deploy step - #368
Merged
Merged
Conversation
docker compose up -d alone leaves containers running for services that were removed from docker-compose.yml -- it only affects services still defined in the file. This is exactly what happened when #367 dropped the pypi/netmon services: their containers kept running untouched (netmon crash-looping) until a reboot surfaced it, at which point they just came back via each container's own restart policy. --remove-orphans makes 'docker compose up -d' actually reconcile to match the file.
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
Adds
--remove-orphansto the deploy script'sdocker compose up -dcall.Why
`docker compose up -d` alone only reconciles services still defined in
docker-compose.yml-- it leaves containers running for services that were removed from the file untouched. This is exactly what happened with #367 (dropping thepypi/netmonservices): both containers kept running unnoticed after that PR merged and deployed successfully, since the deploy step never actually told Docker to remove them. Only surfaced today when a VM reboot restarted them via their ownrestart: unless-stoppedpolicy (netmoncame back crash-looping, since its image/volumes are gone).Cleaned up the currently-running orphans manually via
docker compose up -d --remove-orphanson the host; this PR makes sure the deploy step does that automatically going forward for any future service removals.Test plan
docker compose up -d --remove-orphansonbuildbot-master-- confirmedpypiandnetmoncontainers stopped and removed,db/caddy/buildbotunaffected.