-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Auto Techsupport] Event driven Techsupport Changes (#8670)
#### Why I did it Changes required for feature "Event Driven TechSupport Invocation & CoreDump Mgmt". [HLD](sonic-net/SONiC#818 ) Requires: sonic-net/sonic-utilities#1796. Merging in any order would be fine. Summary of the changes: - Added the YANG Models for the new tables introduces as a part of this feature. - Enhanced init_cfg.json with the default config required - Added a compile Time flag which enables/disables the config required for this feature inside the init_cfg.json - Enhanced the supervisor-proc-exit-listener script to populate `<feature>:<critical_proc> = <comm>:<pid>` info in the STATE_DB when it observes an proc exit notification for the critical processes running inside the docker.
- Loading branch information
Showing
9 changed files
with
285 additions
and
1 deletion.
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
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
27 changes: 27 additions & 0 deletions
27
src/sonic-yang-models/tests/yang_model_tests/tests/auto_techsupport.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,27 @@ | ||
{ | ||
"AUTO_TECHSUPPORT_TEST":{ | ||
"desc": "Configure auto techsupport params in AUTO_TECHSUPPORT Table" | ||
}, | ||
"AUTO_TECHSUPPORT_WRONG_STATE_VALUE": { | ||
"desc": "Configure state key with invalid value", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"AUTO_TECHSUPPORT_INVALID_RATE_LIMIT_FORMAT": { | ||
"desc" : "Configure cooloff with a value of invalid format", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"AUTO_TECHSUPPORT_OUT_OF_RANGE_DECIMAL": { | ||
"desc" : "Configure a value for core-uage outside the range [0, 100)", | ||
"eStr": "Value \"100.00\" does not satisfy the constraint \"0..99.99\" (range, length, or pattern)." | ||
}, | ||
"AUTO_TECHSUPPORT_VALID_DECIMAL_VALUE": { | ||
"desc" : "Configure a value for max_techsupport_size inside the range [0, 100)" | ||
}, | ||
"AUTO_TECHSUPPORT_INVALID_FRACTION_DIGITS": { | ||
"desc" : "Configure a value for max_techsupport_size inside the range [0, 100) but with 3 fractional digits", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"AUTO_TECHSUPPORT_RATE_LIMIT_INTERVAL_TEST": { | ||
"desc" : "Configure and test the valid configuration" | ||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
src/sonic-yang-models/tests/yang_model_tests/tests_config/auto_techsupport.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,85 @@ | ||
{ | ||
"AUTO_TECHSUPPORT_TEST": { | ||
"sonic-auto_techsupport:sonic-auto_techsupport": { | ||
"sonic-auto_techsupport:AUTO_TECHSUPPORT": { | ||
"sonic-auto_techsupport:GLOBAL": { | ||
"state" : "enabled", | ||
"rate_limit_interval" : "180", | ||
"max_techsupport_limit" : "10.0", | ||
"max_core_limit" : "5.0", | ||
"since" : "2 days ago" | ||
} | ||
} | ||
} | ||
}, | ||
"AUTO_TECHSUPPORT_WRONG_STATE_VALUE": { | ||
"sonic-auto_techsupport:sonic-auto_techsupport": { | ||
"sonic-auto_techsupport:AUTO_TECHSUPPORT": { | ||
"sonic-auto_techsupport:GLOBAL": { | ||
"state" : "start", | ||
"rate_limit_interval" : "180", | ||
"max_techsupport_limit" : "10.0", | ||
"max_core_limit" : "5.0", | ||
"since" : "2 days ago" | ||
} | ||
} | ||
} | ||
}, | ||
"AUTO_TECHSUPPORT_INVALID_RATE_LIMIT_FORMAT": { | ||
"sonic-auto_techsupport:sonic-auto_techsupport": { | ||
"sonic-auto_techsupport:AUTO_TECHSUPPORT": { | ||
"sonic-auto_techsupport:GLOBAL": { | ||
"rate_limit_interval" : "whatever" | ||
} | ||
} | ||
} | ||
}, | ||
"AUTO_TECHSUPPORT_OUT_OF_RANGE_DECIMAL": { | ||
"sonic-auto_techsupport:sonic-auto_techsupport": { | ||
"sonic-auto_techsupport:AUTO_TECHSUPPORT": { | ||
"sonic-auto_techsupport:GLOBAL": { | ||
"max_core_limit" : "100.00", | ||
"rate_limit_interval" : "180" | ||
} | ||
} | ||
} | ||
}, | ||
"AUTO_TECHSUPPORT_VALID_DECIMAL_VALUE": { | ||
"sonic-auto_techsupport:sonic-auto_techsupport": { | ||
"sonic-auto_techsupport:AUTO_TECHSUPPORT": { | ||
"sonic-auto_techsupport:GLOBAL": { | ||
"max_techsupport_limit" : "11.23", | ||
"max_core_limit" : "99.99" | ||
} | ||
} | ||
} | ||
}, | ||
"AUTO_TECHSUPPORT_INVALID_FRACTION_DIGITS": { | ||
"sonic-auto_techsupport:sonic-auto_techsupport": { | ||
"sonic-auto_techsupport:AUTO_TECHSUPPORT": { | ||
"sonic-auto_techsupport:GLOBAL": { | ||
"max_techsupport_limit" : "11.111", | ||
"max_core_limit" : "99.99" | ||
} | ||
} | ||
} | ||
}, | ||
"AUTO_TECHSUPPORT_RATE_LIMIT_INTERVAL_TEST": { | ||
"sonic-auto_techsupport:sonic-auto_techsupport": { | ||
"sonic-auto_techsupport:AUTO_TECHSUPPORT_FEATURE": { | ||
"AUTO_TECHSUPPORT_FEATURE_LIST": [ | ||
{ | ||
"feature_name" : "bgp", | ||
"state" : "enabled", | ||
"rate_limit_interval" : "600" | ||
}, | ||
{ | ||
"feature_name" : "swss", | ||
"state" : "disabled", | ||
"rate_limit_interval" : "400" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
111 changes: 111 additions & 0 deletions
111
src/sonic-yang-models/yang-models/sonic-auto_techsupport.yang
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,111 @@ | ||
module sonic-auto_techsupport { | ||
|
||
yang-version 1.1; | ||
|
||
namespace "http:/Azure/sonic-auto_techsupport"; | ||
prefix auto_techsupport; | ||
|
||
import sonic-types { | ||
prefix stypes; | ||
} | ||
|
||
description "Event Driven Techsupport & CoreDump Mgmt Capability in SONiC OS"; | ||
|
||
revision 2021-08-09 { | ||
description "First Revision"; | ||
} | ||
|
||
typedef decimal-repr { | ||
type decimal64 { | ||
fraction-digits 2; | ||
range 0.0..99.99; | ||
} | ||
} | ||
|
||
container sonic-auto_techsupport { | ||
|
||
container AUTO_TECHSUPPORT { | ||
|
||
description "AUTO_TECHSUPPORT part of config_db.json"; | ||
|
||
container GLOBAL { | ||
|
||
leaf state { | ||
description "Knob to make techsupport invocation event-driven based on core-dump generation"; | ||
type stypes:admin_mode; | ||
} | ||
|
||
leaf rate_limit_interval { | ||
description "Minimum time in seconds between two successive techsupport invocations. Configure 0 to explicitly disable"; | ||
type uint16; | ||
} | ||
|
||
leaf max_techsupport_limit { | ||
/* | ||
A value between 0.0-99.99 should be specified. | ||
The actual value in bytes is calculate based on the available space in the filesystem hosting /var/dump | ||
When the limit is crossed, the older dump files are incrementally deleted | ||
*/ | ||
description "Max Limit in percentage for the cummulative size of ts dumps. No cleanup is performed if the value isn't configured or is 0.0"; | ||
type decimal-repr; | ||
} | ||
|
||
leaf max_core_limit { | ||
/* | ||
A value between 0.0-99.99 should be specified. | ||
The actual value in bytes is calculated based on the available space in the filesystem hosting /var/core | ||
When the limit is crossed, the older core files are incrementally deleted | ||
*/ | ||
description "Max Limit in percentage for the cummulative size of core dumps. No cleanup is performed if the value isn't congiured or is 0.0"; | ||
type decimal-repr; | ||
} | ||
|
||
leaf since { | ||
/* | ||
Any valid date string of the formats specified here (https://www.gnu.org/software/coreutils/manual/html_node/Date-input-formats.html) | ||
can be used. | ||
*/ | ||
description "Only collect the logs & core-dumps generated since the time provided. A default value of '2 days ago' is used if this value is not set explicitly or a non-valid string is provided"; | ||
type string { | ||
length 1..255; | ||
} | ||
} | ||
} | ||
/* end of container GLOBAL */ | ||
} | ||
/* end of container AUTO_TECHSUPPORT */ | ||
|
||
container AUTO_TECHSUPPORT_FEATURE { | ||
|
||
description "AUTO_TECHSUPPORT_FEATURE part of config_db.json"; | ||
|
||
list AUTO_TECHSUPPORT_FEATURE_LIST { | ||
|
||
key "feature_name"; | ||
|
||
leaf feature_name { | ||
description "The name of this feature"; | ||
/* TODO: Leafref once the FEATURE YANG is added*/ | ||
type string { | ||
length 1..255; | ||
} | ||
} | ||
|
||
leaf state { | ||
description "Enable auto techsupport invocation on the processes running inside this feature"; | ||
type stypes:admin_mode; | ||
} | ||
|
||
leaf rate_limit_interval { | ||
description "Rate limit interval for the corresponding feature. Configure 0 to explicitly disable"; | ||
type uint16; | ||
} | ||
|
||
} | ||
/* end of AUTO_TECHSUPPORT_FEATURE_LIST */ | ||
} | ||
/* end of container AUTO_TECHSUPPORT_FEATURE */ | ||
} | ||
/* end of top level container */ | ||
} | ||
|