OCPBUGS-55989: E2E: Functional tests for align cpus by UncoreCache Feature - #1302
Conversation
0259989 to
09870a6
Compare
| // be running, so in the test we check if the deployment has reached the desiredStatus before | ||
| // quering its pods | ||
| func WaitForDesiredDeploymentStatus(ctx context.Context, deployment *appsv1.Deployment, cli client.Client, namespace, name string, desiredStatus appsv1.DeploymentStatus) error { | ||
| return wait.PollUntilContextTimeout(context.TODO(), 5*time.Second, 5*time.Minute, true, func(ctx context.Context) (bool, error) { |
There was a problem hiding this comment.
fixed in the latest commit
| func TaggedInfof(tag string, format string, args ...interface{}) { | ||
| logf("[INFO]", fmt.Sprintf("[%s] %s", tag, format), args...) | ||
| } |
There was a problem hiding this comment.
not a fan, we should use contextual logging, but for the time being I guess we can use this
|
|
||
| // GetL3SharedCPUs creates a function that retrieves cpus for a given Node | ||
| // takes a worker cnf node and returns a closure when called with cpuId returns | ||
| // the corresponding cpus of core complex to which cpuId is part of |
There was a problem hiding this comment.
what's the benefit of returning a closure?
There was a problem hiding this comment.
Benefit is i can call the GetL3SharedCPU's once with actual node and fetch the shared L3 CPU multiple times without the need to pass the node information everytime and also i can re use the same code if there are multiple nodes. In some test cases where we have multiple pods or multiple containers per pods , i think this would be helpful
| Expect(err).ToNot(HaveOccurred()) | ||
| ctx := context.Background() | ||
| for _, cnfnode := range workerRTNodes { | ||
| numaInfo, err := nodes.GetNumaNodes(context.TODO(), &cnfnode) |
There was a problem hiding this comment.
fixed in the latest commit
| // Modify the profile such that we give 1 whole ccx to reserved cpus | ||
| By("Modifying the profile") | ||
| for _, node := range workerRTNodes { | ||
| numaCoreSiblings, err = nodes.GetCoreSiblings(context.TODO(), &node) |
There was a problem hiding this comment.
fixed in the latest commit
| // Assign one whole L3 Cache group for reserved cpus. | ||
| for reservedCores := 0; reservedCores < 8; reservedCores++ { | ||
| cpusiblings := nodes.GetAndRemoveCpuSiblingsFromMap(numaCoreSiblings, reservedCores) | ||
| reserved = append(reserved, cpusiblings...) |
There was a problem hiding this comment.
you mean to use cpuset.CPUset ?, Performance profile expects reserved and isolated to be of type string
https://github.com/openshift/cluster-node-tuning-operator/blob/81e7ec52274d/pkg/apis/performanceprofile/v2/performanceprofile_types.go#L95
There was a problem hiding this comment.
yes, we can use a cpuset for higher level operations on it and translate to string only when needed.
There was a problem hiding this comment.
@ffromani To convert, i need to first modify https://github.com/openshift/cluster-node-tuning-operator/blob/main/test/e2e/performanceprofile/functests/utils/nodes/nodes.go#L389 to return []int and then convert to cpuset.cpu using cpuset.new([]int..)
I can do it but this will break all the existing automation , i can address this in another PR if that's okay with you.
| err := testclient.DataPlaneClient.Delete(ctx, dp) | ||
| Expect(err).ToNot(HaveOccurred()) | ||
| // Wait for some time for deployment to be deleted | ||
| time.Sleep(deploymentDeletionTime) |
There was a problem hiding this comment.
would be better to check the pod to be gone, sleeps tend to fail randomly creating hard to debug issues
There was a problem hiding this comment.
fixed in the latest commit
| testlog.TaggedInfof("L3 Cache Group", "L3 Cache group associated with Pod %s using cpu %d is: %q", testpod.Name, cgroupCpuset.List()[0], cpus) | ||
| }) | ||
|
|
||
| It("[test_id:77726] Multiple Pods are not sharing same L3 cache", func() { |
There was a problem hiding this comment.
this may be possible per the latest KEP though, we need to check against the KEP goals/non-goals
55148e2 to
cf52930
Compare
|
/retest-required |
|
/test okd-scos-e2e-aws-ovn |
| // Assign one whole L3 Cache group for reserved cpus. | ||
| for reservedCores := 0; reservedCores < 8; reservedCores++ { | ||
| cpusiblings := nodes.GetAndRemoveCpuSiblingsFromMap(numaCoreSiblings, reservedCores) | ||
| reserved = append(reserved, cpusiblings...) |
There was a problem hiding this comment.
yes, we can use a cpuset for higher level operations on it and translate to string only when needed.
| }) | ||
|
|
||
| It("[test_id:77725] Align Guaranteed pod requesting 16 cpus to the whole CCX if available", func() { | ||
| ctx := context.Background() |
There was a problem hiding this comment.
we can get a context from ginkgo:
It("[test_id:77725] Align Guaranteed pod requesting 16 cpus to the whole CCX if available", func(ctx context.Context) {
we will need to handle interruptions, but that's a good thing to do anyway
There was a problem hiding this comment.
fixed in the latest commit
| cpusetCfg := &controller.CpuSet{} | ||
| deploymentName := "test-deployment1" | ||
| rl := &corev1.ResourceList{ | ||
| corev1.ResourceCPU: resource.MustParse("16"), |
There was a problem hiding this comment.
how 16 was decided? can't we use the CCX size? we should never assume the CCX size is 16
There was a problem hiding this comment.
fixed in the latest commit
| }) | ||
|
|
||
| It("[test_id:77725] Verify guaranteed pod consumes the whole Uncore group after reboot", func() { | ||
| ctx := context.Background() |
There was a problem hiding this comment.
fixed in the latest commit
| deploymentName := "test-deployment2" | ||
| getCCX := nodes.GetL3SharedCPUs(&targetNode) | ||
| rl := &corev1.ResourceList{ | ||
| corev1.ResourceCPU: resource.MustParse("16"), |
There was a problem hiding this comment.
fixed in the latest commit
|
/test okd-scos-e2e-aws-ovn |
| // Get cpu siblings from core 0-7 | ||
| // Assign one whole L3 Cache group for reserved cpus. |
There was a problem hiding this comment.
this is a bit fragile but without machineinfo or similar is challenging to improve
There was a problem hiding this comment.
Agree, for now i have used cpuset.CPUSet . addressed in the latest commit
| testlog.TaggedInfof("L3 Cache Group", "L3 Cache group associated with Pod %s using cpu %d is %q: ", testpod.Name, cgroupCpuset.List()[0], cpus) | ||
| }) | ||
|
|
||
| It("[test_id:77725] Verify guaranteed pod consumes the whole Uncore group after kubelet restart", func(ctx context.Context) { |
There was a problem hiding this comment.
we can safely infer this invariant from other tests though. If the CPU assignment doesn't change across kubelet restart, because how the silicon phisically is, then the L3 affinity/assignment can't change either.
I guess we should keep this test for the sake of being explicity though.
|
|
||
| It("[test_id:77726] Multiple Pods are not sharing same L3 cache", func(ctx context.Context) { | ||
| targetNode := workerRTNodes[0] | ||
| // create 2 deployments creating 2 gu pods asking for 8 cpus each |
There was a problem hiding this comment.
we should ask for number of cpus in a L3 group size /2 rather than hardcode 8
There was a problem hiding this comment.
Addressed in latest commit
| testlog.TaggedInfof("L3 Cache Group", "L3 Cache group associated with Pod %s using cpu %d is: %q", testpod.Name, cgroupCpuset.List()[0], cpus) | ||
| }) | ||
|
|
||
| It("[test_id:77726] Multiple Pods are not sharing same L3 cache", func(ctx context.Context) { |
There was a problem hiding this comment.
the test name must be changed because comments at the bottom of the test acknowledge pods can indeed share the same L3 block
There was a problem hiding this comment.
Addressed in latest commit
be0c3dc to
9963e02
Compare
|
/retest-required |
Add function WaitForDesiredDeploymentStatus to wait for deployment to be in the desired status. This is needed in cases where we reboot the node and want to ascertain if the deployment has reached the desired status Minor fix: use existing context variable instead of creating new context Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
cpus. Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
Instead of using hard coded value , fetch the value of L3 Cache group size and use that value for the guaranteed pod that we create Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
Use cpuset.CPUSet type for all reserved, isolated variables when modifying performance profile Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
Uncomment lines related to saving initialProfile Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
|
/retest-required |
ffromani
left a comment
There was a problem hiding this comment.
/approve
/lgtm
we can improve later if needed
| llcPolicy string | ||
| mc *machineconfigv1.MachineConfig | ||
| getter cgroup.ControllersGetter | ||
| cgroupV2 bool |
There was a problem hiding this comment.
nit: can this a local variable in BeforeAll?
| getCCX := nodes.GetL3SharedCPUs(&cnfnode) | ||
| reserved, err = getCCX(0) | ||
| Expect(err).ToNot(HaveOccurred()) | ||
| onlineCPUSet, err = nodes.GetOnlineCPUsSet(context.TODO(), &cnfnode) |
| By(fmt.Sprintf("Applying changes in performance profile and waiting until %s will start updating", poolName)) | ||
| profilesupdate.WaitForTuningUpdating(ctx, profile) |
There was a problem hiding this comment.
this wait is proven fragile though. A better approach seems to be to record the object ResourceVersion, then send the update, then wait for the object to become Updated with resourceVersion != oldResourceVersion
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ffromani, mrniranjan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@mrniranjan: This pull request references Jira Issue OCPBUGS-55989, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: mrniranjan. Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/retest-required |
1 similar comment
|
@mrniranjan: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
@mrniranjan: Jira Issue OCPBUGS-55989: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-55989 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[ART PR BUILD NOTIFIER] Distgit: cluster-node-tuning-operator |
|
/cherry-pick release-4.19 |
|
@mrniranjan: new pull request created: #1336 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
This PR adds Functional test to UncoreCache CPUManager policy options feature.