-
Notifications
You must be signed in to change notification settings - Fork 608
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
libcriu: add API for join-ns option #1617
libcriu: add API for join-ns option #1617
Conversation
I was a bit confused about the interface. Path names instead of file descriptors. Looking at the RPC and CLI interface I think your implementation is correct as RPC and CLI also use path names and not file descriptors. Which is confusing because inherit-fd uses file descriptors. Everything looks good. Unfortunately the arm tests are currently not running. I will wait for the results from those tests and then it looks ready to be merged. |
Thank you Adrian for the code review. I was hoping to ask for feedback for the test case of join-ns. It would currently check that checkpoint/restore has succeeded. While this is sufficient to check if the join-ns option has been passed to CRIU (example below), we don't currently have tests to verify that sudo make -C test/others/libcriu/ run
sudo cat test/others/libcriu/wdir/i/test_join_ns/restore.log | grep 'join namespace'
(00.000244) Added ipc:/proc/66302/ns/ipc join namespace
(00.000264) Added uts:/proc/66302/ns/uts join namespace
(00.000281) Added time:/proc/66302/ns/time join namespace @avagin do you have any advice? |
I would compare |
In runc we use the join-ns RPC API to enable checkpoint/restore of containers with shared namespaces. Shared namespaces are often used when containers run inside Kubernetes Pod. In crun we use libcriu to interface with CRIU, however it currently doesn't provide an API for join-ns. This patch adds the necessary libcriu API to enable checkpoint/restore of containers with shared namespaces with crun. Signed-off-by: Radostin Stoyanov <[email protected]>
Replace magic numbers used to set log level in libcriu with constants. Signed-off-by: Radostin Stoyanov <[email protected]>
e80f59d
to
85bb660
Compare
Thanks, I've updated the test case. |
c787bae
to
5b49fe4
Compare
Codecov Report
@@ Coverage Diff @@
## criu-dev #1617 +/- ##
============================================
- Coverage 68.84% 68.80% -0.04%
============================================
Files 137 137
Lines 33299 33359 +60
============================================
+ Hits 22924 22953 +29
- Misses 10375 10406 +31
Continue to review full report at Codecov.
|
5a0c770
to
2aa4af9
Compare
This test case aims to verify that CRIU correctly restores a process in IPC, UTS and Time namespaces with criu_join_ns_add() libcriu API. Signed-off-by: Radostin Stoyanov <[email protected]>
15a4662
to
4dae9df
Compare
run_test was trying to read criu logs on build failure instead of runtime error. This patch also removes the unnecessary subfolder with name "i" and resolves some of issues reported by shellcheck. Signed-off-by: Radostin Stoyanov <[email protected]>
4dae9df
to
12366bf
Compare
I see that you changed |
Signed-off-by: Radostin Stoyanov <[email protected]>
We use the join-ns RPC API in runc to enable checkpoint/restore of containers with shared namespaces. Shared namespaces are often used when containers run inside Kubernetes Pod. However, crun is using libcriu to interface with CRIU and libcriu currently doesn't provide an API for join-ns. This pull request adds the libcriu API necessary to enable checkpoint/restore of containers with shared namespaces with crun.