← Back to Pull requests

DRA: export claimed CPUs to topology-aware containers #834

Closed
unknown closed this pull request without merging on Oct 16, 2026 11:28 UTC
View on GitHub
unknown unknown commented on Oct 13, 2026 08:53 UTC
Author

Exporting claimed CPUs to topology-aware containers

Tenth PR of the DRA series, on top of #831. Two commits.

As requested in the #821 review, ExportResourceData() now also exports the CPUs of the DRA claims of a container. The container finds them as CLAIMED_CPUS in /.nri-resource-policy/resources.sh, next to ISOLATED_CPUS, EXCLUSIVE_CPUS and SHARED_CPUS. For example, for a container with a claim for CPUs 8-9 and a small CPU request of its own:

CLAIMED_CPUS="8-9"
SHARED_CPUS="10-11"

CLAIMED_CPUS is the union of all claims of the container. The CPUs of each claim are still in the DRA_CPUSET_<claim UID> environment variables in this PR; #852, the next one, drops them, so CLAIMED_CPUS then becomes the only place. The other variables keep listing only the container's own CPUs, so a claimed CPU that is kernel-isolated is listed only in CLAIMED_CPUS.

The name is a common constant in pkg/resmgr/policy, ExportClaimedCPUs, next to the existing ones. Balloons and template export no resource data, so they are not changed.

Commits

1. topology-aware: export the CPUs of DRA claims.
2. e2e: test exporting claimed CPUs. Extends test42-dra-devices.

Testing

  • TestExportClaimedCPUs covers a besteffort and an exclusive container holding a claim, and a container holding none. It also checks that the other exported CPU sets have no claimed CPUs.

  • test42-dra-devices passes on n4c16 with Kubernetes 1.37 and containerd v2.4.1. pod0 exports the CPUs of its claim, pod4 holds no claim and exports none, and pod7, which also has a CPU request of its own, exports its claimed CPUs and the rest of its node as SHARED_CPUS.
  • Diff: 220 lines (+165 / -55) across 2 files Reviewer: askervin Review duration: 4475m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 220 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.323
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #834"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.8% (MEDIUM) · Higher = larger blast radius
    36.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.5% · Safe to merge
    14.5%