-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
balloons,cache: support memory-type annotations.
Add support for per balloon type memory configuration and per container overrides using pod annotations. Pass configured or annotated memory types to libmem for allocation. TODO(klihub): per balloon configuration still missing (?) Co-authored-by: Krisztian Litkey <[email protected]> Signed-off-by: Krisztian Litkey <[email protected]>
- Loading branch information
Showing
7 changed files
with
119 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
test/e2e/policies.test-suite/balloons/n6-hbm-cxl/py_consts.var.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dram0 = "node0" | ||
dram1 = "node1" | ||
hbm0 = "node2" | ||
hbm1 = "node3" | ||
pmem0 = "node4" | ||
pmem1 = "node5" |
33 changes: 33 additions & 0 deletions
33
...e2e/policies.test-suite/balloons/n6-hbm-cxl/test01-memory-types/balloons-memory-types.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
config: | ||
# Reserve one of our CPUs (cpu15) for kube-system tasks. | ||
reservedResources: | ||
cpu: "1" | ||
pinCPU: true | ||
pinMemory: true | ||
balloonTypes: | ||
- name: two-cpu | ||
minCPUs: 2 | ||
maxCPUs: 2 | ||
preferNewBalloons: true | ||
|
||
cpuClass: class4 | ||
|
||
- name: five-cpu | ||
maxCPUs: 5 | ||
allocatorPriority: none | ||
preferSpreadingPods: true | ||
preferNewBalloons: true | ||
cpuClass: class5 | ||
|
||
instrumentation: | ||
httpEndpoint: ":8891" | ||
prometheusExport: true | ||
log: | ||
debug: | ||
- cache | ||
- policy | ||
- nri-plugin | ||
- libmem | ||
source: true | ||
klog: | ||
skip_headers: true |
36 changes: 36 additions & 0 deletions
36
test/e2e/policies.test-suite/balloons/n6-hbm-cxl/test01-memory-types/code.var.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
helm-terminate | ||
helm_config=${TEST_DIR}/balloons-memory-types.cfg helm-launch balloons | ||
|
||
cleanup() { | ||
vm-command "kubectl delete pods -n kube-system pod0; kubectl delete pods --all --now" | ||
return 0 | ||
} | ||
|
||
cleanup | ||
|
||
# pod0: all memory combinations when there is enough memory. | ||
# CPUREQ + CONTCOUNT causes ballooon inflation after 5 containers. | ||
POD_ANNOTATION=() | ||
POD_ANNOTATION[bln]="balloon.balloons.resource-policy.nri.io/container.pod0c0: two-cpu" | ||
POD_ANNOTATION[0]="memory-type.resource-policy.nri.io/container.pod0c0: hbm" | ||
POD_ANNOTATION[1]="memory-type.resource-policy.nri.io/container.pod0c1: dram" | ||
POD_ANNOTATION[2]="memory-type.resource-policy.nri.io/container.pod0c2: pmem" | ||
POD_ANNOTATION[3]="memory-type.resource-policy.nri.io/container.pod0c3: hbm,dram" | ||
POD_ANNOTATION[4]="memory-type.resource-policy.nri.io/container.pod0c4: dram,pmem" | ||
POD_ANNOTATION[5]="memory-type.resource-policy.nri.io/container.pod0c5: hbm,dram,pmem" | ||
CPUREQ="200m" MEMREQ="300M" CPULIM="" MEMLIM="300M" CONTCOUNT=7 create balloons-busybox | ||
report allowed | ||
verify 'mems["pod0c0"] == {hbm0} if packages["pod0c0"] == {"package0"} else mems["pod0c0"] == {hbm1}' \ | ||
'mems["pod0c1"] == {dram0} if packages["pod0c1"] == {"package0"} else mems["pod0c1"] == {dram1}' \ | ||
'mems["pod0c2"] == {pmem0} if packages["pod0c2"] == {"package0"} else mems["pod0c2"] == {pmem1}' \ | ||
'mems["pod0c3"] == {hbm0,dram0} if packages["pod0c3"] == {"package0"} else mems["pod0c3"] == {hbm1,dram1}' \ | ||
'mems["pod0c4"] == {dram0,pmem0} if packages["pod0c4"] == {"package0"} else mems["pod0c4"] == {dram1,pmem1}' \ | ||
'mems["pod0c5"] == {hbm0,dram0,pmem0} if packages["pod0c5"] == {"package0"} else mems["pod0c5"] == {hbm1,dram1,pmem1}' \ | ||
'mems["pod0c6"] == {dram0} if packages["pod0c6"] == {"package0"} else mems["pod0c6"] == {dram1}' | ||
|
||
echo 'TODO: mems["pod0c5"] was missing access to pmem. Suspecting issue in defaultExpand.' | ||
breakpoint | ||
|
||
cleanup | ||
|
||
helm-terminate |
7 changes: 7 additions & 0 deletions
7
test/e2e/policies.test-suite/balloons/n6-hbm-cxl/topology.var.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{"mem": "2G", "threads":2, "cores": 2, "nodes": 1, "packages": 2}, | ||
{"mem": "1G", "node-dist": {"0": 15, "1": 30, "2": 10, "3": 35}}, | ||
{"mem": "1G", "node-dist": {"0": 30, "1": 15, "2": 35, "3": 10}}, | ||
{"mem": "4G", "node-dist": {"0": 60, "1": 70, "2": 62, "3": 72, "4": 10, "5": 75}}, | ||
{"mem": "4G", "node-dist": {"0": 70, "1": 60, "2": 72, "3": 62, "4": 75, "5": 10}} | ||
] |