Skip to content

Commit 6674807

Browse files
KTCyberHermioneKT
authored andcommitted
# This is a combination of 154 commits.
# This is the 1st commit message: refactor # This is the commit message #2: modify powerNodeSelector # This is the commit message #3: modify powerNodeSelector # This is the commit message #4: modify powerNodeSelector # This is the commit message #5: modify namespace # This is the commit message #6: modify namespace # This is the commit message #7: add namespace # This is the commit message #8: init power manager script # This is the commit message #9: add go code # This is the commit message #10: test # This is the commit message #11: test # This is the commit message #12: test # This is the commit message #13: test # This is the commit message #14: go.sum # This is the commit message #15: go sum # This is the commit message #16: go mod tidy # This is the commit message #17: test # This is the commit message #18: test # This is the commit message #19: test # This is the commit message #20: test # This is the commit message #21: test # This is the commit message #22: test # This is the commit message #23: test # This is the commit message #24: test # This is the commit message #25: test # This is the commit message #26: test # This is the commit message #27: test # This is the commit message #28: test # This is the commit message #29: print output # This is the commit message #30: test # This is the commit message #31: test # This is the commit message #32: test # This is the commit message #33: test # This is the commit message #34: test # This is the commit message #35: test # This is the commit message #36: test # This is the commit message #37: test # This is the commit message #38: test # This is the commit message #39: test # This is the commit message #40: refactor # This is the commit message #41: change val # This is the commit message #42: test # This is the commit message #43: test # This is the commit message #44: test # This is the commit message #45: exp1 # This is the commit message #46: add url # This is the commit message #47: test # This is the commit message #48: test # This is the commit message #49: test auth # This is the commit message #50: test # This is the commit message #51: test # This is the commit message #52: test # This is the commit message #53: test # This is the commit message #54: test # This is the commit message #55: fix bug # This is the commit message #56: remove log # This is the commit message #57: test # This is the commit message #58: test # This is the commit message #59: test # This is the commit message #60: fix loop # This is the commit message #61: increase invocation # This is the commit message #62: test # This is the commit message #63: test # This is the commit message #64: test # This is the commit message #65: test # This is the commit message #66: test # This is the commit message #67: test # This is the commit message #68: test # This is the commit message #69: Test # This is the commit message #70: test # This is the commit message #71: test # This is the commit message #72: test # This is the commit message #73: test # This is the commit message #74: test # This is the commit message #75: test # This is the commit message #76: test # This is the commit message #77: test # This is the commit message #78: test # This is the commit message #79: test # This is the commit message #80: test # This is the commit message #81: test # This is the commit message #82: test # This is the commit message #83: test # This is the commit message #84: test # This is the commit message #85: test # This is the commit message #86: test # This is the commit message #87: test # This is the commit message #88: test # This is the commit message #89: test # This is the commit message #90: test1 # This is the commit message #91: test # This is the commit message #92: test # This is the commit message #93: test # This is the commit message #94: test # This is the commit message #95: test # This is the commit message #96: test # This is the commit message #97: test # This is the commit message #98: test # This is the commit message #99: test # This is the commit message #100: test # This is the commit message #101: test # This is the commit message #102: test # This is the commit message #103: test # This is the commit message #104: test # This is the commit message #105: test # This is the commit message #106: test # This is the commit message #107: test # This is the commit message #108: test # This is the commit message #109: test1 # This is the commit message #110: test # This is the commit message #111: test # This is the commit message #112: Test # This is the commit message #113: test # This is the commit message #114: test # This is the commit message #115: test # This is the commit message #116: test # This is the commit message #117: test # This is the commit message #118: test # This is the commit message #119: Test # This is the commit message #120: Test # This is the commit message #121: test # This is the commit message #122: test # This is the commit message #123: Test # This is the commit message #124: test # This is the commit message #125: test # This is the commit message #126: test # This is the commit message #127: test # This is the commit message #128: test # This is the commit message #129: test # This is the commit message #130: test # This is the commit message #131: test # This is the commit message #132: test # This is the commit message #133: test # This is the commit message #134: test # This is the commit message #135: test # This is the commit message #136: test # This is the commit message #137: test # This is the commit message #138: test # This is the commit message #139: test # This is the commit message #140: test # This is the commit message #141: test # This is the commit message #142: test # This is the commit message #143: Test # This is the commit message #144: Test # This is the commit message #145: Test # This is the commit message #146: Test # This is the commit message #147: test # This is the commit message #148: test # This is the commit message #149: test # This is the commit message #150: test # This is the commit message #151: test # This is the commit message #152: test # This is the commit message #153: test # This is the commit message #154: Test
1 parent 22054ad commit 6674807

