diff options
author | juraj.linkes <juraj.linkes@pantheon.tech> | 2019-07-17 14:28:30 +0200 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2019-07-23 08:39:28 +0000 |
commit | c79c748013ec53ff59e9260034822a5b26afa441 (patch) | |
tree | a41c87a91079fe1f8d54938102ef3a0ef9ff97fd /resources/libraries/python/ContainerUtils.py | |
parent | 6e1de92cec9a0687ca82bcefaae3ef7dad5104b0 (diff) |
Add support for aarch64 container images
Change-Id: I84f13d7139a6e5f7004426018c2d27425c5fa97e
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
Diffstat (limited to 'resources/libraries/python/ContainerUtils.py')
-rw-r--r-- | resources/libraries/python/ContainerUtils.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/resources/libraries/python/ContainerUtils.py b/resources/libraries/python/ContainerUtils.py index a324465eaf..363411c070 100644 --- a/resources/libraries/python/ContainerUtils.py +++ b/resources/libraries/python/ContainerUtils.py @@ -593,8 +593,12 @@ class LXC(ContainerEngine): else: return + target_arch = 'arm64' \ + if Topology.get_node_arch(self.container.node) == 'aarch64' \ + else 'amd64' + image = self.container.image if self.container.image else\ - "-d ubuntu -r bionic -a amd64" + "-d ubuntu -r bionic -a {arch}".format(arch=target_arch) cmd = 'lxc-create -t download --name {c.name} -- {image} '\ '--no-validate'.format(c=self.container, image=image) @@ -786,8 +790,10 @@ class Docker(ContainerEngine): return if not self.container.image: - setattr(self.container, 'image', - Constants.DOCKER_SUT_IMAGE_UBUNTU) + img = Constants.DOCKER_SUT_IMAGE_UBUNTU_ARM \ + if Topology.get_node_arch(self.container.node) == 'aarch64' \ + else Constants.DOCKER_SUT_IMAGE_UBUNTU + setattr(self.container, 'image', img) cmd = 'docker pull {image}'.format(image=self.container.image) @@ -795,6 +801,7 @@ class Docker(ContainerEngine): if int(ret) != 0: raise RuntimeError('Failed to create container {c.name}.' .format(c=self.container)) + if self.container.cpuset_cpus: self._configure_cgroup('docker') |