chore: update tests to handle stricter validation

main
Sean McBride 4 years ago
parent 86b1a274e9
commit 2ad7711884

@ -3,6 +3,7 @@
"name": "ekf_first_iter", "name": "ekf_first_iter",
"path": "ekf_wasm.so", "path": "ekf_wasm.so",
"port": 10000, "port": 10000,
"expected-execution-us": 5000,
"relative-deadline-us": 50000, "relative-deadline-us": 50000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
@ -17,6 +18,7 @@
"name": "ekf_second_iter", "name": "ekf_second_iter",
"path": "ekf_wasm.so", "path": "ekf_wasm.so",
"port": 10001, "port": 10001,
"expected-execution-us": 5000,
"relative-deadline-us": 50000, "relative-deadline-us": 50000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
@ -31,6 +33,7 @@
"name": "ekf_third_iter", "name": "ekf_third_iter",
"path": "ekf_wasm.so", "path": "ekf_wasm.so",
"port": 10002, "port": 10002,
"expected-execution-us": 5000,
"relative-deadline-us": 50000, "relative-deadline-us": 50000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],

@ -3,6 +3,7 @@
"name": "resize", "name": "resize",
"path": "ekf_wasm.so", "path": "ekf_wasm.so",
"port": 10000, "port": 10000,
"expected-execution-us": 5000,
"relative-deadline-us": 50000, "relative-deadline-us": 50000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],

@ -3,6 +3,7 @@
"name": "cifar10", "name": "cifar10",
"path": "cifar10_wasm.so", "path": "cifar10_wasm.so",
"port": 10000, "port": 10000,
"expected-execution-us": 5000,
"relative-deadline-us": 50000, "relative-deadline-us": 50000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],

@ -51,7 +51,7 @@ for ((i = 0; i < total_count; i++)); do
done done
echo "$success_count / $total_count" echo "$success_count / $total_count"
rm result_*.png rm -f result_*.png
if [ "$1" != "-d" ]; then if [ "$1" != "-d" ]; then
sleep 5 sleep 5

@ -3,6 +3,7 @@
"name": "resize_small", "name": "resize_small",
"path": "resize_wasm.so", "path": "resize_wasm.so",
"port": 10000, "port": 10000,
"expected-execution-us": 5000,
"relative-deadline-us": 50000, "relative-deadline-us": 50000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
@ -17,6 +18,7 @@
"name": "resize_medium", "name": "resize_medium",
"path": "resize_wasm.so", "path": "resize_wasm.so",
"port": 10001, "port": 10001,
"expected-execution-us": 5000,
"relative-deadline-us": 50000, "relative-deadline-us": 50000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
@ -31,6 +33,7 @@
"name": "resize_large", "name": "resize_large",
"path": "resize_wasm.so", "path": "resize_wasm.so",
"port": 10002, "port": 10002,
"expected-execution-us": 5000,
"relative-deadline-us": 50000, "relative-deadline-us": 50000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],

@ -3,6 +3,7 @@
"name": "resize", "name": "resize",
"path": "resize_wasm.so", "path": "resize_wasm.so",
"port": 10000, "port": 10000,
"expected-execution-us": 5000,
"relative-deadline-us": 50000, "relative-deadline-us": 50000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],

@ -5,7 +5,7 @@
# Also disables pagination and stopping on SIGUSR1 # Also disables pagination and stopping on SIGUSR1
experiment_directory=$(pwd) experiment_directory=$(pwd)
project_directory=$(cd ../../.. && pwd) project_directory=$(cd ../../../.. && pwd)
binary_directory=$(cd "$project_directory"/bin && pwd) binary_directory=$(cd "$project_directory"/bin && pwd)
export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH"

@ -3,6 +3,7 @@
"name": "lpd1", "name": "lpd1",
"path": "lpd_wasm.so", "path": "lpd_wasm.so",
"port": 10000, "port": 10000,
"expected-execution-us": 5000,
"relative-deadline-us": 50000, "relative-deadline-us": 50000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
@ -17,6 +18,7 @@
"name": "lpd2", "name": "lpd2",
"path": "lpd_wasm.so", "path": "lpd_wasm.so",
"port": 10001, "port": 10001,
"expected-execution-us": 5000,
"relative-deadline-us": 50000, "relative-deadline-us": 50000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
@ -31,6 +33,7 @@
"name": "lpd4", "name": "lpd4",
"path": "lpd_wasm.so", "path": "lpd_wasm.so",
"port": 10002, "port": 10002,
"expected-execution-us": 5000,
"relative-deadline-us": 50000, "relative-deadline-us": 50000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],

@ -3,7 +3,8 @@
"name": "gocr_72_dpi", "name": "gocr_72_dpi",
"path": "gocr_wasm.so", "path": "gocr_wasm.so",
"port": 10000, "port": 10000,
"relative-deadline-us": 50000000000, "expected-execution-us": 5000,
"relative-deadline-us": 36000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
"http-req-content-type": "text/plain", "http-req-content-type": "text/plain",
@ -17,7 +18,8 @@
"name": "gocr_108_dpi", "name": "gocr_108_dpi",
"path": "gocr_wasm.so", "path": "gocr_wasm.so",
"port": 10001, "port": 10001,
"relative-deadline-us": 50000000000, "expected-execution-us": 5000,
"relative-deadline-us": 36000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
"http-req-content-type": "text/plain", "http-req-content-type": "text/plain",
@ -31,7 +33,8 @@
"name": "gocr_144_dpi", "name": "gocr_144_dpi",
"path": "gocr_wasm.so", "path": "gocr_wasm.so",
"port": 10002, "port": 10002,
"relative-deadline-us": 50000000000, "expected-execution-us": 5000,
"relative-deadline-us": 36000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
"http-req-content-type": "text/plain", "http-req-content-type": "text/plain",

