-
Notifications
You must be signed in to change notification settings - Fork 124
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
Done automation for scheduler workflow. #2723
base: master
Are you sure you want to change the base?
Done automation for scheduler workflow. #2723
Conversation
2f6e663
to
ce615dd
Compare
cpu/log_generator.py
Outdated
scoreboard_setup_log_file = self.logdir + "/sched_scoreboard_setup" | ||
os.mkdir(scoreboard_setup_log_file) | ||
|
||
log_file = "%s/starce_command_output_%s.log" % ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/starce/sched_scoreboard/
cpu/log_generator.py
Outdated
|
||
def test_starce_cmd(self): | ||
""" | ||
Run the starce command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/starce/strace/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please replace throughout the file
cmd = 'echo >> "%s" 2>&1' % (log_file) | ||
process.run(cmd, ignore_status=True, sudo=True, shell=True) | ||
|
||
for i in range(self.repeat): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method sets up sched-scoreboard repo and later runs the user supplied command through time
utility. Please refactor into two seperate methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setup of sched-scoreboard repo can be done inside setUp() method
@@ -81,6 +68,20 @@ def test_sched_scoreboard_setup(self): | |||
(self.sched_scoreboard_dir) | |||
process.run(cmd, ignore_status=True, sudo=True, shell=True) | |||
|
|||
def test_sched_scoreboard_setup(self): | |||
"""_summary_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment can be removed
@@ -81,6 +68,20 @@ def test_sched_scoreboard_setup(self): | |||
(self.sched_scoreboard_dir) | |||
process.run(cmd, ignore_status=True, sudo=True, shell=True) | |||
|
|||
def test_sched_scoreboard_setup(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this method to test_run_with_time_repeat
Here in this test case we are cloning the sched_scoreboard | ||
repo and prepareing the sched_scoreboard to run. | ||
""" | ||
scoreboard_setup_log_file = self.logdir + "/sched_scoreboard_setup" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part will change to...
time_log_file = self.logdir + "/time"
os.mkdir(time_log_file)
log_file = "%s/time_command_output_%s.log" % (
time_log_file, self.kernel_ver)
cmd = 'echo "Using command: %s >> %s" 2>&1' % ( | ||
self.user_command, log_file) | ||
process.run(cmd, ignore_status=True, sudo=True, shell=True) | ||
|
||
cmd = 'lscpu >> "%s" 2>&1' % (log_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test need not run lscpu
This should get captured by sysinfo utility
(preferably per-job)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, If we can collect other system level data such as lscpu
, mpstat -P ALL 1 1
, numactl -H
, uptime
etc. apart from all other static data that sysinfo utility already collects
Also as part of sysinfo utility's pre, create a backup /sys/kernel/debug/sched
of this directory.
@@ -100,15 +101,15 @@ def test_sched_scoreboard_setup(self): | |||
self.user_command, log_file) | |||
process.run(cmd, ignore_status=True, sudo=True, shell=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process.run(cmd, ignore_status=True, sudo=True, shell=True)
cmd = 'echo >> "%s" 2>&1' % (log_file)
process.run(cmd, ignore_status=True, sudo=True, shell=True)
# Execute the command and append the output to the log file
for i in range(self.repeat):
cmd = 'eval "$user_command" >> "%s" 2>&1' % (log_file)
process.run(cmd, ignore_status=True, sudo=True, shell=True)
cmd = 'echo >> "%s" 2>&1' % (log_file)
process.run(cmd, ignore_status=True, sudo=True, shell=True)
for i in range(self.repeat):
# Execute the command and append the output to the log file
cmd = '/usr/bin/time -v $(echo %s) >> "%s" 2>&1' % (
self.user_command, log_file)
process.run(cmd, ignore_status=True, sudo=True, shell=True)
Please refactor this part to separate test_*
methods as following:
- test_run_command: This method would run user_command one time
- test_run_command_with_profilers: This method would run user_command one time but with profilers enabled. (using sysinfo utility to run profilers per-test but for
test_run_command_with_profilers
only) - test_run_command_repeat: This method would run user_command
repeat
times
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- test_run_with_time_repeat: Will just be another test method to run the user_command through
time
command repeatedrepeat
times
self.user_command, log_file) | ||
process.run(cmd, ignore_status=True, sudo=True, shell=True) | ||
|
||
def test_strace_cmd(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/test_strace_cmd/test_run_with_strace_repeat/
for i in range(2): | ||
process.run(cmd, ignore_status=True, sudo=True, shell=True) | ||
|
||
def test_perf_stat_cmd(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/test_perf_stat_cmd/test_run_with_perf_stat_repeat/
self.repeat, self.user_command, log_file) | ||
process.run(cmd, ignore_status=True, sudo=True, shell=True) | ||
|
||
def test_sched_scoreboard_cmd(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/test_sched_scoreboard_cmd/test_run_with_sched_scoreboard/
log_file) | ||
process.run(cmd, ignore_status=True, sudo=True, shell=True) | ||
|
||
def test_trace_cmd(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/test_trace_cmd/test_run_with_trace_cmd/
@SamirMulani @vishalc-ibm any thing pending here , @SamirMulani even can you please squash both the commits in single commit |
In this automation below test cases are added, 1. Preparing the setup for sched_scoreboard github repo. 2. Run the workload command with starce command. 3. Run the workload command with perf stat command. 4. Run the workload command with trace command. Signed-off-by: Samir Mulani <samir@linux.vnet.ibm.com> Done automation for scheduler workflow. Addressed review comments, 1. Fixed typo error. 2. Moved sched_scoreboard repo setup into setUp() method Signed-off-by: Samir Mulani <samir@linux.vnet.ibm.com>
04ba52e
to
5526061
Compare
In this automation below test cases are added,