Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Can't easily remove underlying volumes #499

Open
BenElgar opened this issue Nov 11, 2021 · 4 comments
Open

[BUG] Can't easily remove underlying volumes #499

BenElgar opened this issue Nov 11, 2021 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@BenElgar
Copy link
Contributor

We don't provide users with any mechanism to remove/empty docker volumes — the equivalent of running docker volume rm my-vol. Right now they have to run that command directly. The problem then is that, since we don't clean up containers, the user will be presented with an error like the following:

Error response from daemon: remove count: volume is in use - [1fe52ecb91b5365149ed2df9a5771656e7d153d689f8bebf9799cd8a9ac2f6c5, 305bbe5d72517c47c85a9b4321087f688a2883c575d736e27930fce73e7c1775, 44f51a2d4f6d81509a0edef30c19cbc6dac0429c51d8a01508e618f02c1a6277]

I would propose we add a --remove-volumes flag to the exo stop command to handle this. Docker compose has a similar flag: https://docs.docker.com/compose/reference/down/

@BenElgar BenElgar added bug Something isn't working needs triage Incoming request that needs to be triaged and prioritized labels Nov 11, 2021
@brandonbloom
Copy link
Member

This seems like a real problem, but I don't love the proposed solution borrowed from Compose.

Why don't we clean-up containers? Is that just a bug?

Why wouldn't we clean-up volumes automatically?

@BenElgar
Copy link
Contributor Author

Docker generally leaves containers around after they've stopped running so that you can go and inspect them afterwards. That seems pretty reasonable but I'd be okay with cleaning them up as well.

Presumably the point of having a volume is to persist state between runs of the workspace. Cleaning up the volumes automatically would seem to render them mostly useless — but maybe I'm misunderstanding.

@BenElgar BenElgar linked a pull request Nov 16, 2021 that will close this issue
@brandonbloom
Copy link
Member

Docker generally leaves containers around after they've stopped running so that you can go and inspect them afterwards.

Gotcha. I think this is related to the work I started over in #385 - I think what I want to do is separate "component" from "resource", so that a component can actually have N >= 0 resources at any given time. For instance, a container component starts with zero resources, then creates one, then when it creates another resource later, it may keep around the old resource for some garbage collection period, etc.

Presumably the point of having a volume is to persist state between runs of the workspace.

We probably need to give some more thought to the "run" concept. To me, run should be about starting/stopping components, not necessarily about creating/destroying them. That is, if you interrupt a run, it should leave around stateful stuff until you destroy the stack.

@brandonbloom
Copy link
Member

See also "protected resources": #248

@brandonbloom brandonbloom added this to the Overhaul milestone Feb 28, 2022
@brandonbloom brandonbloom removed overhaul needs triage Incoming request that needs to be triaged and prioritized labels Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants