-
Notifications
You must be signed in to change notification settings - Fork 12
T7424: Refactor resource validation and broaden cases #28
T7424: Refactor resource validation and broaden cases #28
Conversation
|
Add the task number on the https://vyos.dev/ and refer the task in the commit message and PR message |
152860d to
64dc57c
Compare
sever-sever
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a task number on the https://vyos.dev/ and the task should be in the commit message and PR titile
64dc57c to
a3981ee
Compare
@sever-sever done and linked |
ed335e7 to
b7599bb
Compare
b7599bb to
0079ff5
Compare
08ef111 to
ff79b95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the resource validation logic for VPP configuration by modularizing CPU and memory checks and enhancing error messages for better granularity.
- Refactored interface address extraction in NAT configuration.
- Updated CPU and memory resource validations by introducing dedicated helper functions across multiple modules.
- Removed redundant memory checks and improved consistency in error messaging.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/conf_mode/vpp_nat.py | Reformatted chained method calls for clarity in interface address retrieval. |
| src/conf_mode/vpp.py | Updated resource validations and removed deprecated memory check functions. |
| python/vyos/vpp/config_verify.py | Added new functions to verify minimal CPU/memory requirements and resource usage. |
| python/vyos/vpp/config_resource_checks/memory.py | Introduced functions for calculating and validating memory consumption. |
| python/vyos/vpp/config_resource_checks/cpu.py | Added functions for CPU core and worker validations. |
| python/vyos/vpp/config_resource_checks/constants.py | Defined constants for resource thresholds and defaults. |
Comments suppressed due to low confidence (2)
python/vyos/vpp/config_verify.py:263
- The parameter 'workers' is annotated as a string but is treated as an iterable of worker range strings. Consider updating its type annotation to List[str] to accurately reflect its expected usage.
def verify_vpp_settings_cpu_corelist_workers(cpus: int, main_core: int, workers: str) -> int:
python/vyos/vpp/config_resource_checks/memory.py:107
- The function 'available_core_count' is used here but not imported. Please update the import statement to import 'available_core_count' from 'vyos.vpp.config_resource_checks.cpu' or use an already imported equivalent.
'memory_buffers': buffer_size(settings, available_core_count()),
0271a74 to
f9bfcdd
Compare
…VPP CLI T7424: Fix ruff errors
f9bfcdd to
566b706
Compare
638719c to
1a6f9f8
Compare
1a6f9f8 to
e4c2efe
Compare
052d3d7 to
fea23b7
Compare
…rements for test environments T7424: Fix errors in calculating the skipped and reserved CPU cores; Adjust default main heap size value.
fea23b7 to
d032a22
Compare
c2ec32f to
5dd9d91
Compare
5dd9d91 to
96b9881
Compare
T7424: Fix CPU reserve and skip cores calculations; Add total CPU usage check T7424: Refactor smoketests to reflect new logic
96b9881 to
ca347e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the VPP resource validation logic by replacing direct memory and CPU checks with new, modular verification functions, and updates the related test cases for CPU settings.
- Refactored VPP resource checks in configuration and verification modules.
- Introduced new functions to verify minimal CPU, memory, and other VPP-specific settings in the configuration.
- Updated smoketest cases to reflect the updated validation logic for CPU workers and core lists.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/conf_mode/vpp.py | Removed unused imports and integrated new resource verification APIs. |
| smoketest/scripts/cli/test_vpp.py | Adjusted test values to match refactored CPU settings. |
| python/vyos/vpp/config_verify.py | Added several new verification functions for CPU and memory checks. |
| python/vyos/vpp/config_resource_checks/resource_defaults.py | Defined default values for resource consumption checks. |
| python/vyos/vpp/config_resource_checks/memory.py | Added functions for memory consumption calculations. |
| python/vyos/vpp/config_resource_checks/cpu.py | Added CPU core validation functions and updated available cores logic. |
| interface-definitions/vpp.xml.in | Updated XML defaults for memory sizes on VPP interface definitions. |
Comments suppressed due to low confidence (1)
src/conf_mode/vpp.py:449
- The function verify_vpp_settings_cpu_corelist_workers is defined to expect the 'workers' parameter as a string, yet a list is passed from cpu_settings. Consider updating the parameter type annotation (or the test data) to consistently use a list for corelist-workers.
if 'corelist_workers' in cpu_settings:
|
@oniko94, why was it closed? |
Change Summary
Types of changes
Refactoring the resource usage (CPU and memory) checks for VPP configuration mode on verify stage for more fine-grained resource utilization when configuring.
Related Task(s)
https://vyos.dev/T7424
Related PR(s)
Proposed changes
How to test
Checklist: