Skip to content

Add DRA e2e CI test#1847

Merged
openshift-merge-bot[bot] merged 1 commit into
rh-ecosystem-edge:mainfrom
TomerNewman:add-dra-e2e-ci-test
Jul 7, 2026
Merged

Add DRA e2e CI test#1847
openshift-merge-bot[bot] merged 1 commit into
rh-ecosystem-edge:mainfrom
TomerNewman:add-dra-e2e-ci-test

Conversation

@TomerNewman

@TomerNewman TomerNewman commented Jul 6, 2026

Copy link
Copy Markdown
Member

Add an end-to-end test that validates the full DRA lifecycle: DaemonSet creation, DeviceClass management, node labeling, status reporting, and cleanup on Module deletion.


/cc @yevgeny-shnaidman @ybettan
/assign @ybettan @yevgeny-shnaidman


fixes #1846

Summary by CodeRabbit

  • New Features
    • Added an end-to-end DRA workflow test for Kernel Module Manager on OpenShift.
    • Added Kubernetes manifests for a DRA-enabled module and a consumer pod that requests the device.
  • Bug Fixes
    • Improved validation that the DRA driver, DeviceClass, ResourceSlices, and readiness signals appear as expected.
    • Added cleanup checks to confirm test resources are removed and the module unloads correctly.
  • Tests
    • The new test covers module deployment, DRA scheduling, pod readiness, and teardown.

@netlify

netlify Bot commented Jul 6, 2026

Copy link
Copy Markdown

Deploy Preview for openshift-kmm ready!

Name Link
🔨 Latest commit 2f409ac
🔍 Latest deploy log https://app.netlify.com/projects/openshift-kmm/deploys/6a4ba0eb3c67da00088b0ff9
😎 Deploy Preview https://deploy-preview-1847--openshift-kmm.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@openshift-ci

openshift-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TomerNewman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved label Jul 6, 2026
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@TomerNewman, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 480c05de-974a-4dcf-9b73-1fe85e98eb51

📥 Commits

Reviewing files that changed from the base of the PR and between 0e32b2d and 2f409ac.

📒 Files selected for processing (3)
  • ci/e2e-dra/dra-consumer-pod.yaml
  • ci/e2e-dra/module-kmm-ci-dra.yaml
  • ci/prow/e2e-dra

Walkthrough

This PR adds a new DRA (Dynamic Resource Allocation) end-to-end test suite: Kubernetes manifests for a KMM Module with a DRA driver and DeviceClass, a consumer Pod using a ResourceClaimTemplate, and a Prow Bash script validating the full DRA lifecycle from module load through cleanup.

Changes

DRA e2e test addition

Layer / File(s) Summary
DRA module and consumer manifests
ci/e2e-dra/module-kmm-ci-dra.yaml, ci/e2e-dra/dra-consumer-pod.yaml
Defines a KMM Module (kmm-ci-dra) with modprobe loading, kernel-to-image mapping, DRA driver container, and DeviceClass; defines a ResourceClaimTemplate and consumer Pod requesting the gpu claim with node affinity avoiding the DRA-labeled node.
Prow e2e-dra script
ci/prow/e2e-dra
Bash script gates on Kubernetes >= 1.34, labels a worker node, applies build secret and module manifests, verifies module load, DaemonSet readiness, DeviceClass labels, node DRA-ready label, ResourceSlices, module DRA status, deploys/validates consumer pod, then deletes and asserts cleanup of all resources.

Estimated code review effort: 2 (Simple) | ~12 minutes

Related issues: #1846 (cherry-pick failure for the upstream "Add DRA e2e CI test" commit, resolved manually via this PR).

Sequence Diagram(s)

sequenceDiagram
  participant Script as e2e-dra script
  participant Cluster as OpenShift Cluster
  participant Module as kmm-ci-dra Module
  participant DaemonSet as DRA DaemonSet
  participant Pod as dra-consumer Pod

  Script->>Cluster: label worker node, create build secret
  Script->>Module: apply module-kmm-ci-dra.yaml
  Module->>DaemonSet: create DRA driver DaemonSet and DeviceClass
  Script->>DaemonSet: wait for ready, verify ResourceSlices
  Script->>Cluster: apply dra-consumer-pod.yaml
  Cluster->>Pod: schedule with resourceClaim
  Script->>Pod: wait for Ready
  Script->>Pod: delete consumer pod
  Script->>Module: delete module
  Script->>Cluster: assert DaemonSet/DeviceClass removed, module unloaded
Loading

Suggested reviewers: yevgeny-shnaidman, qbarrand

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a DRA end-to-end CI test.
Linked Issues check ✅ Passed The changes implement the requested DRA e2e test flow and related manifests from issue #1846.
Out of Scope Changes check ✅ Passed All described changes are directly related to the DRA e2e test and its supporting Kubernetes manifests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
ci/e2e-dra/dra-consumer-pod.yaml (1)

14-38: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Consumer pod runs without privilege-escalation/root hardening.

Checkov flags this pod for missing allowPrivilegeEscalation: false and non-root enforcement. Since this is a throwaway busybox e2e test pod, risk is minimal, but adding a minimal securityContext costs little.

🛡️ Optional hardening
   containers:
   - name: consumer
     image: busybox:1.36
     command: ["sh", "-c", "sleep infinity"]
+    securityContext:
+      allowPrivilegeEscalation: false
+      runAsNonRoot: true
     resources:
       claims:
       - name: gpu
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci/e2e-dra/dra-consumer-pod.yaml` around lines 14 - 38, The dra-consumer pod
is missing basic container hardening settings. Update the consumer container in
the dra-consumer pod spec to add a minimal securityContext that disables
privilege escalation and enforces non-root execution. Use the existing container
definition under the consumer container to keep the change scoped to this
busybox test pod.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@ci/e2e-dra/dra-consumer-pod.yaml`:
- Around line 14-38: The dra-consumer pod is missing basic container hardening
settings. Update the consumer container in the dra-consumer pod spec to add a
minimal securityContext that disables privilege escalation and enforces non-root
execution. Use the existing container definition under the consumer container to
keep the change scoped to this busybox test pod.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e085c02-98a8-4a74-be86-0d2c2e1b6db2

📥 Commits

Reviewing files that changed from the base of the PR and between 5975fef and 0e32b2d.

📒 Files selected for processing (3)
  • ci/e2e-dra/dra-consumer-pod.yaml
  • ci/e2e-dra/module-kmm-ci-dra.yaml
  • ci/prow/e2e-dra

Add an end-to-end test that validates the full DRA lifecycle:
DaemonSet creation, DeviceClass management, node labeling,
status reporting, and cleanup on Module deletion.
container:
modprobe:
moduleName: kmm_ci_a
modulesLoadingOrder: [kmm_ci_a, kmm_ci_b]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any special reason for loading 2 kernel modules?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove it, but since it exist also in u/s, I suggest to merge it, and then do the fix in u/s and then backport to here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@ybettan

ybettan commented Jul 7, 2026

Copy link
Copy Markdown
Member

I am happy with this PR when @yevgeny-shnaidman is.

@yevgeny-shnaidman

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Jul 7, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 33d1d14 into rh-ecosystem-edge:main Jul 7, 2026
21 checks passed
@TomerNewman TomerNewman deleted the add-dra-e2e-ci-test branch July 7, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cherry-picking error for 207e7b49610876d410eb148a6f93bbda395fbdf6

3 participants