-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
120 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# K8s Power Manager | ||
|
||
## Components | ||
1. **PowerManager Controller**: ensures the actual state matches the desired state of the cluster. | ||
2. **PowerConfig Controller**: sees the powerConfig created by user and deploys Power Node Agents onto each node specified using a DaemonSet. | ||
- powerNodeSelector: A key/value map used to define a list of node labels that a node must satisfy for the operator’s node | ||
agent to be deployed. | ||
- powerProfiles: The list of PowerProfiles that the user wants available on the nodes | ||
3. **Power Node Agent**: containerized applications used to communicate with the node’s Kubelet PodResources endpoint to discover the exact CPUs that | ||
are allocated per container and tune frequency of the cores as requested | ||
|
||
|
||
## Setup | ||
### 1. Manual | ||
|
||
Execute the following below **as a non-root user with sudo rights** using **bash**: | ||
1. Run the node setup script: | ||
```bash | ||
git clone -b power_manager --depth=1 https://github.com/vhive-serverless/vhive.git | ||
./scripts/power_manager/setup_poer_manager.sh; | ||
|
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,11 @@ | ||
apiVersion: "power.intel.com/v1" | ||
kind: PowerConfig | ||
metadata: | ||
name: power-config | ||
spec: | ||
# Add labels here for the Nodes you want the PowerNodeAgent to be applied to | ||
powerNodeSelector: | ||
feature.node.kubernetes.io/power-node: "true" | ||
# Add wanted PowerProfiles here; valid entries are as follows: performance, balance-performance, balance-power | ||
powerProfiles: | ||
- "performance" |
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,58 @@ | ||
#!/bin/bash | ||
|
||
# MIT License | ||
# | ||
# Copyright (c) 2020 Dmitrii Ustiugov, Plamen Petrov and EASE lab | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
PWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
# Install K8 Power Manager | ||
git clone https://github.com/intel/kubernetes-power-manager $HOME/kubernetes-power-manager | ||
cd $HOME/kubernetes-power-manager | ||
|
||
# Set up the necessary Namespace, Service Account, and RBAC rules for the Kubernetes Power Manager | ||
kubectl apply -f config/rbac/namespace.yaml | ||
kubectl apply -f config/rbac/rbac.yaml | ||
|
||
# Generate the CRD templates, create the Custom Resource Definitions, and install the CRDs | ||
make | ||
|
||
# Built Docker images locally | ||
make images | ||
|
||
# Apply Power Manager Controller | ||
kubectl apply -f config/manager/manager.yaml | ||
|
||
# Apply PowerConfig -> create the power-node-agent DaemonSet that manages the Power Node Agent pods. | ||
kubectl apply -f ${PWD}/powerconfig.yaml | ||
|
||
# Apply Profile. U can modify the spec in the shared-profile.yaml file | ||
kubectl apply -f ${PWD}/shared-profile.yaml | ||
|
||
# Apply the shared PowerWorkload. All CPUs (except reservedCPUs specified in this yaml file) will be tuned ti the specified frequency in shared-profile.yaml | ||
kubectl apply -f ${PWD}/shared-workload.yaml | ||
|
||
kubectl get powerprofiles -n intel-power | ||
kubectl get powerworkloads -n intel-power | ||
|
||
|
||
|
||
|
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,11 @@ | ||
apiVersion: "power.intel.com/v1" | ||
kind: PowerProfile | ||
metadata: | ||
name: shared | ||
spec: | ||
name: "shared" | ||
max: 1500 | ||
min: 1000 | ||
# A shared PowerProfile must have the EPP value of 'power' | ||
epp: "power" | ||
governor: "powersave" |
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,19 @@ | ||
apiVersion: "power.intel.com/v1" | ||
kind: PowerWorkload | ||
metadata: | ||
# Replace <NODE_NAME> with the Node you intend this PowerWorkload to be associated with | ||
name: shared-<NODE_NAME>-workload | ||
namespace: intel-power | ||
spec: | ||
# Replace <NODE_NAME> with the Node you intend this PowerWorkload to be associated with | ||
name: "shared-<NODE_NAME>-workload" | ||
allCores: true | ||
reservedCPUs: | ||
# IMPORTANT: The CPUs in reservedCPUs should match the value of the reserved system CPUs in your Kubelet config file | ||
- 0 | ||
- 1 | ||
powerNodeSelector: | ||
# The label must be as below, as this workload will be specific to the Node | ||
kubernetes.io/hostname: <NODE_NAME> | ||
# Replace this value with the intended shared PowerProfile | ||
powerProfile: "shared" |