Skip to content

Commit da999a2

Browse files
Remove memory limit pod (redhat-performance#537)
* add workflow dispatch (redhat-performance#476) * add workflow dispatch (redhat-performance#476) * - Eliminate memory limit for runc and Kata pods. Memory limits with Kata (sandboxed container) pods do not calculate the size of the VM correctly and can fail with an out of memory condition as a result. The limits are not needed to run correctly. - Include the failing template file if a template operation fails. - Add a top level Makefile to rebuild and test the golden files to simplify development. * - Apply fix to Kata pod memory overhead to make limits safe. - Restore Kata limit to the original 4 GiB. * Remove conditionals on limits/requests * add workflow dispatch (redhat-performance#476) * add workflow dispatch (redhat-performance#476) * runtimeclass patch needs to be executable --------- Co-authored-by: ebattat <[email protected]>
1 parent 0abb93f commit da999a2

File tree

18 files changed

+46
-22
lines changed

18 files changed

+46
-22
lines changed

HOW_TO.md

+15-12
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,19 @@ compares these files against expected files found in
4545
`tests/unittest/benchmark_runner/common/workloads_flavors/golden_files` and fails if
4646
any golden files have been added, modified, or removed.
4747

48-
_*If you add or modify any YAML files, you must run the following commands:*_
48+
*If you remove any YAML files, you must identify the changed files and
49+
`git rm` them before committing the result.*
4950

50-
```
51-
PYTHONPATH=. python3 tests/unittest/benchmark_runner/common/template_operations/generate_golden_files.py
52-
git add tests/unittest/benchmark_runner/common/templates/golden_files
53-
git commit -m "Update golden files"
54-
```
51+
_*If you add or modify any YAML files, you must run the following
52+
commands from top level to regenerate and test the golden files:*_
5553

56-
If you remove any YAML files, you must identify the changed files and
57-
`git rm` them before committing the result.
5854

59-
The check is run automatically as part of the unit tests; if you want
60-
to run it manually, you can do so as follows. The test should take
61-
only a few seconds to run.
55+
The `make` command will run a check automatically to check to verify
56+
the golden files; this check is also run as part of the unit tests.
57+
The output will look like this:
6258

6359
```
64-
$ PYTHONPATH=. python3 -m pytest -v tests/unittest/benchmark_runner/common/template_operations/
60+
$ make all
6561
============================== test session starts ===============================
6662
platform linux -- Python 3.9.5, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
6763
cachedir: .pytest_cache
@@ -74,6 +70,13 @@ tests/unittest/benchmark_runner/common/templates/test_golden_files.py::test_gold
7470
=============================== 1 passed in 1.85s ================================
7571
```
7672

73+
If the check succeeds, you need to add and commit the golden files:
74+
75+
```
76+
$ git add tests/unittest/benchmark_runner/common/templates/golden_files
77+
$ git commit -m "Update golden files"
78+
```
79+
7780
This test uses synthetic environment variables that you do not need to
7881
modify, and you should never have to manually modify the golden files
7982
except to manually remove any that are no longer required.

Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.PHONY: golden_files
2+
3+
all: golden_files test_golden_files
4+
5+
golden_files:
6+
PYTHONPATH=. python3 tests/unittest/benchmark_runner/common/template_operations/generate_golden_files.py
7+
8+
test_golden_files:
9+
PYTHONPATH=. python3 -m pytest -v tests/unittest/benchmark_runner/common/template_operations/

benchmark_runner/common/ocp_resources/create_kata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ def create_kata(self):
7171
completed_nodes_count = self.__oc.run(cmd="oc get kataconfig -ojsonpath='{.items[0].status.installationStatus.completed.completed_nodes_count}'")
7272
if total_nodes_count != completed_nodes_count:
7373
raise KataInstallationFailed(f'not all nodes installed successfully total {total_nodes_count} != completed {completed_nodes_count}')
74-
elif '03_ocp48_patch.sh' == resource:
74+
elif resource.endswith('.sh'):
7575
self.__oc.run(cmd=f'chmod +x {os.path.join(self.__path, resource)}; {os.path.join(self.__path, resource)}')
7676
return True
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
oc patch runtimeclass kata -p '{"overhead":{"podFixed":{"memory":"2398Mi"}}}'

benchmark_runner/common/template_operations/template_operations.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import benchmark_runner
77
from multiprocessing import Process
88

9-
from jinja2 import Template
9+
from jinja2 import Template, TemplateSyntaxError
1010
from benchmark_runner.common.template_operations.render_yaml_from_template import render_yaml_file
1111
from benchmark_runner.common.logger.logger_time_stamp import logger_time_stamp, logger
1212
from benchmark_runner.main.environment_variables import environment_variables
@@ -156,8 +156,11 @@ def __generate_yamls_internal(self, scale: str = None, scale_num: str = None, sc
156156
else:
157157
file_components = os.path.splitext(filename)
158158
template_file = f'{file_components[0]}_template{file_components[1]}'
159-
with open(os.path.join(workload_dir_path, 'internal_data', template_file)) as f:
160-
template = Template(f.read())
159+
try:
160+
with open(os.path.join(workload_dir_path, 'internal_data', template_file)) as f:
161+
template = Template(f.read())
162+
except TemplateSyntaxError as err:
163+
raise SyntaxError(f"Error while rendering {template_file}: {err}")
161164
answer[filename] = f"{template.render(render_data)}\n"
162165
if scale:
163166
answer['namespace.yaml'] = render_yaml_file(dir_path=os.path.join(self.__dir_path, 'scale'), yaml_file='namespace.yaml', environment_variable_dict=self.__environment_variables_dict)

benchmark_runner/common/template_operations/templates/vdbench/internal_data/vdbench_pod_template.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@ spec:
114114
memory: {{ requests_memory }}
115115
limits:
116116
cpu: {{ limits_cpu }}
117-
{%- if not kind == 'kata' %}
118117
memory: {{ limits_memory }}
119-
{%- endif %}
120118
{%- if cluster == "kubernetes" %}
121119
volumeMounts:
122120
- name: vdbench-pod-vol

benchmark_runner/common/template_operations/templates/vdbench/internal_data/vdbench_vm_template.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ spec:
8383
memory: {{ requests_memory }}
8484
limits:
8585
cpu: {{ limits_cpu }}
86-
memory: {{ requests_memory }}
86+
memory: {{ limits_memory }}
8787
terminationGracePeriodSeconds: 180
8888
volumes:
8989
{%- if odf_pvc == True %}

benchmark_runner/common/template_operations/templates/vdbench/vdbench_data_template.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ template_data:
4141
# size in MB
4242
SIZE_PER_FILE: 10
4343
limits_cpu: 2
44-
limits_memory: 64Gi
44+
limits_memory: 4Gi
4545
requests_cpu: 2
4646
requests_memory: 4Gi
4747
storage: 64Gi

tests/unittest/benchmark_runner/common/template_operations/golden_files/func_ci_vdbench_kata_ODF_PVC_False/vdbench_pod.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ spec:
3434
memory: 4Gi
3535
limits:
3636
cpu: 2
37+
memory: 4Gi
3738
env:
3839
- name: BLOCK_SIZES
3940
value: "64,oltp1"

tests/unittest/benchmark_runner/common/template_operations/golden_files/func_ci_vdbench_kata_ODF_PVC_True/vdbench_pod.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ spec:
4646
memory: 4Gi
4747
limits:
4848
cpu: 2
49+
memory: 4Gi
4950
volumeMounts:
5051
- name: vdbench-pod-pvc-claim
5152
mountPath: "/workload"

tests/unittest/benchmark_runner/common/template_operations/golden_files/perf_ci_vdbench_kata_ODF_PVC_False/vdbench_pod.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ spec:
3434
memory: 4Gi
3535
limits:
3636
cpu: 2
37+
memory: 4Gi
3738
env:
3839
- name: BLOCK_SIZES
3940
value: "oltp1,oltp2,oltphw,odss2,odss128,4_cache,64_cache,4,64,4_cache,64_cache,4,64"

tests/unittest/benchmark_runner/common/template_operations/golden_files/perf_ci_vdbench_kata_ODF_PVC_True/vdbench_pod.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ spec:
4646
memory: 4Gi
4747
limits:
4848
cpu: 2
49+
memory: 4Gi
4950
volumeMounts:
5051
- name: vdbench-pod-pvc-claim
5152
mountPath: "/workload"

tests/unittest/benchmark_runner/common/template_operations/golden_files/perf_ci_vdbench_pod_ODF_PVC_False/vdbench_pod.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec:
3232
memory: 4Gi
3333
limits:
3434
cpu: 2
35-
memory: 64Gi
35+
memory: 4Gi
3636
env:
3737
- name: BLOCK_SIZES
3838
value: "oltp1,oltp2,oltphw,odss2,odss128,4_cache,64_cache,4,64,4_cache,64_cache,4,64"

tests/unittest/benchmark_runner/common/template_operations/golden_files/perf_ci_vdbench_pod_ODF_PVC_True/vdbench_pod.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spec:
4444
memory: 4Gi
4545
limits:
4646
cpu: 2
47-
memory: 64Gi
47+
memory: 4Gi
4848
volumeMounts:
4949
- name: vdbench-pod-pvc-claim
5050
mountPath: "/workload"

tests/unittest/benchmark_runner/common/template_operations/golden_files/release_vdbench_kata_ODF_PVC_False/vdbench_pod.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ spec:
3434
memory: 4Gi
3535
limits:
3636
cpu: 2
37+
memory: 4Gi
3738
env:
3839
- name: BLOCK_SIZES
3940
value: "64,oltp1"

tests/unittest/benchmark_runner/common/template_operations/golden_files/release_vdbench_kata_ODF_PVC_True/vdbench_pod.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ spec:
4646
memory: 4Gi
4747
limits:
4848
cpu: 2
49+
memory: 4Gi
4950
volumeMounts:
5051
- name: vdbench-pod-pvc-claim
5152
mountPath: "/workload"

tests/unittest/benchmark_runner/common/template_operations/golden_files/test_ci_vdbench_kata_ODF_PVC_False/vdbench_pod.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ spec:
3434
memory: 4Gi
3535
limits:
3636
cpu: 2
37+
memory: 4Gi
3738
env:
3839
- name: BLOCK_SIZES
3940
value: "64,oltp1"

tests/unittest/benchmark_runner/common/template_operations/golden_files/test_ci_vdbench_kata_ODF_PVC_True/vdbench_pod.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ spec:
4646
memory: 4Gi
4747
limits:
4848
cpu: 2
49+
memory: 4Gi
4950
volumeMounts:
5051
- name: vdbench-pod-pvc-claim
5152
mountPath: "/workload"

0 commit comments

Comments
 (0)