X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FContainerUtils.py;fp=resources%2Flibraries%2Fpython%2FContainerUtils.py;h=aae43cece3da6b2c99c2e5e5e02828b91d3bbb87;hp=7ec82586865cbaddc2ebf13322da3e47d9a9fcad;hb=c5350983da615f982ceca3eb19c62b1dab38fbff;hpb=4dd54fb0f0de796d3b728c0d6187a3721458c75e diff --git a/resources/libraries/python/ContainerUtils.py b/resources/libraries/python/ContainerUtils.py index 7ec8258686..aae43cece3 100644 --- a/resources/libraries/python/ContainerUtils.py +++ b/resources/libraries/python/ContainerUtils.py @@ -807,18 +807,6 @@ class ContainerEngine: :type name: str :raises RuntimeError: If applying cgroup settings via cgset failed. """ - ret, _, _ = self.container.ssh.exec_command_sudo( - u"cgset -r cpuset.cpu_exclusive=0 /" - ) - if int(ret) != 0: - raise RuntimeError(u"Failed to apply cgroup settings.") - - ret, _, _ = self.container.ssh.exec_command_sudo( - u"cgset -r cpuset.mem_exclusive=0 /" - ) - if int(ret) != 0: - raise RuntimeError(u"Failed to apply cgroup settings.") - ret, _, _ = self.container.ssh.exec_command_sudo( f"cgcreate -g cpuset:/{name}" ) @@ -826,13 +814,13 @@ class ContainerEngine: raise RuntimeError(u"Failed to copy cgroup settings from root.") ret, _, _ = self.container.ssh.exec_command_sudo( - f"cgset -r cpuset.cpu_exclusive=0 /{name}" + f"cgset -r cpuset.cpus=0 /{name}" ) if int(ret) != 0: raise RuntimeError(u"Failed to apply cgroup settings.") ret, _, _ = self.container.ssh.exec_command_sudo( - f"cgset -r cpuset.mem_exclusive=0 /{name}" + f"cgset -r cpuset.mems=0 /{name}" ) if int(ret) != 0: raise RuntimeError(u"Failed to apply cgroup settings.") @@ -863,7 +851,7 @@ class LXC(ContainerEngine): else u"amd64" image = self.container.image if self.container.image \ - else f"-d ubuntu -r focal -a {target_arch}" + else f"-d ubuntu -r jammy -a {target_arch}" cmd = f"lxc-create -t download --name {self.container.name} " \ f"-- {image} --no-validate" @@ -1128,8 +1116,8 @@ class Docker(ContainerEngine): if self.container.mnt else u"" cmd = f"docker run --privileged --detach --interactive --tty --rm " \ - f"--cgroup-parent docker {cpuset_cpus} {cpuset_mems} {publish} " \ - f"{env} {volume} --name {self.container.name} " \ + f"--cgroup-parent docker.slice {cpuset_cpus} {cpuset_mems} " \ + f"{publish} {env} {volume} --name {self.container.name} " \ f"{self.container.image} {command}" ret, _, _ = self.container.ssh.exec_command_sudo(cmd)