add a docker system prune with configurable options to undeploy step of lifecycle #417

Closed
opened 2023-02-14 13:30:12 +00:00 by codegod100 · 15 comments
Member
No description provided.
codegod100 added the
enhancement
label 2023-02-14 13:30:12 +00:00
Owner

Perhaps abra app undeploy --prune? And abra system prune [--all] [--volumes] (for the case where the app local configs are completely deleted and abra has no way to knowing which apps are deployed?) In general I'd like a separate command for this as it get hards to debug when the functionality is mixed? But yeh, happy to see some UI/UX proposals on this!

Perhaps `abra app undeploy --prune`? And `abra system prune [--all] [--volumes]` (for the case where the app local configs are completely deleted and `abra` has no way to knowing which apps are deployed?) In general I'd like a separate command for this as it get hards to debug when the functionality is mixed? But yeh, happy to see some UI/UX proposals on this!
Author
Member

Should this be abra server prune <server name> there is currently no system command and I don't know if a datapoint of 1 is justifcation for a new sub command?

Should this be `abra server prune <server name>` there is currently no system command and I don't know if a datapoint of 1 is justifcation for a new sub command?
Owner

Oh yeh, that's nice @codegod100! Perhaps rm vs. prune might be confusing there, so feel free to try another wording. But probably docs on the sub-command can solve this.

Oh yeh, that's nice @codegod100! Perhaps `rm` vs. `prune` might be confusing there, so feel free to try another wording. But probably docs on the sub-command can solve this.
Member

+1 for an abra prune command (I have to ssh on to the server and run it often because of deploying incremental and the old docker images taking up space)
It would be nice to show a list of running containers, explaining that all containers not currently running will be deleted (including their stored secrets) and prompt to continue (yeah been burned before 😅)

+1 for an abra prune command (I have to ssh on to the server and run it often because of deploying incremental and the old docker images taking up space) It would be nice to show a list of running containers, explaining that all containers not currently running will be deleted (including their stored secrets) and prompt to continue (yeah been burned before 😅)
Author
Member

@mayel currently it doesn't remove secrets. Is that something I should add? Right now I'm calling the built in prune commands on the docker client. "Pruning" secrets is kind of a non-concept. I can add a prompt to continue and a container list.

@mayel currently it doesn't remove secrets. Is that something I should add? Right now I'm calling the built in prune commands on the docker client. "Pruning" secrets is kind of a non-concept. I can add a prompt to continue and a container list.
Member

Well I'm not sure what's expected behaviour but in my experience I had to recreate or readd the secrets after redeploying an accidentally pruned

Well I'm not sure what's expected behaviour but in my experience I had to recreate or readd the secrets after redeploying an accidentally pruned
Author
Member

I'm pretty sure there is no prune functionality for docker secrets maybe it was #405 ?

I'm pretty sure there is no prune functionality for docker secrets maybe it was https://git.coopcloud.tech/coop-cloud/organising/issues/405 ?
Author
Member

I found an open ticket about possibly pruning secrets in the future https://github.com/moby/moby/issues/38007

I found an open ticket about possibly pruning secrets in the future https://github.com/moby/moby/issues/38007
Member

I don't mean as an abra thing, just when running docker system prune directly on the server when your app isn't running

I don't mean as an abra thing, just when running `docker system prune` directly on the server when your app isn't running
Author
Member

I'm pretty sure docker system prune doesn't touch secrets unless I'm misunderstanding you.

image

I'm pretty sure `docker system prune` doesn't touch secrets unless I'm misunderstanding you. ![image](/attachments/f49af3b8-f535-49b6-849c-bade9220ee1e)
Member

Well maybe it doesn't actually remove them, but if you remove a stoppedcontainer they don't get re-associated correctly when you redeploy it?

Well maybe it doesn't actually remove them, but if you remove a stoppedcontainer they don't get re-associated correctly when you redeploy it?
Member

By contrast when that happened the volumes got correctly re-associated

By contrast when that happened the volumes got correctly re-associated
Author
Member

I haven't really messed with docker secrets because my primary development app doesn't use secrets. If this is the case it's definitely good to be mindful of. I'll look into it.

I haven't really messed with docker secrets because my primary development app doesn't use secrets. If this is the case it's definitely good to be mindful of. I'll look into it.
Member

May be good to also expose docker image prune (ideally even as a flag to autorun after a deploy) which should be enough for cases where you didn't undeploy and just need to keep a handle on storage space. Bit of a tangent from the original issue, but it's been

May be good to also expose `docker image prune` (ideally even as a flag to autorun after a deploy) which should be enough for cases where you didn't undeploy and just need to keep a handle on storage space. Bit of a tangent from the original issue, but it's been
Author
Member

I undeployed an app with secrets and did a system prune and verified that all images and containers relating to it were gone and then redeployed and the secrets still worked. I'll keep my eye on it to see if I see a pattern somewhere.

I undeployed an app with secrets and did a system prune and verified that all images and containers relating to it were gone and then redeployed and the secrets still worked. I'll keep my eye on it to see if I see a pattern somewhere.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#417
No description provided.