Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix argparser and dry-run support in run_tests scripts
Browse files Browse the repository at this point in the history
gargnitingoogle committed Aug 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent f3f3d2f commit 6469044
Showing 2 changed files with 26 additions and 20 deletions.
21 changes: 13 additions & 8 deletions perfmetrics/scripts/testing_on_gke/examples/dlio/run_tests.py
Original file line number Diff line number Diff line change
@@ -18,11 +18,7 @@
"""This program takes in a json dlio test-config file and generates and deploys helm charts."""

import argparse
from collections.abc import Sequence
import os
import subprocess

from absl import app
import dlio_workload


@@ -60,18 +56,27 @@ def main(args) -> None:
helmInstallCommands = createHelmInstallCommands(dlioWorkloads)
for helmInstallCommand in helmInstallCommands:
print(f'{helmInstallCommand}')
run_command(helmInstallCommand)
if not args.dry_run:
run_command(helmInstallCommand)


if __name__ == '__main__':
parser = argparse.ArgumentParser(
prog='DLIO test runner',
prog='DLIO Unet3d test runner',
description=(
'This program takes in a json dlio test-config file and generates'
' helm install commands.'
' helm install commands to execute them using the active GKE cluster.'
),
# epilog='Text at the bottom of help',
)
parser.add_argument('--workload-config') # positional argument
parser.add_argument(
'-n',
'--dry-run',
action='store_true',
help=(
'Only print out the test configurations that will run,'
' not actually run them.'
),
)
args = parser.parse_args()
main(args)
25 changes: 13 additions & 12 deletions perfmetrics/scripts/testing_on_gke/examples/fio/run_tests.py
Original file line number Diff line number Diff line change
@@ -18,13 +18,7 @@
"""This program takes in a json fio test-config file and generates and deploys helm charts."""

import argparse
from collections.abc import Sequence
import json
import os
import pprint
import subprocess

from absl import app
import fio_workload


@@ -61,23 +55,30 @@ def main(args) -> None:
fioWorkloads = fio_workload.ParseTestConfigForFioWorkloads(
args.workload_config
)
# for fioWorkload in fioWorkloads:
# fioWorkload.PPrint()
helmInstallCommands = createHelmInstallCommands(fioWorkloads)
for helmInstallCommand in helmInstallCommands:
print(f'{helmInstallCommand}')
run_command(f'{helmInstallCommand}')
if not args.dry_run:
run_command(helmInstallCommand)


if __name__ == '__main__':
parser = argparse.ArgumentParser(
prog='FIO test runner',
description=(
'This program takes in a json fio test-config file and generates'
' helm install commands.'
'This program takes in a json test-config file and generates'
' helm install commands to execute them using the active GKE cluster.'
),
# epilog='Text at the bottom of help',
)
parser.add_argument('--workload-config')
parser.add_argument(
'-n',
'--dry-run',
action='store_true',
help=(
'Only print out the test configurations that will run,'
' not actually run them.'
),
)
args = parser.parse_args()
main(args)

0 comments on commit 6469044

Please sign in to comment.