Skip to content

fix(dogfood/coder): stop docker containers and prune system on shutdown #17904

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

Merged
merged 3 commits into from
May 19, 2025

Conversation

mafredri
Copy link
Member

Hopefully the final update to thne fix in #17110

This change greatly speeds up workspace destruction:

2025-05-19 12:26:57.046+03:00 docker_container.workspace[0]: Destroying... [id=2685e2f456ba7b280c420219f19ef15384faa52c61ba7c087c7f109ffa6b1bda]
2025-05-19 12:27:07.046+03:00 docker_container.workspace[0]: Still destroying... [10s elapsed]
2025-05-19 12:27:16.734+03:00 docker_container.workspace[0]: Destruction complete after 20s

Hopefully the final update to thne fix in #17110

This change greatly speeds up workspace destruction:

```
2025-05-19 12:26:57.046+03:00 docker_container.workspace[0]: Destroying... [id=2685e2f456ba7b280c420219f19ef15384faa52c61ba7c087c7f109ffa6b1bda]
2025-05-19 12:27:07.046+03:00 docker_container.workspace[0]: Still destroying... [10s elapsed]
2025-05-19 12:27:16.734+03:00 docker_container.workspace[0]: Destruction complete after 20s
```
@mafredri mafredri self-assigned this May 19, 2025
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I think the change is worth a shot, my only concern is that someone will attempt to use this template outside of our infrastructure and get an unwelcome surprise.

@mafredri
Copy link
Member Author

While I think the change is worth a shot, my only concern is that someone will attempt to use this template outside of our infrastructure and get an unwelcome surprise.

Do you think it's likely? It wouldn't be my first guess, it depends on external docker hosts and has Coder specific parameters, but 🤷🏻‍♂️. They would also need to change the template to use a volume for /var/lib/docker, otherwise the containers and images would be wiped anyway (including volumes).

@mafredri
Copy link
Member Author

@johnstcn added some more color to the comment.

Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the addition of a comment is sufficient here.

@mafredri mafredri merged commit 3dbd424 into main May 19, 2025
33 checks passed
@mafredri mafredri deleted the mafredri/fix-dogfood-docker-cleanup branch May 19, 2025 10:23
@github-actions github-actions bot locked and limited conversation to collaborators May 19, 2025
@mafredri mafredri changed the title fix(dogfood/coder): run docker system prune on shutdown fix(dogfood/coder): stop docker containers and prune system on shutdown May 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants