[hft] Add aggregator CLI support#4631
Open
Pterosaur wants to merge 4 commits into
Open
Conversation
Signed-off-by: Ze Gan <ganze718@gmail.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds CLI and display support for HFT “harmonizer” configuration, extending existing HFT profile/group management to include harmonizer creation, binding, and show hft rendering.
Changes:
- Add
config hftcommands to add/delete harmonizers and bind/unbind them to profiles, including delete protection when referenced. - Extend
show hftto display harmonizer binding and harmonizer attributes (reporting rate, rollover counters, heatmap counters), including unbound harmonizers. - Update unit tests to validate harmonizer payload generation and show row formatting.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
config/hft.py |
Adds harmonizer CRUD + bind/unbind CLI commands and payload builders, plus delete protection logic. |
show/hft.py |
Reads harmonizer table from CONFIG_DB and expands displayed columns/rows to include harmonizer details. |
tests/config_hft_test.py |
Adds/updates CLI unit tests for harmonizer payload generation and delete protection messaging. |
tests/show_hft_test.py |
Updates row-format expectations and adds coverage for bound/unbound harmonizer display formatting. |
Signed-off-by: Ze Gan <ganze718@gmail.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Ze Gan <ganze718@gmail.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Ze Gan <ganze718@gmail.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Added HFT aggregator CLI support to
configandshow.This PR adds:
config hft add aggregator <name>with optional--reporting_rate,--rollover_counters, and--heatmap_counters.config hft del aggregator <name>.config hft add profile <profile> --aggregator <name>.config hft bind-aggregator <profile> <aggregator>andconfig hft unbind-aggregator <profile>.show hftoutput for profile aggregator binding and aggregator details.Why I did it
This exposes the HFT aggregator CONFIG_DB schema added by the HFT HLD and sonic-buildimage YANG updates.
How I verified it
Ran Python compile checks:
python -m py_compile config/hft.py show/hft.py tests/config_hft_test.py tests/show_hft_test.pyRan targeted HFT CLI checks covering:
config hft add aggregatorpayload generation.config hft bind-aggregatorandunbind-aggregatorpayload generation.config hft del aggregatorpayload generation.config hft del aggregatorwhen an HFT profile still references the aggregator.show hftrow formatting for bound and unbound aggregators.Full
pytest tests/config_hft_test.py tests/show_hft_test.pywas not runnable in this Windows environment because the repository testconftest.pyrequires SONiC runtime packages (sonic_py_common,swsscommon,swsssdk) that are not installed locally.Details if related
Related HLD PR: sonic-net/SONiC#2079.