Merge pull request #198526 from farnoy/nixos-container-unified-cgroups
[nixos-container] Make nixos containers use unified cgroupsv2
This commit is contained in:
commit
0a00b332cd
|
@ -4448,6 +4448,12 @@
|
||||||
githubId = 1276854;
|
githubId = 1276854;
|
||||||
name = "Florian Peter";
|
name = "Florian Peter";
|
||||||
};
|
};
|
||||||
|
farnoy = {
|
||||||
|
email = "jakub@okonski.org";
|
||||||
|
github = "farnoy";
|
||||||
|
githubId = 345808;
|
||||||
|
name = "Jakub Okoński";
|
||||||
|
};
|
||||||
fbeffa = {
|
fbeffa = {
|
||||||
email = "beffa@fbengineering.ch";
|
email = "beffa@fbengineering.ch";
|
||||||
github = "fedeinthemix";
|
github = "fedeinthemix";
|
||||||
|
|
|
@ -138,6 +138,8 @@ let
|
||||||
fi
|
fi
|
||||||
''}
|
''}
|
||||||
|
|
||||||
|
export SYSTEMD_NSPAWN_UNIFIED_HIERARCHY=1
|
||||||
|
|
||||||
# Run systemd-nspawn without startup notification (we'll
|
# Run systemd-nspawn without startup notification (we'll
|
||||||
# wait for the container systemd to signal readiness)
|
# wait for the container systemd to signal readiness)
|
||||||
# Kill signal handling means systemd-nspawn will pass a system-halt signal
|
# Kill signal handling means systemd-nspawn will pass a system-halt signal
|
||||||
|
|
|
@ -143,6 +143,7 @@ in {
|
||||||
containers-reloadable = handleTest ./containers-reloadable.nix {};
|
containers-reloadable = handleTest ./containers-reloadable.nix {};
|
||||||
containers-restart_networking = handleTest ./containers-restart_networking.nix {};
|
containers-restart_networking = handleTest ./containers-restart_networking.nix {};
|
||||||
containers-tmpfs = handleTest ./containers-tmpfs.nix {};
|
containers-tmpfs = handleTest ./containers-tmpfs.nix {};
|
||||||
|
containers-unified-hierarchy = handleTest ./containers-unified-hierarchy.nix {};
|
||||||
convos = handleTest ./convos.nix {};
|
convos = handleTest ./convos.nix {};
|
||||||
corerad = handleTest ./corerad.nix {};
|
corerad = handleTest ./corerad.nix {};
|
||||||
coturn = handleTest ./coturn.nix {};
|
coturn = handleTest ./coturn.nix {};
|
||||||
|
|
21
nixos/tests/containers-unified-hierarchy.nix
Normal file
21
nixos/tests/containers-unified-hierarchy.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
import ./make-test-python.nix ({ pkgs, lib, ... }: {
|
||||||
|
name = "containers-unified-hierarchy";
|
||||||
|
meta = {
|
||||||
|
maintainers = with lib.maintainers; [ farnoy ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.machine = { ... }: {
|
||||||
|
containers = {
|
||||||
|
test-container = {
|
||||||
|
autoStart = true;
|
||||||
|
config = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
machine.wait_for_unit("default.target")
|
||||||
|
|
||||||
|
machine.succeed("echo 'stat -fc %T /sys/fs/cgroup/ | grep cgroup2fs' | nixos-container root-login test-container")
|
||||||
|
'';
|
||||||
|
})
|
|
@ -25,6 +25,7 @@ substituteAll {
|
||||||
containers-ip
|
containers-ip
|
||||||
containers-tmpfs
|
containers-tmpfs
|
||||||
containers-ephemeral
|
containers-ephemeral
|
||||||
|
containers-unified-hierarchy
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue