-
Notifications
You must be signed in to change notification settings - Fork 29
Respect TESTCONTAINERS_RYUK_DISABLED ENV flag
#225
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
base: main
Are you sure you want to change the base?
Conversation
|
well, by all means. If someone wants to do this, disable ryuk, and possibly fill up their disk with docker containers due to failed test runs or vups closed terminal, its ok i guess. I see also java library says that they actually close the containers manually in the library, and i think this does it too, Its just a security mechanism to use ryuk. ill think about it :) |
|
Thanks for the response. I think the main question here is: Will testcontainers work - yes or no? The reason being, that docker containers run as root, whereas podman doesn't. Ryuk apparently requires to be run as root. I think testcontainers might even be able to identify this and also detect if podman is running and could give advice. The possible solutions (I'm aware):
I looked into the java implementation and they actually give a warning, when they disable ryuk and it can lead to unintended behavior, that's a good thing to do. Also they try to cleanup afterwards, that seems a good idea, too - If you give me an idea where to get the I think first #221 shall land to bring in the property reader, then this PR can adopt to it. |
|
ah death note. jvm exit. this is the best thing with java. In elixir its not possible. I think we have a plan here.
And yes you have a fair point that the elevation needed to cleanup containers can be a real problem. I checked the exunit macro and it properly closes the containers on happy path scenarios. ref https://github.com/testcontainers/testcontainers-elixir/blob/main/lib/exunit.ex#L58 so, if a user uses the RYUK disabled flag, via env var or properties, the containers will quickly fill up the disk if not reusing containers (which is supported) or forgetting to stop containers after use. However, this IS a user problem and not a library problem, so I could be open for adding it in. |
|
i also agree on bringing in property support as you mentioned, first |
|
@gossi now you can sync and fix conflicts |
|
i will definitely improve the code when your pr is merged. So near perfect might be good enough for now :) |
613b951 to
bd71feb
Compare
|
Ok, I've switched to using the I've checked I did not check for the situation, that we can give advice here (I need to learn better elixir here at first I guess). Anything else? |
jarlah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small change, and we are good. I could do it in another commit afterwards but its better to cleanup in this PR
lib/testcontainers.ex
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets remove socket: socket. Its not used anywhere. Socket is only used to register ryuk filter
|
Aye, pushed |
Hello,
I'm trying to use testcontainers for an elixir project on a mac with podman. Under some conditions the stars must align for it to work, as such for me. I followed these steps here:
With all the different errors:
the errors center around
ryuk. I still dunno what that is to be fair, but I understand it as a container to assist managing other containers. Though this can lead to problems under podman(/mac). And the docs recommend to turn offryukwith this flag:export TESTCONTAINERS_RYUK_DISABLED=truehowever, nothing changed for me. When I searched for this env var on this repo, the results were empty and I had my answer. I searched the node and java repo for that env var and they had implementations for it.
I looked into the node impl and I thought to give it a shot. I made a very stubborn form for my impl. I'd say it acts more of a poc. I run the tests, too - I had 5 timeouts. Compared to before were no tests ran at all, this is a very good improvement 😁
Also I used this fork, used it as path dep to my actual project, and could run the tests over there - yeah 🥳
I think the POC is looking quite promising. There is plenty ways to write my code changes. I dunno what would match your style (also I'm still quite fresh to elixir). I'd kindly ask you to take over my PR.
Thanks a lot.