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

checkpoint/restore: implement --manage-cgroups-mode ignore #3546

Merged
merged 7 commits into from
Jan 27, 2023

Commits on Dec 15, 2022

  1. restore: fix ignoring --manage-cgroups-mode

    Merge the logic of setPageServer, setManageCgroupsMode, and
    setEmptyNsMask into criuOptions. This does three things:
    
    1. Fixes ignoring --manage-cgroups-mode on restore;
    2. Simplifies the code in checkpoint.go and restore.go;
    3. Ensures issues like 1 won't happen again.
    
    Signed-off-by: Kir Kolyshkin <[email protected]>
    kolyshkin committed Dec 15, 2022
    Configuration menu
    Copy the full SHA
    ff3b4f3 View commit details
    Browse the repository at this point in the history
  2. checkpoint/restore: add --manage-cgroups-mode ignore

     - add the new mode and document it;
     - slightly improve the --help output;
     - slightly simplify the parsing code.
    
    Signed-off-by: Kir Kolyshkin <[email protected]>
    kolyshkin committed Dec 15, 2022
    Configuration menu
    Copy the full SHA
    212d25e View commit details
    Browse the repository at this point in the history
  3. restore: fix --manage-cgroups-mode ignore on cgroup v2

    When manage-cgroups-mode: ignore is used, criu still needs to know the
    cgroup path to work properly (see [1]).
    
    Revert "libct/criuApplyCgroups: don't set cgroup paths for v2"
    
    This reverts commit d5c57dc.
    
    [1]: checkpoint-restore/criu#1793 (comment)
    
    Signed-off-by: Kir Kolyshkin <[email protected]>
    kolyshkin committed Dec 15, 2022
    Configuration menu
    Copy the full SHA
    3438ef3 View commit details
    Browse the repository at this point in the history
  4. libct/criuApplyCgroups: add a TODO

    I don't want to implement it now, because this might result in some
    new issues, but this is definitely something that is worth implementing.
    
    Signed-off-by: Kir Kolyshkin <[email protected]>
    kolyshkin committed Dec 15, 2022
    Configuration menu
    Copy the full SHA
    e8cf878 View commit details
    Browse the repository at this point in the history
  5. tests/int: add "--manage-cgroups-mode ignore" test

    This test checks that the container is restored into a different cgroup.
    
    To do so, a user should
     - use --manage-cgroups-mode ignore on both checkpoint and restore;
     - change the cgroupsPath value in config.json before restoring.
    
    The test does some checks to ensure that its logic is correct, and that
    after the restore the old (original) cgroup does not exist, the new one
    exists, and the container's init is in that new cgroup.
    
    Signed-off-by: Kir Kolyshkin <[email protected]>
    kolyshkin committed Dec 15, 2022
    Configuration menu
    Copy the full SHA
    d4582ae View commit details
    Browse the repository at this point in the history
  6. man/runc-restore: describe restore into different cgroup

    Signed-off-by: Kir Kolyshkin <[email protected]>
    kolyshkin committed Dec 15, 2022
    Configuration menu
    Copy the full SHA
    6835287 View commit details
    Browse the repository at this point in the history
  7. tests/int/checkpoint: fix lazy migration flakiness

    When doing a lazy checkpoint/restore, we should not restore into the
    same cgroup, otherwise there is a race which result in occasional
    killing of the restored container (GH opencontainers#2760, opencontainers#2924).
    
    The fix is to use --manage-cgroup-mode=ignore, which allows to restore
    into a different cgroup.
    
    Note that since cgroupsPath is not set in config.json, the cgroup is
    derived from the container name, so calling set_cgroups_path is not
    needed.
    
    For the previous (unsuccessful) attempt to fix this, as well as detailed
    (and apparently correct) analysis, see commit 36fe3cc.
    
    Signed-off-by: Kir Kolyshkin <[email protected]>
    kolyshkin committed Dec 15, 2022
    Configuration menu
    Copy the full SHA
    c4aa452 View commit details
    Browse the repository at this point in the history