@ -1,9 +1,10 @@
({ {
"active": true, "active": true,
"name": "gocr_mono", "name": "gocr_mono",
"path": "gocr_wasm.so", "path": "gocr_wasm.so",
"port": 10000, "port": 10000,
"relative-deadline-us": 50000000000, "expected-execution-us": 5000,
"relative-deadline-us": 36000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
"http-req-content-type": "text/plain", "http-req-content-type": "text/plain",
@ -17,7 +18,8 @@
"name": "gocr_urw_gothic", "name": "gocr_urw_gothic",
"path": "gocr_wasm.so", "path": "gocr_wasm.so",
"port": 10001, "port": 10001,
"relative-deadline-us": 50000000000, "expected-execution-us": 5000,
"relative-deadline-us": 36000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
"http-req-content-type": "text/plain", "http-req-content-type": "text/plain",
@ -31,7 +33,8 @@
"name": "gocr_lobster_2", "name": "gocr_lobster_2",
"path": "gocr_wasm.so", "path": "gocr_wasm.so",
"port": 10002, "port": 10002,
"relative-deadline-us": 50000000000, "expected-execution-us": 5000,
"relative-deadline-us": 36000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
"http-req-content-type": "text/plain", "http-req-content-type": "text/plain",
@ -39,4 +42,4 @@
"http-resp-headers": [], "http-resp-headers": [],
"http-resp-size": 5335057, "http-resp-size": 5335057,
"http-resp-content-type": "text/plain" "http-resp-content-type": "text/plain"
}) }

@ -1,9 +1,10 @@
({ {
"active": true, "active": true,
"name": "gocr_1_word", "name": "gocr_1_word",
"path": "gocr_wasm.so", "path": "gocr_wasm.so",
"port": 10000, "port": 10000,
"relative-deadline-us": 50000000000, "expected-execution-us": 5000,
"relative-deadline-us": 36000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
"http-req-content-type": "text/plain", "http-req-content-type": "text/plain",
@ -17,7 +18,8 @@
"name": "gocr_10_words", "name": "gocr_10_words",
"path": "gocr_wasm.so", "path": "gocr_wasm.so",
"port": 10001, "port": 10001,
"relative-deadline-us": 50000000000, "expected-execution-us": 5000,
"relative-deadline-us": 36000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
"http-req-content-type": "text/plain", "http-req-content-type": "text/plain",
@ -31,7 +33,8 @@
"name": "gocr_100_words", "name": "gocr_100_words",
"path": "gocr_wasm.so", "path": "gocr_wasm.so",
"port": 10002, "port": 10002,
"relative-deadline-us": 50000000000, "expected-execution-us": 5000,
"relative-deadline-us": 36000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
"http-req-content-type": "text/plain", "http-req-content-type": "text/plain",
@ -39,4 +42,4 @@
"http-resp-headers": [], "http-resp-headers": [],
"http-resp-size": 5335057, "http-resp-size": 5335057,
"http-resp-content-type": "text/plain" "http-resp-content-type": "text/plain"
}) }

@ -3,8 +3,8 @@
"name": "gocr", "name": "gocr",
"path": "gocr_wasm.so", "path": "gocr_wasm.so",
"port": 10000, "port": 10000,
"relative-deadline-us": 500000000, "expected-execution-us": 5000,
"expected-execution-us": 5000000, "relative-deadline-us": 36000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
"http-req-content-type": "text/plain", "http-req-content-type": "text/plain",

@ -3,7 +3,8 @@
"name": "gocr", "name": "gocr",
"path": "gocr_wasm.so", "path": "gocr_wasm.so",
"port": 10000, "port": 10000,
"relative-deadline-us": 50000000000, "expected-execution-us": 5000,
"relative-deadline-us": 36000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
"http-req-content-type": "text/plain", "http-req-content-type": "text/plain",

@ -3,7 +3,8 @@
"name": "gocr", "name": "gocr",
"path": "gocr_wasm.so", "path": "gocr_wasm.so",
"port": 10000, "port": 10000,
"relative-deadline-us": 50000000000, "expected-execution-us": 5000,
"relative-deadline-us": 360000,
"argsize": 1, "argsize": 1,
"http-req-headers": [], "http-req-headers": [],
"http-req-content-type": "text/plain", "http-req-content-type": "text/plain",

@ -488,8 +488,11 @@ module_new_from_json(char *file_name)
} }
i += ntoks; i += ntoks;
/* Validate presence of required fields */ /* If the ratio is too big, admissions control is too coarse */
uint32_t ratio = relative_deadline_us / expected_execution_us;
if (ratio > 1000000) panic("Ratio of Deadline to Execution time cannot exceed 1000000");
/* Validate presence of required fields */
if (strlen(module_name) == 0) panic("name field is required\n"); if (strlen(module_name) == 0) panic("name field is required\n");
if (strlen(module_path) == 0) panic("path field is required\n"); if (strlen(module_path) == 0) panic("path field is required\n");
if (port == 0) panic("port field is required\n"); if (port == 0) panic("port field is required\n");

Loading…
Cancel
Save