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

restore: tell CRIU to use existing namespaces #2583

Merged

Conversation

adrianreber
Copy link
Contributor

runc already tells CRIU to restore into an existing network or PID namespace if there is a path to a namespace specified in config.json.

PID and network have special handling in CRIU using CRIU's inherit_fd interface.

For UTS, IPC and MOUNT namespaces CRIU can join those existing namespaces using CRIU's join_ns interface.

This is especially interesting for environments where containers are running in a pod which already has running containers (pause for example) with namespaces configured and the restored container needs to join these namespaces.

CRIU has no support to join an existing CGROUP namespace (yet?) why restoring a container with a path specified to a CGROUP namespace will be aborted by runc.

CRIU would have support to restore a container into an existing time namespace, but runc does not yet seem to support time namespaces.

@h-vetinari
Copy link

@kolyshkin
Copy link
Contributor

CI complains:

script/validate-gofmt
These files are not properly gofmt'd:

  • libcontainer/container_linux.go

Please reformat the above files using "gofmt -s -w" and commit the result.

@adrianreber
Copy link
Contributor Author

@kolyshkin Thanks for the review. I changed the code and also used gofmt (I always forget that).

Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

Wait a minute...

@adrianreber
Copy link
Contributor Author

With the changes tests are failing... Because the code is just wrong. Will fix it.

runc already tells CRIU to restore into an existing network or PID
namespace if there is a path to a namespace specified in config.json.

PID and network have special handling in CRIU using CRIU's inherit_fd
interface.

For UTS, IPC and MOUNT namespaces CRIU can join those existing
namespaces using CRIU's join_ns interface.

This is especially interesting for environments where containers are
running in a pod which already has running containers (pause for
example) with namespaces configured and the restored container needs to
join these namespaces.

CRIU has no support to join an existing CGROUP namespace (yet?) why
restoring a container with a path specified to a CGROUP namespace will
be aborted by runc.

CRIU would have support to restore a container into an existing time
namespace, but runc does not yet seem to support time namespaces.

Signed-off-by: Adrian Reber <areber@redhat.com>
@adrianreber
Copy link
Contributor Author

Now it works as intended.

Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

LGTM

@kolyshkin
Copy link
Contributor

@AkihiroSuda @mrunalp PTAL

@AkihiroSuda AkihiroSuda merged commit fb59e6f into opencontainers:master Nov 9, 2020
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