Skip to content

Commit

Permalink
address self-review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gargnitingoogle committed Aug 9, 2024
1 parent 4a267f6 commit 97cd4a8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
21 changes: 16 additions & 5 deletions perfmetrics/scripts/testing_on_gke/examples/dlio/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,26 @@
# 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
import dlio_workload


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:
Expand Down Expand Up @@ -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',
Expand Down
19 changes: 15 additions & 4 deletions perfmetrics/scripts/testing_on_gke/examples/fio/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,26 @@
# 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
import fio_workload


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:
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 97cd4a8

Please sign in to comment.