22 files changed

+97744
-69
lines changed

examples/powermanger/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# K8s Power Manager
2+
3+
## Components
4+
1. **PowerManager Controller**: ensures the actual state matches the desired state of the cluster.
5+
2. **PowerConfig Controller**: sees the powerConfig created by user and deploys Power Node Agents onto each node specified using a DaemonSet.
6+
- powerNodeSelector: A key/value map used to define a list of node labels that a node must satisfy for the operator's node
7+
agent to be deployed.
8+
- powerProfiles: The list of PowerProfiles that the user wants available on the nodes
9+
3. **Power Node Agent**: containerized applications used to communicate with the node's Kubelet PodResources endpoint to discover the exact CPUs that
10+
are allocated per container and tune frequency of the cores as requested
11+
12+
13+
## Setup
14+
### 1. Manual
15+
#### on both nodes
16+
git clone -b new_test --depth=1 https://github.com/vhive-serverless/vhive.git
17+
cd vhive
18+
mkdir -p /tmp/vhive-logs
19+
./scripts/cloudlab/setup_node.sh stock-only > >(tee -a /tmp/vhive-logs/setup_node.stdout) 2> >(tee -a /tmp/vhive-logs/setup_node.stderr >&2)
20+
21+
#### for worker
22+
./scripts/cluster/setup_worker_kubelet.sh stock-only > >(tee -a /tmp/vhive-logs/setup_worker_kubelet.stdout) 2> >(tee -a /tmp/vhive-logs/setup_worker_kubelet.stderr >&2)
23+
sudo screen -dmS containerd bash -c "containerd > >(tee -a /tmp/vhive-logs/containerd.stdout) 2> >(tee -a /tmp/vhive-logs/containerd.stderr >&2)"
24+
25+
#### for master
26+
sudo screen -dmS containerd bash -c "containerd > >(tee -a /tmp/vhive-logs/containerd.stdout) 2> >(tee -a /tmp/vhive-logs/containerd.stderr >&2)"
27+
./scripts/cluster/create_multinode_cluster.sh stock-only > >(tee -a /tmp/vhive-logs/create_multinode_cluster.stdout) 2> >(tee -a /tmp/vhive-logs/create_multinode_cluster.stderr >&2)
28+
29+
join the cluster from worker, answer 'y' to master
30+
31+
## Setup
32+
### 1. Manual
33+
34+
Execute the following below **as a non-root user with sudo rights** using **bash**:
35+
1. Run the node setup script:
36+
```bash
37+
./examples/powermanger/setup_power_manager.sh;
38+
39+
go run ./examples/powermanger/experiment_1.go
40+
41+
while true; do current_time=$(date -u +%s%3N); cpu_average=$(grep 'MHz' /proc/cpuinfo | awk '{ total += $4 } END { print total / NR }'); echo "${current_time}: ${cpu_average}" >> memory.txt; sleep 0.01; done
42+
43+
while true; do
44+
current_time=$(date -u +%s%3N)
45+
sudo perf stat -e instructions,cycles -I 1000 -o perf_output.data sleep 1
46+
ipc=$(grep -E '(instructions|cycles)' perf_output.data | awk '{ total += $1 } END { if (total) print total / 2 }')
47+
echo "${current_time}: ${ipc}" >> ipc_results1.txt; done
48+
49+
while true; do current_time=$(date -u +%s%3N); stats=$(sudo turbostat --Summary --quiet --show Busy%,Avg_MHz,PkgWatt); echo "${current_time}, $stats" >> $output_file; sleep 0.01; done
50+
51+
2. Clean Up
52+
```bash
53+
./scripts/github_runner/clean_cri_runner.sh
54+
```
55+
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
56+
57+
58+
curl -sG 'http://127.0.0.1:9090/api/v1/query?' --data-urlencode 'query=(avg by(instance) (rate(node_cpu_seconds_total{mode="idle"}[2m])) * 100)' | jq -r '.data.result[1].value[1]'
59+
curl -G 'http://10.111.120.245:9090/api/v1/label/__name__/values'

examples/powermanger/client.go

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"os/exec"
6+
"strconv"
7+
"strings"
8+
"time"
9+
)
10+
11+
const (
12+
High int = 1
13+
Low = 2
14+
)
15+
16+
func setCPUFrequency(frequency int) error {
17+
m := map[int]string{
18+
High: "performance",
19+
Low: "shared",
20+
}
21+
fmt.Printf("applying %s profile...\n", m[frequency])
22+
command := fmt.Sprintf("kubectl apply -f - <<EOF\napiVersion: \"power.intel.com/v1\"\nkind: PowerWorkload\nmetadata:\n name: shared-node-3.kt-cluster.ntu-cloud-pg0.utah.cloudlab.us-workload\n namespace: intel-power\nspec:\n name: \"shared-node-3.kt-cluster.ntu-cloud-pg0.utah.cloudlab.us-workload\"\n allCores: true\n powerNodeSelector:\n kubernetes.io/hostname: node-3.kt-cluster.ntu-cloud-pg0.utah.cloudlab.us\n powerProfile: \"%s\"\nEOF", m[frequency])
23+
cmd := exec.Command("bash", "-c", command)
24+
25+
// Capture and check for any errors.
26+
output, err := cmd.CombinedOutput()
27+
if err != nil {
28+
return err
29+
}
30+
31+
fmt.Println(string(output)) /////
32+
return nil
33+
}
34+
35+
func main() {
36+
//file, err := os.Create("metrics.csv")
37+
//if err != nil {
38+
// panic(err)
39+
//}
40+
//defer file.Close()
41+
//
42+
//writer := csv.NewWriter(file)
43+
//defer writer.Flush()
44+
45+
command := "curl -sG 'http://127.0.0.1:9090/api/v1/query?' --data-urlencode 'query=(avg by(instance) (rate(node_cpu_seconds_total{mode=\"idle\"}[2m])) * 100)' | jq -r '.data.result[1].value[1]'"
46+
thresholdHigh := 10.0 // > 1% is idle => decrease frequency
47+
48+
start := time.Now()
49+
for time.Since(start) < (5 * time.Minute) {
50+
cmd := exec.Command("bash", "-c", command)
51+
output, err := cmd.CombinedOutput()
52+
if err != nil {
53+
fmt.Printf(fmt.Sprintf("ERR :%+v", err))
54+
}
55+
56+
resultString := strings.ReplaceAll(string(output), "\n", "")
57+
metricValue, err := strconv.ParseFloat(resultString, 64)
58+
if err != nil {
59+
fmt.Printf("Error converting to float: %v\n", err)
60+
}
61+
62+
fmt.Println(metricValue) /////
63+
if metricValue > thresholdHigh {
64+
if err := setCPUFrequency(Low); err != nil {
65+
fmt.Println("Failed to set low CPU frequency:", err)
66+
}
67+
} else {
68+
if err := setCPUFrequency(High); err != nil {
69+
fmt.Println("Failed to set high CPU frequency:", err)
70+
}
71+
}
72+
73+
//// Run the turbostat command
74+
//cmd = exec.Command("bash", "-c", "sudo turbostat --Summary --quiet --show Busy%,Avg_MHz,PkgTmp,PkgWatt --interval 1")
75+
//output, err = cmd.CombinedOutput()
76+
//if err != nil {
77+
// fmt.Printf("Error running the turbostat command: %v\n", err)
78+
//}
79+
//fmt.Println(string(output)) /////
80+
//
81+
//// Parse and extract relevant metrics from the command output
82+
//lines := strings.Split(string(output), "\n")
83+
//// You may need to adjust the line index and parsing based on the actual output format
84+
//metricsLine := lines[2]
85+
//metrics := strings.Fields(metricsLine)
86+
//fmt.Printf(fmt.Sprintf("metrics collected=%v", metrics)) /////
87+
//
88+
//// Write metrics to the CSV file
89+
//err = writer.Write(append([]string{time.Now().Format("2006-01-02 15:04:05")}, metrics...))
90+
//if err != nil {
91+
// fmt.Printf("Error writing metrics to the CSV file: %v\n", err)
92+
//}
93+
}
94+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
package main
2+
3+
import (
4+
"encoding/csv"
5+
"fmt"
6+
"os"
7+
"os/exec"
8+
"strconv"
9+
"time"
10+
)
11+
12+
func setPowerProfileToNode(freq int64) error {
13+
// powerConfig
14+
command := fmt.Sprintf("kubectl apply -f - <<EOF\napiVersion: \"power.intel.com/v1\"\nkind: PowerConfig\nmetadata:\n name: power-config\n namespace: intel-power\nspec:\n powerNodeSelector:\n kubernetes.io/hostname: node-1.kt-cluster.ntu-cloud-pg0.utah.cloudlab.us\n powerProfiles:\n - \"performance\"\nEOF")
15+
cmd := exec.Command("bash", "-c", command)
16+
_, err := cmd.CombinedOutput()
17+
if err != nil {
18+
return err
19+
}
20+
//fmt.Println(string(output))
21+
22+
// performanceProfile w freq
23+
command = fmt.Sprintf("kubectl apply -f - <<EOF\napiVersion: \"power.intel.com/v1\"\nkind: PowerProfile\nmetadata:\n name: performance\n namespace: intel-power\nspec:\n name: \"performance\"\n max: %d\n min: %d\n shared: true\n governor: \"performance\"\nEOF", freq, freq)
24+
cmd = exec.Command("bash", "-c", command)
25+
26+
_, err = cmd.CombinedOutput()
27+
if err != nil {
28+
return err
29+
}
30+
//fmt.Println(string(output))
31+
32+
// apply to node
33+
command = fmt.Sprintf("kubectl apply -f - <<EOF\napiVersion: \"power.intel.com/v1\"\nkind: PowerWorkload\nmetadata:\n name: performance-node-1.kt-cluster.ntu-cloud-pg0.utah.cloudlab.us-workload\n namespace: intel-power\nspec:\n name: \"performance-node-1.kt-cluster.ntu-cloud-pg0.utah.cloudlab.us-workload\"\n allCores: true\n powerNodeSelector:\n kubernetes.io/hostname: node-1.kt-cluster.ntu-cloud-pg0.utah.cloudlab.us\n powerProfile: \"performance\"\nEOF")
34+
cmd = exec.Command("bash", "-c", command)
35+
36+
_, err = cmd.CombinedOutput()
37+
if err != nil {
38+
return err
39+
}
40+
//fmt.Println(string(output))
41+
return nil
42+
}
43+
44+
func main() {
45+
file, err := os.Create("metrics.csv")
46+
if err != nil {
47+
panic(err)
48+
}
49+
defer file.Close()
50+
51+
writer := csv.NewWriter(file)
52+
defer writer.Flush()
53+
54+
err = writer.Write(append([]string{"startTime", "endTime", "latency"}))
55+
if err != nil {
56+
fmt.Printf("Error writing metrics to the CSV file: %v\n", err)
57+
}
58+
59+
frequencies := []int64{1200, 1400, 1600, 1800, 2000, 2200, 2400, 2600}
60+
for i := 0; i < len(frequencies); i++ {
61+
err := setPowerProfileToNode(frequencies[i])
62+
if err != nil {
63+
fmt.Printf(fmt.Sprintf("ERR1 :%+v", err))
64+
}
65+
66+
for j := 0; j <1000; j++ {
67+
url := "memory-go.default.192.168.1.240.sslip.io"
68+
command := fmt.Sprintf("cd $HOME/vSwarm/tools/test-client && ./test-client --addr %s:80 --name \"allow\"", url)
69+
70+
startInvoke := time.Now().UTC().UnixMilli()
71+
cmd := exec.Command("bash", "-c", command)
72+
_, err := cmd.CombinedOutput()
73+
if err != nil {
74+
fmt.Printf(fmt.Sprintf("ERR2: %+v", err))
75+
return
76+
}
77+
endInvoke := time.Now().UTC().UnixMilli()
78+
latency := endInvoke-startInvoke
79+
err = writer.Write(append([]string{strconv.FormatInt(startInvoke, 10), strconv.FormatInt(endInvoke, 10), strconv.FormatInt(latency, 10)}))
80+
if err != nil {
81+
fmt.Printf("Error writing metrics to the CSV file: %v\n", err)
82+
}
83+
}
84+
85+
err = writer.Write(append([]string{"-","-","-"}))
86+
if err != nil {
87+
fmt.Printf("Error writing metrics to the CSV file: %v\n", err)
88+
}
89+
fmt.Println("done")
90+
}
91+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "../.."
5+
},
6+
{
7+
"path": "../../../vSwarm"
8+
}
9+
],
10+
"settings": {}
11+
}

examples/powermanger/go.mod

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module github.com/vhive-serverless/vhive/examples/deployer
2+
3+
go 1.19
4+
5+
replace github.com/vhive-serverless/vhive/examples/deployer => ../deployer
6+
7+
require github.com/shirou/gopsutil v3.21.11+incompatible
8+
9+
require (
10+
github.com/go-ole/go-ole v1.2.6 // indirect
11+
github.com/stretchr/testify v1.8.4 // indirect
12+
github.com/tklauser/go-sysconf v0.3.12 // indirect
13+
github.com/tklauser/numcpus v0.6.1 // indirect
14+
github.com/yusufpapurcu/wmi v1.2.3 // indirect
15+
golang.org/x/sys v0.13.0 // indirect
16+
)

examples/powermanger/go.sum

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2+
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
3+
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
4+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
5+
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
6+
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
7+
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
8+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
9+
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
10+
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
11+
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
12+
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
13+
github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
14+
github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
15+
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
16+
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
17+
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
18+
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
19+
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
20+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

scripts/power_manager/powerconfig.yaml renamed to examples/powermanger/powerconfig.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ apiVersion: "power.intel.com/v1"
22
kind: PowerConfig
33
metadata:
44
name: power-config
5+
namespace: intel-power
56
spec:
67
# Add labels here for the Nodes you want the PowerNodeAgent to be applied to
78
powerNodeSelector:
8-
feature.node.kubernetes.io/power-node: "true"
9+
kubernetes.io/hostname: node-1.kt-cluster.ntu-cloud-pg0.utah.cloudlab.us
910
# Add wanted PowerProfiles here; valid entries are as follows: performance, balance-performance, balance-power
1011
powerProfiles:
1112
- "performance"

scripts/power_manager/setup_power_manager.sh renamed to examples/powermanger/setup_power_manager.sh

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,46 @@
2222
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2323
# SOFTWARE.
2424

25-
PWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
26-
2725
# Install K8 Power Manager
2826
git clone https://github.com/intel/kubernetes-power-manager $HOME/kubernetes-power-manager
29-
cd $HOME/kubernetes-power-manager
3027

3128
# 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
29+
kubectl apply -f $HOME/kubernetes-power-manager/config/rbac/namespace.yaml
30+
kubectl apply -f $HOME/kubernetes-power-manager/config/rbac/rbac.yaml
3431

35-
# Generate the CRD templates, create the Custom Resource Definitions, and install the CRDs
36-
make
32+
# Install go1.20
33+
sudo rm -rf /usr/local/go
34+
sudo apt update
35+
wget https://go.dev/dl/go1.20.2.linux-amd64.tar.gz
36+
sudo tar -C /usr/local -xzf go1.20.2.linux-amd64.tar.gz
37+
export GOROOT=/usr/local/go
38+
export GOPATH=$HOME
39+
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
3740

38-
# Built Docker images locally
39-
make images
41+
42+
# Generate the CRD templates, create the Custom Resource Definitions, and install the CRDs and Built Docker images locally
43+
cd $HOME/kubernetes-power-manager
44+
make
45+
sudo docker pull intel/power-operator
46+
sudo docker pull intel/power-node-agent:latest
4047

4148
# Apply Power Manager Controller
42-
kubectl apply -f config/manager/manager.yaml
49+
kubectl apply -f $HOME/kubernetes-power-manager/config/manager/manager.yaml
4350

4451
# Apply PowerConfig -> create the power-node-agent DaemonSet that manages the Power Node Agent pods.
45-
kubectl apply -f ${PWD}/powerconfig.yaml
52+
kubectl apply -f $HOME/vhive/examples/powermanger/powerconfig.yaml
4653

4754
# Apply Profile. U can modify the spec in the shared-profile.yaml file
48-
kubectl apply -f ${PWD}/shared-profile.yaml
55+
kubectl apply -f $HOME/vhive/examples/powermanger/shared-profile.yaml
4956

5057
# 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
58+
kubectl apply -f $HOME/vhive/examples/powermanger/shared-workload.yaml
5259

5360
kubectl get powerprofiles -n intel-power
5461
kubectl get powerworkloads -n intel-power
5562

56-
57-
58-
63+
# Add prometheus
64+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
65+
helm repo update
66+
helm install prometheus prometheus-community/kube-prometheus-stack
67+
kubectl port-forward svc/prometheus-kube-prometheus-prometheus 9090
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
kubectl apply -f - <<EOF
2+
apiVersion: "power.intel.com/v1"
3+
kind: PowerProfile
4+
metadata:
5+
name: performance
6+
namespace: intel-power
7+
spec:
8+
name: "performance"
9+
max: 3400
10+
min: 3400
11+
shared: true
12+
governor: "performance"
13+
EOF

0 commit comments

Comments
 (0)