From 42b42e0f1c6bbbd326e5eedfdd85eb968309d623 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Tue, 26 Apr 2022 12:34:33 -0400 Subject: [PATCH] test: imageclassification tenant --- tests/CMSIS_5_NN/imageclassification/Makefile | 20 +++++----- tests/CMSIS_5_NN/imageclassification/run.sh | 12 +++--- .../CMSIS_5_NN/imageclassification/spec.json | 40 ++++++++++--------- 3 files changed, 38 insertions(+), 34 deletions(-) diff --git a/tests/CMSIS_5_NN/imageclassification/Makefile b/tests/CMSIS_5_NN/imageclassification/Makefile index 4ea2393..e24a8fa 100644 --- a/tests/CMSIS_5_NN/imageclassification/Makefile +++ b/tests/CMSIS_5_NN/imageclassification/Makefile @@ -14,13 +14,13 @@ debug: .PHONY: client client: - @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/airplane1.bmp" "localhost:10000" - @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/automobile1.bmp" "localhost:10000" - @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/bird1.bmp" "localhost:10000" - @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/cat1.bmp" "localhost:10000" - @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/deer1.bmp" "localhost:10000" - @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/dog1.bmp" "localhost:10000" - @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/frog1.bmp" "localhost:10000" - @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/horse1.bmp" "localhost:10000" - @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/ship1.bmp" "localhost:10000" - @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/truck1.bmp" "localhost:10000" + @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/airplane1.bmp" "localhost:10000/random" + @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/automobile1.bmp" "localhost:10000/random" + @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/bird1.bmp" "localhost:10000/random" + @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/cat1.bmp" "localhost:10000/random" + @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/deer1.bmp" "localhost:10000/random" + @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/dog1.bmp" "localhost:10000/random" + @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/frog1.bmp" "localhost:10000/random" + @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/horse1.bmp" "localhost:10000/random" + @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/ship1.bmp" "localhost:10000/random" + @curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@../../../applications/wasm_apps/CMSIS_5_NN/images/bmp/truck1.bmp" "localhost:10000/random" diff --git a/tests/CMSIS_5_NN/imageclassification/run.sh b/tests/CMSIS_5_NN/imageclassification/run.sh index 4dc22b4..fd07a60 100755 --- a/tests/CMSIS_5_NN/imageclassification/run.sh +++ b/tests/CMSIS_5_NN/imageclassification/run.sh @@ -28,11 +28,11 @@ run_functional_tests() { # Functional Testing on each image for image in "${cifar10_images[@]}"; do echo "${image}" >> "${results_directory}/cifar10_rand.txt" - curl --data-binary "@${image}" -s "${hostname}:10000" >> "${results_directory}/cifar10_rand.txt" + curl --data-binary "@${image}" -s "${hostname}:10000/rand" >> "${results_directory}/cifar10_rand.txt" done echo "$same_image" >> "${results_directory}/cifar10_same.txt" - curl --data-binary "@$same_image" -s "${hostname}:10001" >> "${results_directory}/cifar10_same.txt" + curl --data-binary "@$same_image" -s "${hostname}:10000/same" >> "${results_directory}/cifar10_same.txt" printf "[OK]\n" } @@ -63,7 +63,7 @@ run_perf_tests() { else image=$same_image fi - hey -disable-compression -disable-keepalive -disable-redirects -n $batch_size -c 1 -cpus 1 -t 0 -o csv -m GET -D "${image}" "http://${hostname}:${port[$workload]}" > "$results_directory/${workload}_${batch_id}.csv" 2> /dev/null & + hey -disable-compression -disable-keepalive -disable-redirects -n $batch_size -c 1 -cpus 1 -t 0 -o csv -m GET -D "${image}" "http://${hostname}:10000${route[$workload]}" > "$results_directory/${workload}_${batch_id}.csv" 2> /dev/null & done pids=$(pgrep hey | tr '\n' ' ') [[ -n $pids ]] && wait -f $pids @@ -127,9 +127,9 @@ experiment_client() { validate_dependencies curl declare -ar workloads=(cifar10_rand cifar10_same) -declare -Ar port=( - [cifar10_rand]=10000 - [cifar10_same]=10001 +declare -Ar route=( + [cifar10_rand]=/rand + [cifar10_same]=/same ) # Sort the images by the number of labeled plates diff --git a/tests/CMSIS_5_NN/imageclassification/spec.json b/tests/CMSIS_5_NN/imageclassification/spec.json index e8f4a3e..4230b46 100644 --- a/tests/CMSIS_5_NN/imageclassification/spec.json +++ b/tests/CMSIS_5_NN/imageclassification/spec.json @@ -1,22 +1,26 @@ [ { - "name": "cifar10_rand", - "path": "cifar10.wasm.so", + "name": "gwu", "port": 10000, - "expected-execution-us": 5000, - "relative-deadline-us": 50000, - "http-req-size": 4096, - "http-resp-size": 128, - "http-resp-content-type": "text/plain" - }, - { - "name": "cifar10_same", - "path": "cifar10.wasm.so", - "port": 10001, - "expected-execution-us": 5000, - "relative-deadline-us": 50000, - "http-req-size": 4096, - "http-resp-size": 128, - "http-resp-content-type": "text/plain" + "routes": [ + { + "route": "/rand", + "path": "cifar10.wasm.so", + "expected-execution-us": 5000, + "relative-deadline-us": 50000, + "http-req-size": 4096, + "http-resp-size": 128, + "http-resp-content-type": "text/plain" + }, + { + "route": "/same", + "path": "cifar10.wasm.so", + "expected-execution-us": 5000, + "relative-deadline-us": 50000, + "http-req-size": 4096, + "http-resp-size": 128, + "http-resp-content-type": "text/plain" + } + ] } -] +] \ No newline at end of file