Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
32b0023
refactor: add pkg/kubernetes/client, rewire pkg/agent to use it
bart0sh Aug 28, 2026
651c902
dra: introduce pkg/resmgr/dra plugin skeleton
bart0sh Aug 28, 2026
9daa3ac
cpuclass: add dra.publish config field and validation
bart0sh Aug 28, 2026
48d29b5
pct: add PickHpCpus, ReleaseHpCpus, and Punits
bart0sh Aug 28, 2026
4629956
cpuclass: implement DRA device builder
bart0sh Aug 28, 2026
60ca621
dra: implement kubelet plugin lifecycle
bart0sh Aug 28, 2026
037f229
dra: implement Prepare/UnprepareResourceClaims and CDI writer
bart0sh Aug 28, 2026
ff1470a
topology-aware: wire DRA plugin into the policy
bart0sh Aug 28, 2026
1260d99
helm/topology-aware: add DRA chart additions
bart0sh Aug 28, 2026
f8aa853
e2e: add DRA e2e test
bart0sh Aug 28, 2026
2c22da7
e2e: add k8s_log_verbosity var for control-plane/kubelet debug logging
bart0sh Sep 4, 2026
2e5109c
gitignore: ignore extracted testdata directories.
klihub Sep 11, 2026
7f35079
lib/cpu: implement dense CpuMasks and sparse CpuSets.
klihub Sep 9, 2026
a0f3865
lib/hardware: discover CPU and memory topology.
klihub Sep 9, 2026
aa568fa
lib/hardware/system: drop-in for pkg/sysfs.
klihub Sep 9, 2026
f4ed84e
resmgr,plugins: import the hardware topology drop-in.
klihub Sep 9, 2026
88812bf
resmgr: discover the hardware topology at startup.
klihub Sep 9, 2026
e413136
balloons: read the topology from hardware.Machine.
klihub Sep 9, 2026
5d78f1d
libmem: take memory nodes from a hardware.Machine.
klihub Sep 9, 2026
dbb3b2d
cpuallocator: take the topology from a hardware.Machine.
klihub Sep 9, 2026
3f9357a
utils/parse: move file entry parsing out of sysfs.
klihub Sep 10, 2026
72468ba
kubernetes,utils: sort out the memory capacity accessors.
klihub Sep 10, 2026
a1ab0b9
memory-policy: take the topology from a hardware.Machine.
klihub Sep 10, 2026
bf063df
cpuclass: take the topology from a hardware.Machine.
klihub Sep 10, 2026
4ebae79
topology-aware: build test topologies from real machines.
klihub Sep 10, 2026
0e7de87
utils/topology: take the machine for hint scoring.
klihub Sep 10, 2026
cc57382
topology-aware: read the topology from hardware.Machine.
klihub Sep 10, 2026
62fc044
topology-aware: test hints against a machine which has sockets.
klihub Sep 10, 2026
cc5e861
resmgr: collect system metrics from the hardware.Machine.
klihub Sep 10, 2026
b2abb11
resmgr: stop handing the pkg/sysfs interface to backends.
klihub Sep 10, 2026
8ccba68
sysfs: deprecate the package.
klihub Sep 10, 2026
16b5543
topology-aware: enable the cold start test.
klihub Sep 10, 2026
251d757
cpuallocator: speak libcpu.CpuMask.
klihub Sep 10, 2026
120c14b
balloons: track CPUs as libcpu.CpuMask.
klihub Sep 10, 2026
a3e22a9
topology-aware: track CPUs as libcpu.CpuMask.
klihub Sep 10, 2026
ed7306f
irq: speak libcpu.CpuMask.
klihub Sep 10, 2026
f209c54
cpuclass: speak libcpu.CpuMask.
klihub Sep 10, 2026
4a4ab40
dra: speak libcpu.CpuMask.
klihub Sep 11, 2026
a2a6b4d
resmgr,plugins: build machines in the tests.
klihub Sep 11, 2026
aae49ec
libmem: take CPUs as a libcpu.CpuMask.
klihub Sep 11, 2026
c25890c
config,plugins: parse cpuset amounts into a CpuMask.
klihub Sep 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .codespellignorelines
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
( vm-command "kubectl delete pods -n kube-system \$(kubectl get pods -n kube-system | awk '/t[0-9]r[gb][ue]/{print \$1}')" ) || true
( vm-command "kubectl delete pods -n default \$(kubectl get pods -n default | awk '/t[0-9][rgb][ue][0-9]/{print \$1}')" ) || true
docker run -v "$(pwd):/mnt/models" "$FMBT_IMAGE" sh -c 'cd /mnt/models; fmbt tmp.fuzz.fmbt.conf 2>/dev/null | fmbt-log -f STEP\$sn\$as\$al' | grep -v AAL | sed -e 's/^, / /g' -e '/^STEP/! s/\(^.*\)/echo "TESTGEN: \1"/g' -e 's/^STEP\([0-9]*\)i:\(.*\)/echo "TESTGEN: STEP \1"; vm-command "date +%T.%N"; \2; vm-command "date +%T.%N"; kubectl get pods -A/g' | sed "s/\([^a-z0-9]\)\(r\?\)\(gu\|bu\|be\)\([0-9]\)/\1t${testid}\2\3\4/g" > "$OUTFILE"
allocs := map[string]cpuset.CPUSet{"--:allo": currentCpus}
allocs := map[string]*libcpu.CpuMask{"--:allo": currentCpus}
allocName := fmt.Sprintf("%02d:allo", i+1)
preferTightestFit = func(cA, cB *cpuCluster, pkgA, pkgB, dieA, dieB int, csetA, csetB cpuset.CPUSet) (r int) {
preferTightestFit = func(cA, cB *cpuCluster, pkgA, pkgB, dieA, dieB int, csetA, csetB *libcpu.CpuMask) (r int) {
if dieA >= a.cnt && dieB < a.cnt {
if dieA < a.cnt && dieB >= a.cnt {
if dieA >= a.cnt && dieB >= a.cnt {
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ __pycache__/
test/e2e/**/output

test/statistics-analysis/output
*.test

testdata/
171 changes: 97 additions & 74 deletions cmd/plugins/balloons/policy/balloons-policy.go

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions cmd/plugins/balloons/policy/cpuclass_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
package balloons

import (
libcpu "github.com/containers/nri-plugins/pkg/lib/cpu"
"strings"
"testing"

"github.com/containers/nri-plugins/pkg/resmgr/cpuclass"
"github.com/containers/nri-plugins/pkg/utils/cpuset"
)

// fakeHintProvider returns a scripted sequence of cpuclass.AllocationHints,
Expand Down Expand Up @@ -49,7 +49,7 @@ func countHintDevs(devs []string) int {
return n
}

func countHintMapKeys(m map[string][]cpuset.CPUSet) int {
func countHintMapKeys(m map[string][]*libcpu.CpuMask) int {
n := 0
for k := range m {
if strings.HasPrefix(k, cpuClassHintDevPrefix) {
Expand All @@ -65,32 +65,32 @@ func countHintMapKeys(m map[string][]cpuset.CPUSet) int {
// the hint count reported by the provider on that round, regardless
// of how many earlier rounds added different hints.
func TestMergeCpuClassHintsNoAccumulation(t *testing.T) {
cpusA := cpuset.MustParse("2-3")
cpusB := cpuset.MustParse("4-5")
cpusC := cpuset.MustParse("6-7")
cpusAvoid := cpuset.MustParse("0-1")
cpusA := libcpu.MustParseCpuMask("2-3")
cpusB := libcpu.MustParseCpuMask("4-5")
cpusC := libcpu.MustParseCpuMask("6-7")
cpusAvoid := libcpu.MustParseCpuMask("0-1")

provider := &fakeHintProvider{
script: []cpuclass.AllocationHints{
// Round 1: one prefer (A), one avoid.
{
Prefer: []cpuclass.CpuPreference{{Name: "hp-reserve", Cpus: []cpuset.CPUSet{cpusA}}},
Avoid: []cpuclass.CpuPreference{{Name: "lp-clos", Cpus: []cpuset.CPUSet{cpusAvoid}}},
Prefer: []cpuclass.CpuPreference{{Name: "hp-reserve", Cpus: []*libcpu.CpuMask{cpusA}}},
Avoid: []cpuclass.CpuPreference{{Name: "lp-clos", Cpus: []*libcpu.CpuMask{cpusAvoid}}},
},
// Round 2: two prefers (A, B) - different name at index 1
// so the slot-0 name stays stable, slot-1 is new.
{
Prefer: []cpuclass.CpuPreference{
{Name: "hp-reserve", Cpus: []cpuset.CPUSet{cpusA}},
{Name: "extra", Cpus: []cpuset.CPUSet{cpusB}},
{Name: "hp-reserve", Cpus: []*libcpu.CpuMask{cpusA}},
{Name: "extra", Cpus: []*libcpu.CpuMask{cpusB}},
},
Avoid: []cpuclass.CpuPreference{{Name: "lp-clos", Cpus: []cpuset.CPUSet{cpusAvoid}}},
Avoid: []cpuclass.CpuPreference{{Name: "lp-clos", Cpus: []*libcpu.CpuMask{cpusAvoid}}},
},
// Round 3: name at slot 0 CHANGES to C - without proper
// cleanup the stale "__cls_pref_0_hp-reserve" map key from
// rounds 1+2 would survive into round 3.
{
Prefer: []cpuclass.CpuPreference{{Name: "third", Cpus: []cpuset.CPUSet{cpusC}}},
Prefer: []cpuclass.CpuPreference{{Name: "third", Cpus: []*libcpu.CpuMask{cpusC}}},
Avoid: nil,
},
},
Expand All @@ -99,7 +99,7 @@ func TestMergeCpuClassHintsNoAccumulation(t *testing.T) {
opts := &cpuTreeAllocatorOptions{
preferCloseToDevices: []string{"user-dev-A", "user-dev-B"},
preferFarFromDevices: []string{"user-far"},
virtDevCpusets: map[string][]cpuset.CPUSet{},
virtDevCpusets: map[string][]*libcpu.CpuMask{},
}

for round := 1; round <= 3; round++ {
Expand Down Expand Up @@ -152,7 +152,7 @@ func userDevs(devs []string) []string {
return out
}

func mapKeys(m map[string][]cpuset.CPUSet) []string {
func mapKeys(m map[string][]*libcpu.CpuMask) []string {
out := make([]string, 0, len(m))
for k := range m {
out = append(out, k)
Expand Down
Loading
Loading