← Back to Pull requests

DRA: pin containers to the claim requests they hold #835

Closed
unknown closed this pull request without merging on Oct 19, 2026 15:04 UTC
View on GitHub
unknown unknown commented on Oct 13, 2026 08:53 UTC
Author

Pinning containers to the claim requests they hold

Until now every result of a claim set the same environment variable, DRA_CPUSET_<claim UID>=<all CPUs of the claim>, so the policy could not tell which request of a claim a container holds. A container naming one request in resources.claims[].request was pinned to the CPUs of all requests of the claim.

Now every CDI device of a claim sets DRA_DEVICE_<claim UID>_<index>=<CDI device name>. dra.ContainerClaims() tells a policy which claims a container holds and which of their results, from the CDI devices of the container when the runtime reports them to NRI (containerd 2.4.1 does), and from these variables otherwise. Topology-aware pins a container to the CPUs of the results it holds. CPU accounting does not change.

Topology-aware and template no longer set DRA_CPUSET_*. A container finds its claimed CPUs as CLAIMED_CPUS in /.nri-resource-policy/resources.sh. The variable is not in any release.

With a claim with requests first (one CPU of NUMA node 0) and second (one CPU of node 2):

| Container | Names | Runs on, and CLAIMED_CPUS |
|---|---|---|
| c0 | first | CPU 2 |
| c1 | second | CPU 10 |
| c2 | none | CPUs 2 and 10 |

Before this PR, all three ran on CPUs 2 and 10.

The first two commits are Antti's, from #828.

Tested with new unit tests and test42-dra-devices on n4c16 with Kubernetes 1.37 and containerd v2.4.1, which now covers a claim with two requests. Template's test01-dra passes too, including its restart.

Diff: 191 lines (+143 / -48) across 2 files Reviewer: bart0sh Review duration: 9011m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 191 lines diff across 2 files
0.36
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.315
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #835"
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: 35.9% (MEDIUM) · Higher = larger blast radius
35.9%
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.2% · Safe to merge
14.2%