Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SamirMulani
Copy link
Contributor

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.

scoreboard_setup_log_file = self.logdir + "/sched_scoreboard_setup"
os.mkdir(scoreboard_setup_log_file)

log_file = "%s/starce_command_output_%s.log" % (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/starce/sched_scoreboard/


def test_starce_cmd(self):
"""
Run the starce command

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/starce/strace/

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):
Copy link

@vishalc-ibm vishalc-ibm Nov 12, 2023

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.

Copy link

@vishalc-ibm vishalc-ibm Nov 12, 2023

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_

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):
Copy link

@vishalc-ibm vishalc-ibm Nov 29, 2023

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"
Copy link

@vishalc-ibm vishalc-ibm Nov 29, 2023

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)
Copy link

@vishalc-ibm vishalc-ibm Nov 29, 2023

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)

Copy link

@vishalc-ibm vishalc-ibm Nov 29, 2023

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)
Copy link

@vishalc-ibm vishalc-ibm Nov 29, 2023

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

Copy link

@vishalc-ibm vishalc-ibm Nov 29, 2023

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 repeated repeat times

self.user_command, log_file)
process.run(cmd, ignore_status=True, sudo=True, shell=True)

def test_strace_cmd(self):
Copy link

@vishalc-ibm vishalc-ibm Nov 29, 2023

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):
Copy link

@vishalc-ibm vishalc-ibm Nov 29, 2023

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):

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):

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/

@PraveenPenguin
Copy link
Member

@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 <[email protected]>

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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants