Skip to content

Commit

Permalink
cnf-tests: Improve NUMA cpuset retrieval
Browse files Browse the repository at this point in the history
Guaranteed workload pod can be in a different cgroup
if on the node there have been applied a PerformanceProfile.

The Cluster Node Tuning Operator configures the cpuset
cgroup on specific condition and it doesn't come back to
the original configuration when the node is moved to a differenent
MachineConfigPool.

Refs:
https://github.com/openshift/cluster-node-tuning-operator/blob/a4c70abb71036341dfaf0cac30dab0d166e55cbd/assets/performanceprofile/scripts/cpuset-configure.sh#L9
Signed-off-by: Andrea Panattoni <[email protected]>
  • Loading branch information
zeeke committed Aug 22, 2023
1 parent 1187ae1 commit b62ab3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cnf-tests/testsuites/e2esuite/dpdk/dpdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ func findNUMAForCPUs(pod *corev1.Pod, cpuList []string) (int, error) {
}

if !findCPUOnSameNuma {
return numaNode, fmt.Errorf("not all the cpus are in the same numa node")
return numaNode, fmt.Errorf("not all the cpus are in the same numa node. cpuList[%v] lscpu[%s]", cpuList, buff.String())
}

return numaNode, nil
Expand Down
5 changes: 3 additions & 2 deletions cnf-tests/testsuites/e2esuite/dpdk/numa_node_sriov.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
kubeletconfigv1beta1 "k8s.io/kubelet/config/v1beta1"
)

var _ = Describe("[sriov] NUMA node alignment", Ordered, func() {
var _ = Describe("XXX [sriov] NUMA node alignment", Ordered, func() {

var (
numa0DeviceList []*sriovv1.InterfaceExt
Expand Down Expand Up @@ -394,7 +394,8 @@ func findDevicesOnNUMANode(node *corev1.Node, devices []*sriovv1.InterfaceExt, n

func expectPodCPUsAreOnNUMANode(pod *corev1.Pod, expectedCPUsNUMA int) {

buff, err := pods.ExecCommand(client.Client, *pod, []string{"cat", "/sys/fs/cgroup/cpuset.cpus"})
buff, err := pods.ExecCommand(client.Client, *pod, []string{"sh", "-c",
"cat /sys/fs/cgroup/cpuset/cpuset.cpus || cat /sys/fs/cgroup/cpuset.cpus"})
ExpectWithOffset(1, err).ToNot(HaveOccurred())

cpuList, err := getCpuSet(buff.String())
Expand Down

0 comments on commit b62ab3f

Please sign in to comment.