-
Notifications
You must be signed in to change notification settings - Fork 377
criu: enable setting of RPC config file #1892
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
base: main
Are you sure you want to change the base?
Conversation
This commit adds support for specifying a CRIU RPC configuration file. This allows users to overwrite the default CRIU options used by the container runtimes, for example, to specify options such as `--tcp-established` when checkpointing containers in Kubernetes. For compatibility with runc, the default config file path is set to `/etc/criu/runc.conf`. We check for newer CRIU version than 4.1.1 as libcriu doesn't provide `criu_set_config_file()` in previous versions. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnables specifying a custom CRIU RPC configuration file by conditionally exposing and invoking criu_set_config_file in libcrun (defaulting to /etc/criu/runc.conf) when CRIU ≥ 4.1.1, gated via autotools checks. Class diagram for updated libcrun_checkpoint_restore_s structureclassDiagram
class libcrun_checkpoint_restore_s {
int network_lock_method
char* lsm_profile
char* lsm_mount_context
char* config_file
}
Class diagram for updated libcriu_wrapper_s structureclassDiagram
class libcriu_wrapper_s {
void (*criu_set_work_dir_fd)(int fd)
int (*criu_set_lsm_profile)(const char* name)
int (*criu_set_lsm_mount_context)(const char* name)
int (*criu_set_config_file)(const char* path) // Only if CRIU_CONFIG_FILE is defined
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
cc: @adrianreber |
| # define CRIU_CHECKPOINT_LOG_FILE "dump.log" | ||
| # define CRIU_RESTORE_LOG_FILE "restore.log" | ||
| # define DESCRIPTORS_FILENAME "descriptors.json" | ||
| # define CRIU_RUNC_CONFIG_FILE "/etc/criu/runc.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we have a crun version as well?
If the crun version doesn't exist we can use this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want users be able to use the checkpointing functionality of CRI-O, Podman and containerd with crun in the same way as they would with runc. Support for the runc.conf file was introduced back in 2019 (opencontainers/runc#1933) and has been used as a method to overwrite the CRIU options set by the container runtime. This configuration file allows, for example, to checkpoint/restore containers with established TCP connections in Kubernetes.
In addition to runc.conf, CRIU supports /etc/criu/default.conf. This file is parsed before the CRIU options set by the container runtime via RPC and doesn't overwrite them.
Adding support for crun.conf could confuse users about which configuration file to use and end up being more frustrating than helpful. However, from the perspective of users who do not use runc at all, they might expect the file to be called /etc/criu/crun.conf.
@adrianreber What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @giuseppe means to support both crun.conf and runc.conf, with the former one being a priority.
|
The correct name of the file is tricky. Not sure if we should use runc.conf or crun.conf. @rst0git You should include the annotation possibility from runc also https://github.com/opencontainers/runc/blob/main/docs%2Fcheckpoint-restore.md |
This commit adds support for specifying a CRIU RPC configuration file. This allows users to overwrite the default CRIU options used by the container runtimes, for example, to specify options such as
--tcp-establishedwhen checkpointing containers in Kubernetes. For compatibility with runc, the default config file path is set to/etc/criu/runc.conf.We check for newer CRIU version than 4.1.1 as libcriu doesn't provide
criu_set_config_file()in previous versions: checkpoint-restore/criu#2777Summary by Sourcery
Enable users to override the default CRIU options by specifying a custom RPC configuration file, with support gated on CRIU versions >4.1.1.
New Features:
Enhancements:
Chores: