enable cgroups memory.oom_control#11034
enable cgroups memory.oom_control#11034thaJeztah merged 1 commit intomoby:masterfrom HuKeping:oom_kill_disable
Conversation
|
You shouldn't add libcontainer changes here, do it in libcontainer project. |
|
Conflict with #10298 , better hold a while for now :) |
There was a problem hiding this comment.
memory.oom_control is with memory cgroup, I think it is not needed to check this file separately.
There was a problem hiding this comment.
yes, this check is redundancy :), but it is a little wired we make sysInfo.OomKillDisable= true without doing anything.
|
I've added it in libcontainer, but it seems libcontainer in docker/docker is far behind the one in docker/libcontainer |
|
@hqhq updated, and this PR needs docker-archive/libcontainer#417 to be merged. |
|
updated and docker-archive/libcontainer#417 merged. Since the docker/docker's libcontainer has not changed yet, this PR will fail for build :( |
|
Yes, of course it is, all cgroup related configs are host dependent, because different hosts could have different cgroup subsystems mounted. |
|
updated as @hqhq 's advice. |
|
@HuKeping The main problem that soon there won't be |
There was a problem hiding this comment.
We should not add it here, all these codes below if job.EnvExists("HostConfig") is for backward compatibility, the new comings should always in HostConfig in json, or it won't work. We should lead users to use it the right way.
There was a problem hiding this comment.
This is not in the if job.EnvExists block
There was a problem hiding this comment.
You got me wrong, normally ContainerHostConfigFromJob should be as simple as just return job.GetenvJson("HostConfig", &hostConfig), all other codes are for backward compatibility, because we didn't have hostConfig at the first time.
For the new fields put into hostConfig, users should only use them through hostConfig, so if users want to use it, there would always have HostConfig env, and we can get the field from it, so you don't need to job.GetenvBool("OomKillDisable").
|
You need to add docs as well. |
|
OK, docs will come soon |
|
Although |
|
LGTM |
|
LGTM moving to docs review |
|
Docs LGTM ping @moxiegirl @fredlf @SvenDowideit @thaJeztah |
|
The docs so far look good, but some info has to be added to the Run reference that has a section on constraining Memory. |
|
@thaJeztah updated |
There was a problem hiding this comment.
This should be the same text as the other documents;
--oom-kill-disable=true|false: Whether to disable OOM Killer for the container or not.
|
Thanks for @thaJeztah advise, updated. |
|
Thanks! Could you put the @jamtur01 @moxiegirl @fredlf @SvenDowideit PTAL for the added docs |
|
@thaJeztah updated |
There was a problem hiding this comment.
Based on the reference you wrote, I expected to see:
$ docker run -ti -m 100M --oom-kill-disable=true ubuntu:14.04 /bin/bash
Why is that =true (or false) missing here?
There was a problem hiding this comment.
It's because of the (IMO) confusing way that Boolean flags are documented. Basically, --enable-foo=true is the same as --enable-foo, and --enable-foo=false is the same as not setting the --enable-foo flag. For more info, see #9406.
In general, you don't actually add the true/false value, even though you can.
If you're okay with not documenting the =true|false here, I'd be +1, but it would be inconsistent with other parts of the docs 😞
There was a problem hiding this comment.
I'd like to +1 for just --oom-kill-disable
There was a problem hiding this comment.
@thaJeztah I was afraid of this; wow, I think that is confusing even without the lemon drops I've been drinking. Uh, ok. I'll tweak my comments. We do need to fix this though, I think you are right.
|
hi @moxiegirl updated as your advise but not use the |
Add cgroup support for disable OOM killer. Signed-off-by: Hu Keping <[email protected]>
|
Thanks for the work @HuKeping. LGTM |
|
Thanks @HuKeping LGTM |
enable cgroups memory.oom_control
This PR is related to #11026
closes #11026