-
Notifications
You must be signed in to change notification settings - Fork 355
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
Implement container restore functionality #2335
Comments
You can check the crun code for help : |
Hey, I'm trying to research > sudo podman run --runtime ~/rust_project/youki/youki -dt fedora bash -c "v=0;while true;do sleep 1; echo \"\$v\"; let \"v++\";done;"
> sudo podman container --runtime ~/rust_project/youki/youki ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
eb0b484cafdc registry.fedoraproject.org/fedora:latest bash -c v=0;while... 17 minutes ago Up 17 minutes ago musing_cohen
> sudo podman container --runtime ~/rust_project/youki/youki checkpoint eb0b484cafdc21a4d9
DEBUG youki: started by user 0 with ArgsOs { inner: ["/home/yjn/rust_project/youki/youki", "checkpoint", "--image-path", "/var/lib/containers/storage/overlay-containers/eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280/userdata/checkpoint", "--work-path", "/var/lib/containers/storage/overlay-containers/eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280/userdata", "eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280"] }
DEBUG youki::commands::checkpoint: start checkpointing container eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280
ERROR libcontainer::container::container_checkpoint: failed to open criu image directory path="/var/lib/containers/storage/overlay-containers/eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280/userdata/checkpoint" err=Os { code: 2, kind: NotFound, message: "No such file or directory" }
ERROR youki: error in executing command: failed to checkpoint container eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280
Caused by:
0: io error
1: No such file or directory (os error 2)
Error: failed to checkpoint container eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280
Caused by:
0: io error
1: No such file or directory (os error 2)
Error: `/home/yjn/rust_project/youki/youki checkpoint --image-path /var/lib/containers/storage/overlay-containers/eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280/userdata/checkpoint --work-path /var/lib/containers/storage/overlay-containers/eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280/userdata eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280` failed: exit status 1 Of course, I've made the necessary changes to rename the
I believe the cause of the error is likely not related to my system environment (e.g., CRIU) because I can perform |
After resolving the mentioned
I'd like to know if these errors can be reproduced by others? Is it necessary to open a separate issue to address the potential problems with |
Hey, can you mention what what the issue behind this error, and how did you resolve it?
I haven't tried running checkpoint before, I had assumed it was working. I will try running and checking for errors that you encountered. If this is a bug, and not just setup issue, then we can either fix it along with restore impl, or open separate issue. |
It's quite simple, just create the missing directories directly. (It seems to be the case in runc as well.)
|
There is indeed some issue in checkpoint impl, as same error also occurs on my system as well. There is an issue open on criu that has similar to error checkpoint-restore/criu#1785 , but needs more investigation on why it is happening. Thanks for checking and reporting. The initial issue of |
Thanks for your sharing too~
I noticed that, the way runc handles |
@adrianreber can you help us with some suggestions regarding this error in checkpointing ? I saw the issues checkpoint-restore/criu#860 and checkpoint-restore/criu#1785 , but the kernel issue in the first one does not seem applicable. As mentioned by @anti-entropy123 , the checkpointing is working with runc, so what can be a potential cause for this particular error, or what might be a good idea for trying to debug this? |
Not sure what the question is, but I can only recommend not to use Ubuntu for CRIU. There are non upstream kernel patches which break CRIU all the time. Sorry. |
Hey, sorry if I wasn't clear : while trying out the current implementation of youki's checkpoint both @anti-entropy123 and me are getting error from criu |
Ah, I see. The current implementation does only work without a connected terminal. To handle the terminal correctly additional steps are necessary. Especially during restore a callback is necessary to tell youki the correct tty FD. You should look at crun as the criu rust bindings are closer to the c bindings from the architecture. |
Thank you for your help. I removed the |
ref : continues from #142
Currently youki supports checkpointing, (with command name
checkpointt
) , but the restore part has not been implemented yet. We should do that.Note Before anyone starts with this, make sure the following commands are working as expected on your system:
After that implement restore in youki, rename the
checkpointt
tocheckpoint
and make the above work with youki instead of runc.Another Note criu library is quite specific with which kernel versions it supports and need. If you run into criu failure with seg-fault , check previous issues on criu and check if you need to upgrade/downgrade library version for your kernel.
I ran above on ubuntu-based, kernel version 6.4.6 , criu v3.17.1 (3.16 does not work)
The text was updated successfully, but these errors were encountered: