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

c/r: create cgroups to restore a container #253

Merged
merged 3 commits into from
Sep 12, 2015

Conversation

avagin
Copy link
Contributor

@avagin avagin commented Sep 8, 2015

Here are two reasons:

  • If we use systemd, we need to ask it to create cgroups
  • If a container is restored with another ID, we need to
    change paths to cgroups.

Cc: @boucher
Signed-off-by: Andrey Vagin avagin@openvz.org

@boucher
Copy link
Contributor

boucher commented Sep 8, 2015

@avagin Thanks. This does resolve the pause after restore issue we were discussing on the mailing list. One thing I just noticed is that "docker top" doesn't quite seem to work in the same situation. Prior to this patch it failed the same way, complaining about the missing cgroup. With this patch, it just reports an empty process list.

@avagin
Copy link
Contributor Author

avagin commented Sep 9, 2015

@boucher I have fixed a bug, I filled CgRoot incorrectly. Could you try again?

@boucher
Copy link
Contributor

boucher commented Sep 9, 2015

I'll try now. Proto.string is the only change, right?

@boucher
Copy link
Contributor

boucher commented Sep 9, 2015

I'm now seeing:
Error (cgroup.c:901): cg: Can't move into cpuset//sys/fs/cgroup/cpuset/docker/c2c42479f89bc9199a6902e892421f19c230369a72df802f3d76ce446fb93c1b/tasks (-1/0): No space left on device

@boucher
Copy link
Contributor

boucher commented Sep 9, 2015

I tried again and got a different error this time:
Error (cgroup.c:978): cg: Failed closing cpuset//sys/fs/cgroup/cpuset/docker/c42f9bb7fdca44bca20a1c7504d60e7eeabc88dcb6527814169f99a071df0fc8/cpuset.cpus: Permission denied

@boucher
Copy link
Contributor

boucher commented Sep 9, 2015

(I'm running as root and have 20gb available on this vm)

This is failing for me both in the regular checkpoint/restore same container case, and the restore into a new container case.

@avagin avagin force-pushed the cr-cgroups branch 2 times, most recently from 26a1ef6 to 1a137c6 Compare September 10, 2015 09:07
@avagin
Copy link
Contributor Author

avagin commented Sep 10, 2015

@boucher, could you try out this version? I want to think that it's a final one:)

@boucher
Copy link
Contributor

boucher commented Sep 10, 2015

This is working again, but the issue with docker top remains. And, looking a bit closer, I think there's still something not quite right.

If I do docker run and then docker pause, and then look in /sys/fs/cgroup/freezer/docker//cgroup/procs, I see the pid of the process running in the container.

However, if I checkpoint and then restore and then pause, that file is empty (whether I checkpoint/restore the same container, or restore into a new container).

@avagin
Copy link
Contributor Author

avagin commented Sep 10, 2015

Damn! I fixed one more bug.

return cgroups, nil
}

func getControlerPath(subsystem string, cgroups map[string]string) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to rename this getControllerPath with two Ls.

Currently we parse /proc/self/cgroup for each controller.
It's ineffective.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Here are two reasons:
* If we use systemd, we need to ask it to create cgroups
* If a container is restored with another ID, we need to
  change paths to cgroups.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
@boucher
Copy link
Contributor

boucher commented Sep 10, 2015

This looks good. Everything seems to be working.

@crosbymichael
Copy link
Member

LGTM

@crosbymichael
Copy link
Member

ping @LK4D4 @mrunalp

@mrunalp
Copy link
Contributor

mrunalp commented Sep 11, 2015

LGTM

mrunalp pushed a commit that referenced this pull request Sep 12, 2015
c/r: create cgroups to restore a container
@mrunalp mrunalp merged commit ef9471f into opencontainers:master Sep 12, 2015
stefanberger pushed a commit to stefanberger/runc that referenced this pull request Sep 8, 2017
Clarify backwards compatibility for major version 0
stefanberger pushed a commit to stefanberger/runc that referenced this pull request Sep 8, 2017
This reverts commit 0f25f18, opencontainers#253.
Now that we're on to 1.0, we don't need to talk about 0.x.  And the
lack of 0.x backwards compatability is covered by SemVer 2.0 section 4
[1]:

  Major version zero (0.y.z) is for initial development.  Anything may
  change at any time.  The public API should not be considered stable.

so removing the echo from our spec doesn't actually change anything.

The conflict is due to 4e63ee0 (config: qualify the name of the
version field, 2016-01-13, opencontainers#309), and only impacted the context and
line-wrapping around the sentence I'm removing.

Conflicts:
	config.md

[1]: http://semver.org/spec/v2.0.0.html

Signed-off-by: W. Trevor King <wking@tremily.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants