New determination of the cpu set 47/74647/1
authorLuc Provoost <luc.provoost@gmail.com>
Mon, 11 Nov 2024 13:16:25 +0000 (14:16 +0100)
committerLuc Provoost <luc.provoost@gmail.com>
Mon, 11 Nov 2024 13:16:25 +0000 (14:16 +0100)
Check out https://github.com/kubernetes/kubernetes/issues/119669
That describes the problem. The solution can be found in this change.

Signed-off-by: Luc Provoost <luc.provoost@gmail.com>
Change-Id: Id4d47e5d36b1c4acefea8dbe13d7a1e7c499c70d

VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py

index 048895c..63019e4 100644 (file)
@@ -83,17 +83,7 @@ class RapidMachine(object):
     def read_cpuset(self):
         """Read list of cpus on which we allowed to execute
         """
-        cpu_set_file = '/sys/fs/cgroup/cpuset.cpus'
-        cmd = 'test -e {0} && echo exists'.format(cpu_set_file)
-        if (self._client.run_cmd(cmd).decode().rstrip()):
-            cmd = 'cat {}'.format(cpu_set_file)
-        else:
-            cpu_set_file = '/sys/fs/cgroup/cpuset/cpuset.cpus'
-            cmd = 'test -e {0} && echo exists'.format(cpu_set_file)
-            if (self._client.run_cmd(cmd).decode().rstrip()):
-                cmd = 'cat {}'.format(cpu_set_file)
-            else:
-                RapidLog.critical('{Cannot determine cpuset')
+        cmd = "cat /proc/1/task/1/status | grep Cpus_allowed_list | awk '{print $2}'"
         cpuset_cpus = self._client.run_cmd(cmd).decode().rstrip()
         RapidLog.debug('{} ({}): Allocated cpuset: {}'.format(self.name, self.ip, cpuset_cpus))
         self.cpu_mapping = self.expand_list_format(cpuset_cpus)