-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Parul Singh <parsingh@redhat.com>
- Loading branch information
1 parent
f64a221
commit 1de3894
Showing
4 changed files
with
119 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,84 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import csv\n", | ||
"with open('eggs.csv', 'w', newline='') as csvfile:\n", | ||
" spamwriter = csv.writer(csvfile, delimiter=' ',\n", | ||
" quotechar='|', quoting=csv.QUOTE_MINIMAL)\n", | ||
" spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])\n", | ||
" spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 15, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"stress-ng --cpu 2--cpu-method int64 -t 60s\n" | ||
] | ||
}, | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"stress-ng: unrecognized option '--cpu-method int64'\n" | ||
] | ||
}, | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"\"Try 'stress-ng --help' for more information.\\n\"" | ||
] | ||
}, | ||
"execution_count": 15, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"import csv\n", | ||
"import subprocess\n", | ||
"with open('kepler-data.csv', 'w', newline='') as csvfile:\n", | ||
" wr = csv.writer(csvfile, delimiter=',',quotechar=' ', quoting=csv.QUOTE_MINIMAL)\n", | ||
" wr.writerow(['Package Power From Kepler', 'Number of CPUs'])\n", | ||
"\n", | ||
"cpu_num = 2\n", | ||
"time=60\n", | ||
"cmd = \"stress-ng --cpu \"+str(cpu_num)+\"--cpu-method int64 -t \"+str(time)+\"s\"\n", | ||
"print(cmd)\n", | ||
"process1=subprocess.run([\"stress-ng\",\"--cpu\",str(cpu_num),\" --cpu-method int64\",\"-t\",str(time)+\"s\"], stdout=subprocess.PIPE, text=True) \n", | ||
"process1.stdout\n" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.7" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
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,2 @@ | ||
Spam Spam Spam Spam Spam |Baked Beans| | ||
Spam |Lovely Spam| |Wonderful Spam| |
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 @@ | ||
Package Power From Kepler , Number of CPUs |
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,32 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: stress-ng | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: stress-ng | ||
template: | ||
metadata: | ||
labels: | ||
app: stress-ng | ||
spec: | ||
containers: | ||
- name: stress-ng | ||
image: quay.io/sustainability/stress-ng:0.16.02 | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: TIMEOUT | ||
value: "30" | ||
securityContext: | ||
privileged: true | ||
resources: | ||
limits: | ||
cpu: "1" # Set the CPU limit (in CPU units) | ||
command: ["stress-ng"] | ||
args: | ||
- "--cpu" | ||
- "1" # Number of workers stressing the CPU | ||
- "--cpu-load" | ||
- "30" # CPU load percentage |