@@ -115,27 +115,16 @@ def run_remote_client_tool(
115
115
pkg_path = get_ann_remote_pkg_path (
116
116
client_public_ip , client_ssh_port , private_key , username
117
117
)
118
- benchmark_suffix = local_bench_fname [: len (local_bench_fname ) - 5 ]
119
- create_website_path = pkg_path + "/run/ann/pkg/"
120
- logging .info ("Remote create website path: {}" .format (create_website_path ))
121
- website_outputdir = "website-{}" .format (benchmark_suffix )
122
- website_outputdir_zip = "/tmp/website-{}.zip" .format (benchmark_suffix )
123
- website_outputdir_zip_local = "website-{}.zip" .format (benchmark_suffix )
124
- results_outputdir = pkg_path + "/run/ann/pkg"
125
- results_outputdir_zip = "/tmp/results-{}.zip" .format (benchmark_suffix )
126
- results_outputdir_zip_local = "results-{}.zip" .format (benchmark_suffix )
127
-
128
- mkdir_command = "mkdir -p /tmp/{}" .format (website_outputdir )
129
- create_website_command = "cd {} && sudo python3 create_website.py --scatter --outputdir /tmp/{}" .format (
130
- create_website_path , website_outputdir
131
- )
132
- zip_website_command = "cd /tmp && zip -r {} {}/*" .format (
133
- website_outputdir_zip , website_outputdir
134
- )
135
-
136
- zip_results_command = "cd {} && zip -r {} results/*" .format (
137
- results_outputdir , results_outputdir_zip
138
- )
118
+ (
119
+ create_website_command ,
120
+ mkdir_command ,
121
+ results_outputdir_zip ,
122
+ results_outputdir_zip_local ,
123
+ website_outputdir_zip ,
124
+ website_outputdir_zip_local ,
125
+ zip_results_command ,
126
+ zip_website_command ,
127
+ ) = ann_benchmark_remote_cmds (local_bench_fname , pkg_path )
139
128
post_commands .append (mkdir_command )
140
129
post_commands .append (create_website_command )
141
130
post_commands .append (zip_website_command )
@@ -261,6 +250,40 @@ def run_remote_client_tool(
261
250
)
262
251
263
252
253
+ def ann_benchmark_remote_cmds (local_bench_fname , pkg_path ):
254
+ benchmark_suffix = local_bench_fname [: len (local_bench_fname ) - 5 ]
255
+ create_website_path = pkg_path + "/run/ann/pkg/"
256
+ logging .info ("Remote create website path: {}" .format (create_website_path ))
257
+ website_outputdir = "website-{}" .format (benchmark_suffix )
258
+ website_outputdir_zip = "/tmp/website-{}.zip" .format (benchmark_suffix )
259
+ website_outputdir_zip_local = "website-{}.zip" .format (benchmark_suffix )
260
+ results_outputdir = pkg_path + "/run/ann/pkg"
261
+ results_outputdir_zip = "/tmp/results-{}.zip" .format (benchmark_suffix )
262
+ results_outputdir_zip_local = "results-{}.zip" .format (benchmark_suffix )
263
+ mkdir_command = "mkdir -p /tmp/{}" .format (website_outputdir )
264
+ create_website_command = (
265
+ "cd {} && sudo python3 create_website.py --scatter --outputdir /tmp/{}" .format (
266
+ create_website_path , website_outputdir
267
+ )
268
+ )
269
+ zip_website_command = "cd /tmp && zip -r {} {}/*" .format (
270
+ website_outputdir_zip , website_outputdir
271
+ )
272
+ zip_results_command = "cd {} && zip -r {} results/*" .format (
273
+ results_outputdir , results_outputdir_zip
274
+ )
275
+ return (
276
+ create_website_command ,
277
+ mkdir_command ,
278
+ results_outputdir_zip ,
279
+ results_outputdir_zip_local ,
280
+ website_outputdir_zip ,
281
+ website_outputdir_zip_local ,
282
+ zip_results_command ,
283
+ zip_website_command ,
284
+ )
285
+
286
+
264
287
def setup_remote_benchmark_ann (
265
288
client_public_ip , username , private_key , client_ssh_port
266
289
):
0 commit comments