Skip to content
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
merged 14 commits into from
Feb 27, 2020

Conversation

Junchao-Mellanox
Copy link
Contributor

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.

@Junchao-Mellanox 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
@Junchao-Mellanox Junchao-Mellanox marked this pull request as ready for review January 7, 2020 10:07
setup.py Outdated Show resolved Hide resolved
@jleveque
Copy link
Contributor

Please fix new conflicts.

@liat-grozovik
Copy link
Collaborator

@stepanblyschak please review as well

@keboliu
Copy link
Collaborator

keboliu commented Feb 27, 2020

@jleveque @liat-grozovik my view is that this PR is ready to merge, would you please help to proceed?

@jleveque jleveque merged commit ed50e72 into sonic-net:master Feb 27, 2020
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)
@abdosi
Copy link
Contributor

abdosi commented Jun 16, 2020

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants