Conversation
5b20ac4 to
e98bea3
Compare
|
ping @hqhq |
|
There is a bug in my pull request I'm trying to fix that. |
|
I think it makes more sense to use |
|
@hqhq yes, seems more legit. I'll update my changes accordingly. I guess that would a bit easier as well. |
68b107c to
c59cec3
Compare
|
ping @hqhq I'm done with your suggested changes, and I think |
|
@boynux Thanks, but docs need to be updated as well. |
|
@hqhq sure, actually I wanted to ask this question. Where are the docs please? Update: |
|
@boynux It's not working in my box: I guess your change is not complete. |
There was a problem hiding this comment.
It's not sufficient to update a created container, you should also update a started container.
There was a problem hiding this comment.
correct, I'll add more tests.
|
@hqhq Regarding your test, that's interesting, the integration tests does exactly what you did and it passes the test (false-positive?). I also tried that several times with no issues. Would you please provide the create/run command for your container as well. I'll check again to see if something is missing. |
|
@boynux The integration test updates a stopped container, and my test is update a running container, just use: |
|
@boynux do you still have time to work on this? |
|
Sorry I was very busy last week and this week too. I partially implemented I don't promise this week but definitely next week I'm able to finish the On Mon, May 23, 2016, 10:40 PM Alexander Morozov [email protected]
|
|
@boynux set swap memory to |
|
@boynux can you rebase? Can take another look and see if we can resolve. |
03f3c25 to
7f42efc
Compare
|
I've rebased the my fork against master. Unfortunately my tests are broken now (which used to work :( ) |
|
Wow! All test passed! What's going on here? |
|
I couldn't test the swap option, the memory one works for me. LGTM if someone can check the swap update. re-ping @coolljt0725, @justincormack |
|
sorry for late response, missing some note from github _:) This doesn't work for me, I need to unset the Before unset the memory limit, we need to unset the @mlaventure maybe your system doesn't enable memory swap limit or am I missing something? |
|
I'll write a test for that. It would be easier to test it that way. |
|
@coolljt0725 correct, memsw isn't enabled on my system :) |
|
@coolljt0725 Your test suggests to also update containerd to reset swap? or it's sufficient to do it here? I'm not sure containerd does this in the correct order. Update: I'm pretty unfamiliar with this code but I guess this is the issue: https://github.com/opencontainers/runc/blob/d1fc80226409b687245e2180d335827027bc3cca/libcontainer/cgroups/fs/memory.go#L98 From the tests I did it seems memory update happens before Swap limit, we can either update runC accordingly or split this into two requests. Or maybe I'm totally lost |
|
@coolljt0725 @mlaventure I found the issue, this commit in RunC solves the problem (with some tweaks on Docker side) Now what is the process to commit these changes into RunC? Should I do a PR and relate it to this ticket? RunC Changes: boynux/runc@41afa94 |
|
@boynux yes, you will need to open a PR in the |
|
Ok, cool. Then I will submit a PR for RunC, once merged I'll update here. |
|
@hqhq Can you review RunC pull request please. |
daemon/update_linux.go
Outdated
There was a problem hiding this comment.
This if condition is not needed.
So we're hacking like:
uint64(-1) = 18446744073709551615
int64(18446744073709551615) = -1
Is everyone comfortable with that? I prefer we change value type to explicitly say we allow negative value here.
There was a problem hiding this comment.
I removed if statement as it's not needed, I think that was left over from master rebase.
The type change requires change to `containerd' types here: https://github.com/docker/containerd/blob/master/api/grpc/types/api.pb.go#L469
I can update that too, it makes sense to use int64 instead. Please give a thumbs up if my proposed change is correct.
e8dfe59 to
e6edeeb
Compare
Possibility to set memory to '-1' which indicates no memory imits. Signed-off-by: boynux <[email protected]>
e6edeeb to
57e386c
Compare
|
I'm going to close this for now, because we need the changes in RunC, but ping me when that is merged, then we can reopen |
In cgroupv1, command `runc update $ID --memory -1` sets both memory and memory+swap to -1 (aka unlimited). This was introduced by commit 18ebc51 (Reset Swap when memory is set to unlimited, Oct 19 2016). This is not the case for cgroupv2. Fix it. References: - opencontainers#1127 - moby/moby#22578 Signed-off-by: Kir Kolyshkin <[email protected]>
In cgroupv1, command `runc update $ID --memory -1` sets both memory and memory+swap to -1 (aka unlimited). This was introduced by commit 18ebc51 (Reset Swap when memory is set to unlimited, Oct 19 2016). This is not the case for cgroupv2. Fix it. References: - opencontainers#1127 - moby/moby#22578 Signed-off-by: Kir Kolyshkin <[email protected]>
- What I did
Close #22516
- How I did it
If memory parameter is not changed by update command set is as '-1'
- How to verify it
docker create --name test -m 50m busybox:latest
docker inspect -f '{{.HostConfig.Memory}}' test
#52428800
docker update -m -1 test
docker inspect -f '{{.HostConfig.Memory}}' test
# -1
- Description for the changelog
Remove memory constraints after creating/running container with update command
Possibility to set memory to '-1' which removes memory constraints
Signed-off-by: boynux [email protected]