diff options
author | Peter Mikus <pmikus@cisco.com> | 2022-08-25 11:31:57 +0000 |
---|---|---|
committer | Peter Mikus <peter.mikus@protonmail.ch> | 2022-08-30 06:09:54 +0000 |
commit | c5350983da615f982ceca3eb19c62b1dab38fbff (patch) | |
tree | bbf96a5f072ab6f5881184e493455695869e2567 /resources/libraries/python | |
parent | 4dd54fb0f0de796d3b728c0d6187a3721458c75e (diff) |
fix(core): Ubuntu Jammy VIII
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: I12e7515f7dd04dd493c566ce85ed17f87e2563bb
Diffstat (limited to 'resources/libraries/python')
-rw-r--r-- | resources/libraries/python/ContainerUtils.py | 22 | ||||
-rw-r--r-- | resources/libraries/python/QemuUtils.py | 4 |
2 files changed, 7 insertions, 19 deletions
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 @@ -808,31 +808,19 @@ class ContainerEngine: :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}" ) if int(ret) != 0: 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) diff --git a/resources/libraries/python/QemuUtils.py b/resources/libraries/python/QemuUtils.py index 64fb5a0e87..53559f52e9 100644 --- a/resources/libraries/python/QemuUtils.py +++ b/resources/libraries/python/QemuUtils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2022 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -258,7 +258,7 @@ class QemuUtils: logger.debug(u"Jumbo frames temporarily disabled!") self._params.add_with_value( u"chardev", f"socket,id=char{self._nic_id}," - f"path={socket}{u',server' if server is True else u''}" + f"path={socket}{u',server=on' if server is True else u''}" ) self._params.add_with_value( u"netdev", f"vhost-user,id=vhost{self._nic_id}," |