From 97cd4a8f0c939d9c8b48b5547cc12010c298133a Mon Sep 17 00:00:00 2001 From: Nitin Garg Date: Wed, 7 Aug 2024 15:34:18 +0000 Subject: [PATCH] address self-review comments --- .../testing_on_gke/examples/dlio/run_tests.py | 21 ++++++++++++++----- .../testing_on_gke/examples/fio/run_tests.py | 19 +++++++++++++---- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/perfmetrics/scripts/testing_on_gke/examples/dlio/run_tests.py b/perfmetrics/scripts/testing_on_gke/examples/dlio/run_tests.py index a2a2354e93..0a95ff387c 100644 --- a/perfmetrics/scripts/testing_on_gke/examples/dlio/run_tests.py +++ b/perfmetrics/scripts/testing_on_gke/examples/dlio/run_tests.py @@ -15,7 +15,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""This program takes in a json dlio test-config file and generates and deploys helm charts.""" +"""This program takes in a json test-config file, finds out valid + +DLIO workloads from it and generates and deploys a helm chart for +each DLIO workload. +""" import argparse import subprocess @@ -23,12 +27,14 @@ def run_command(command: str): + """Runs the given string command as a subprocess.""" result = subprocess.run(command.split(' '), capture_output=True, text=True) print(result.stdout) print(result.stderr) -def createHelmInstallCommands(dlioWorkloads): +def createHelmInstallCommands(dlioWorkloads: set): + """Create helm install commands for the given set of dlioWorkload objects.""" helm_commands = [] for dlioWorkload in dlioWorkloads: for batchSize in dlioWorkload.batchSizes: @@ -64,11 +70,16 @@ def main(args) -> None: parser = argparse.ArgumentParser( prog='DLIO Unet3d test runner', description=( - 'This program takes in a json dlio test-config file and generates' - ' helm install commands to execute them using the active GKE cluster.' + 'This program takes in a json test-config file, finds out valid DLIO' + ' workloads from it and generates and deploys a helm chart for each' + ' DLIO workload.' ), ) - parser.add_argument('--workload-config') # positional argument + parser.add_argument( + '--workload-config', + help='Runs DLIO Unet3d tests using this JSON workload configuration.', + required=True, + ) parser.add_argument( '-n', '--dry-run', diff --git a/perfmetrics/scripts/testing_on_gke/examples/fio/run_tests.py b/perfmetrics/scripts/testing_on_gke/examples/fio/run_tests.py index 920526a050..739b902b74 100644 --- a/perfmetrics/scripts/testing_on_gke/examples/fio/run_tests.py +++ b/perfmetrics/scripts/testing_on_gke/examples/fio/run_tests.py @@ -15,7 +15,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""This program takes in a json fio test-config file and generates and deploys helm charts.""" +"""This program takes in a json test-config file, finds out valid FIO + +workloads from it and generates and deploys a helm chart for each FIO +workload. +""" import argparse import subprocess @@ -23,12 +27,14 @@ def run_command(command: str): + """Runs the given string command as a subprocess.""" result = subprocess.run(command.split(' '), capture_output=True, text=True) print(result.stdout) print(result.stderr) def createHelmInstallCommands(fioWorkloads): + """Create helm install commands for the given set of fioWorkload objects.""" helm_commands = [] for fioWorkload in fioWorkloads: for readType in fioWorkload.readTypes: @@ -66,11 +72,16 @@ def main(args) -> None: parser = argparse.ArgumentParser( prog='FIO test runner', description=( - 'This program takes in a json test-config file and generates' - ' helm install commands to execute them using the active GKE cluster.' + 'This program takes in a json test-config file, finds out valid FIO' + ' workloads from it and generates and deploys a helm chart for each' + ' FIO workload.' ), ) - parser.add_argument('--workload-config') + parser.add_argument( + '--workload-config', + help='Runs FIO tests using this JSON workload configuration', + required=True, + ) parser.add_argument( '-n', '--dry-run',