Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
Qing Lan committed May 15, 2024
1 parent a7ce3cd commit 51c41bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tests/integration/instant_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,16 @@ def build_running_script(template, job, instance, record):
job_template['requirements'], job_template['env'])
container = job_template['container']

benchmark_command = []
benchmark_command = ['set -x']
record_benchmark = ('python3 record_benchmark.py --template template.json '
f'--job {job} --instance {instance} '
f'--model models/test --record {record}')

for key, value in job_template['awscurl'].items():
benchmark_command.append("rm -rf benchmark_result.json benchmark.log")
benchmark_command.append(value)
benchmark_command.append(record_benchmark + f' --benchmark-vars "{key}"')
benchmark_command.append(record_benchmark +
f' --benchmark-vars "{key}"')

bash_command = [
'set -euo pipefail',
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/record_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ def data_basic(data: dict):
def data_from_client(data: dict):
if os.path.exists("benchmark_result.json"):
with open("benchmark_result.json", "r") as f:
data.update(json.load(f))
benchmark_metrics = json.load(f)
data.update(benchmark_metrics)
print(f"found awscurl metrics json: {benchmark_metrics}")
elif os.path.exists("benchmark.log"):
with open("benchmark.log", "r") as f:
for line in f.readlines():
Expand Down

0 comments on commit 51c41bd

Please sign in to comment.