-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support thermal policy management including policy file loading, information collecting, condition matching and action executing policy #73
Merged
Conversation
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
…dd unit test for thermal policy
…xception instead of KeyError
Junchao-Mellanox
changed the title
ThermSupport thermal policy management including policy file loading, information collecting, condition matching and action executing policy
Support thermal policy management including policy file loading, information collecting, condition matching and action executing policy
Jan 7, 2020
keboliu
approved these changes
Jan 11, 2020
jleveque
suggested changes
Jan 15, 2020
sonic_platform_base/sonic_thermal_control/thermal_action_base.py
Outdated
Show resolved
Hide resolved
Please fix new conflicts. |
@stepanblyschak please review as well |
jleveque
approved these changes
Feb 11, 2020
@jleveque @liat-grozovik my view is that this PR is ready to merge, would you please help to proceed? |
Junchao-Mellanox
added a commit
to Junchao-Mellanox/sonic-platform-common
that referenced
this pull request
Jun 1, 2020
…rmation collecting, condition matching and action executing policy (sonic-net#73)
this is merged via direct PR for 201911 |
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?
Thermal policy is a feature to allow SONiC user control switch's behavior via a JSON configuration file. For example, user can configure that when any FAN absence, all other FAN should speed to 100%. Thermal policy feature divide such use case into three concepts: info, condition and action.
Info represents some kind of status of the switch, the default info of mellanox platform are FAN info and PSU info. Info object collect switch status and wait for thermal policy to "consume" it. Info types are defined in JSON, each info type must correspond to a ThermalPolicyInfoBase-derived class. Vendo can define their own info class.
Condition consume Info objects and determine if a certain event happened. In previous example, the condition is "any FAN absence". Condition types are defined in JSON, each condition type must correspond to a ThermalPolicyConditionBase-derived class. Thermal manager create and initialize condition objects while loading JSON file.
Action object execute something when conditions match. In previous example, the action is "set other FAN speed to 100%". Action types are defined in JSON, each action type must correspond to a ThermalPolicyActionBase-derived class. Thermal manager create and initialize action objects while loading JSON file.
A thermal policy file can define arbitrary number of info and policy. Each policy can define arbitrary number of conditions and actions. If all conditions of a policy match, all actions of the policy will be executed.