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

[Documentation]: document volumes and mounts #2163

Open
mdelapenya opened this issue Jan 25, 2024 · 8 comments
Open

[Documentation]: document volumes and mounts #2163

mdelapenya opened this issue Jan 25, 2024 · 8 comments
Labels
documentation Docs, docs, docs. good first issue Want to contribute to testcontainers? Start from here

Comments

@mdelapenya
Copy link
Collaborator

Proposal

They are not properly documented in our docs

@mdelapenya mdelapenya added documentation Docs, docs, docs. good first issue Want to contribute to testcontainers? Start from here labels Jan 25, 2024
@srabraham
Copy link
Contributor

srabraham commented Jan 30, 2024

This seemed like a good place to remark on my experience in the last couple of days with mounts, as a testcontainers-go user.

My bind mounts quietly stopped working when I upgraded from 0.26.0 to 0.27.0, for some reason I couldn't figure out (the deprecation of bind mounts in testcontainers wasn't supposed to break them). So, I switched over to volumes instead. That created a lot more pain, since our CI system got overrun with volumes. As it turned out, named volumes don't get cleaned up by ryuk, so they stuck around indefinitely. The testcontainers-go API makes it really tempting to set a non-empty name for volumes, but the consequences of that are quite bad.

Anyway, yeah, more documentation on this stuff would be great :).

Also, there was some quite misleading logging in place as of when bind mounts were deprecated, and I made a PR to improve that. https://github.com/testcontainers/testcontainers-go/pull/2178/files

@mdelapenya
Copy link
Collaborator Author

@srabraham thanks for raising your voice on this issue. I do appreciate your feedback.

My bind mounts quietly stopped working when I upgraded from 0.26.0 to 0.27.0, for some reason I couldn't figure out (the deprecation of bind mounts in testcontainers wasn't supposed to break them)

I'm interested in this. Could you share a repo where it happened? As you pointed out, they should not break any client code as per the deprecation, although I could have committed a mistake during the deprecation path.

named volumes don't get cleaned up by ryuk

Did you manually created the volumes? If not I'd expect testcontainers-go to label the volumes accordingly, so that Ryuk prunes them. Could you run Ryuk in verbose mode, so you're be able to check what volumes are pruned?: https://github.com/testcontainers/moby-ryuk/blob/430d3338e3af80816a0a7445a90b4a1e58b1c710/main.go#L330-L337.

In order to do so: https://golang.testcontainers.org/features/configuration/#customizing-ryuk-the-resource-reaper. Since v0.27.0 it's possible to run Ryuk in verbose mode.

The testcontainers-go API makes it really tempting to set a non-empty name

Mmmm could you share how did you create the volumes? I think this answers my previous question so you probably used the API. I'm interested in how so I can double check and identify where the experience is broken.

@srabraham
Copy link
Contributor

Regarding bind mount breakage at 0.27.0, I made a separate bug report here with a very simple reproduction: #2179

@srabraham
Copy link
Contributor

and here's a demo of named volumes not getting deleted by ryuk: https://github.com/srabraham/demovolume/blob/main/main.go

@srabraham
Copy link
Contributor

@mdelapenya in case you missed it, please have a look at my additional demo above (#2163 (comment)), which shows how named volumes don't get cleaned up by Ryuk.

@mdelapenya
Copy link
Collaborator Author

@mdelapenya in case you missed it, please have a look at my additional demo above (#2163 (comment)), which shows how named volumes don't get cleaned up by Ryuk.

I think we should open a bug in https://github.com/testcontainers/moby-ryuk

@mdelapenya
Copy link
Collaborator Author

@srabraham here it's the fix #2191

@srabraham
Copy link
Contributor

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Docs, docs, docs. good first issue Want to contribute to testcontainers? Start from here
Projects
None yet
Development

No branches or pull requests

2 participants