|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# MIT License |
| 4 | +# |
| 5 | +# Copyright (c) 2020 Dmitrii Ustiugov, Plamen Petrov and EASE lab |
| 6 | +# |
| 7 | +# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | +# of this software and associated documentation files (the "Software"), to deal |
| 9 | +# in the Software without restriction, including without limitation the rights |
| 10 | +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | +# copies of the Software, and to permit persons to whom the Software is |
| 12 | +# furnished to do so, subject to the following conditions: |
| 13 | +# |
| 14 | +# The above copyright notice and this permission notice shall be included in all |
| 15 | +# copies or substantial portions of the Software. |
| 16 | +# |
| 17 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | +# SOFTWARE. |
| 24 | + |
| 25 | +PWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 26 | + |
| 27 | +# Install K8 Power Manager |
| 28 | +git clone https://github.com/intel/kubernetes-power-manager $HOME/kubernetes-power-manager |
| 29 | +cd $HOME/kubernetes-power-manager |
| 30 | + |
| 31 | +# Set up the necessary Namespace, Service Account, and RBAC rules for the Kubernetes Power Manager |
| 32 | +kubectl apply -f config/rbac/namespace.yaml |
| 33 | +kubectl apply -f config/rbac/rbac.yaml |
| 34 | + |
| 35 | +# Generate the CRD templates, create the Custom Resource Definitions, and install the CRDs |
| 36 | +make |
| 37 | + |
| 38 | +# Built Docker images locally |
| 39 | +make images |
| 40 | + |
| 41 | +# Apply Power Manager Controller |
| 42 | +kubectl apply -f config/manager/manager.yaml |
| 43 | + |
| 44 | +# Apply PowerConfig -> create the power-node-agent DaemonSet that manages the Power Node Agent pods. |
| 45 | +kubectl apply -f ${PWD}/powerconfig.yaml |
| 46 | + |
| 47 | +# Apply Profile. U can modify the spec in the shared-profile.yaml file |
| 48 | +kubectl apply -f ${PWD}/shared-profile.yaml |
| 49 | + |
| 50 | +# Apply the shared PowerWorkload. All CPUs (except reservedCPUs specified in this yaml file) will be tuned ti the specified frequency in shared-profile.yaml |
| 51 | +kubectl apply -f ${PWD}/shared-workload.yaml |
| 52 | + |
| 53 | +kubectl get powerprofiles -n intel-power |
| 54 | +kubectl get powerworkloads -n intel-power |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
0 commit comments