Commit c3f36957 authored by Florian Fischer's avatar Florian Fischer
Browse files

eval.py: ensure that the data directory is present on the host

parent 792af5ce
Pipeline #73072 passed with stage
in 2 minutes and 15 seconds
......@@ -62,10 +62,18 @@ def write_desc(data_dir):
# collect the uname of the host
print('uname_host: ', end='', file=desc_file)
# collect the uname of the host
if REMOTE_CMD:
# collect the uname of the host
remote_cmd = REMOTE_CMD.format(host=HOST, ssh_port=SSH_PORT)
uname_cmd = f'{remote_cmd} uname -a >> {desc_file_path}'
cmd_run(uname_cmd, log)
def mkdir_remote(directory: Path):
"""Create a directory and its parents on the remote host"""
remote_cmd = REMOTE_CMD.format(host=HOST, ssh_port=SSH_PORT)
uname_cmd = f'{remote_cmd} uname -a >> {desc_file_path}'
cmd_run(uname_cmd, log)
remote_prepare_cmd = f'{remote_cmd} mkdir -p {directory}'
cmd_run(remote_prepare_cmd, log)
def summarize(results: Mapping[str, Sequence[Sequence[BenchResult]]]):
......@@ -117,11 +125,11 @@ def bench(server_cmds) -> EvalResult:
if REMOTE_CMD:
# make sure the benchdir is available on the HOST
remote_cmd = REMOTE_CMD.format(host=HOST, ssh_port=SSH_PORT)
remote_prepare_cmd = f'{remote_cmd} mkdir -p {bench_dir}'
cmd_run(remote_prepare_cmd, log)
mkdir_remote(bench_dir)
measure_cmd = MEASURE_CMD.format(**substitutions)
remote_cmd = None if not REMOTE_CMD else REMOTE_CMD.format(
host=HOST, ssh_port=SSH_PORT)
print(f'benchmarking {server_name} ...')
server = Server(server_name,
......@@ -130,7 +138,7 @@ def bench(server_cmds) -> EvalResult:
bench_dir,
env=SERVER_ENV,
measure_cmd=measure_cmd,
remote_cmd=remote_cmd if REMOTE_CMD else None,
remote_cmd=remote_cmd,
host=HOST,
perf_record=args.perf_record,
perf_counters=args.perf_stat)
......@@ -344,6 +352,10 @@ if __name__ == '__main__':
if not DATA_DIR.exists():
os.makedirs(DATA_DIR)
if REMOTE_CMD:
# make sure the data_dir is available on the HOST
mkdir_remote(DATA_DIR)
print(f"data_dir: {DATA_DIR}")
write_desc(DATA_DIR)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment