From c026a0641bc6f385a9bac334fc09380b3dde93c2 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Thu, 4 Mar 2021 13:47:40 -0500 Subject: [PATCH] test: start of ekf cleanup --- .../experiments/applications/ekf/.gitignore | 1 + .../experiments/applications/ekf/README.md | 3 + runtime/experiments/applications/ekf/debug.sh | 19 ++++++ .../experiments/applications/ekf/ekf_raw.dat | Bin 0 -> 5088 bytes .../experiments/applications/ekf/result.dat | Bin 0 -> 5088 bytes runtime/experiments/applications/ekf/run.sh | 62 ++++++++++++++++++ .../experiments/applications/ekf/spec.json | 14 ++++ 7 files changed, 99 insertions(+) create mode 100644 runtime/experiments/applications/ekf/.gitignore create mode 100644 runtime/experiments/applications/ekf/README.md create mode 100755 runtime/experiments/applications/ekf/debug.sh create mode 100644 runtime/experiments/applications/ekf/ekf_raw.dat create mode 100644 runtime/experiments/applications/ekf/result.dat create mode 100755 runtime/experiments/applications/ekf/run.sh create mode 100644 runtime/experiments/applications/ekf/spec.json diff --git a/runtime/experiments/applications/ekf/.gitignore b/runtime/experiments/applications/ekf/.gitignore new file mode 100644 index 0000000..f66ff46 --- /dev/null +++ b/runtime/experiments/applications/ekf/.gitignore @@ -0,0 +1 @@ +result.dat diff --git a/runtime/experiments/applications/ekf/README.md b/runtime/experiments/applications/ekf/README.md new file mode 100644 index 0000000..10c2652 --- /dev/null +++ b/runtime/experiments/applications/ekf/README.md @@ -0,0 +1,3 @@ +# EKF + +TODO diff --git a/runtime/experiments/applications/ekf/debug.sh b/runtime/experiments/applications/ekf/debug.sh new file mode 100755 index 0000000..a561392 --- /dev/null +++ b/runtime/experiments/applications/ekf/debug.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +project_directory=$(cd ../../.. && pwd) +binary_directory=$(cd "$project_directory"/bin && pwd) + +export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" +export PATH="$binary_directory:$PATH" + +gdb --eval-command="handle SIGUSR1 nostop" \ + --eval-command="handle SIGPIPE nostop" \ + --eval-command="set pagination off" \ + --eval-command="set substitute-path /sledge/runtime $project_directory" \ + --eval-command="run $experiment_directory/spec.json" \ + sledgert diff --git a/runtime/experiments/applications/ekf/ekf_raw.dat b/runtime/experiments/applications/ekf/ekf_raw.dat new file mode 100644 index 0000000000000000000000000000000000000000..9a960e1e986d6142e00a0c8c803f8c9463a7e541 GIT binary patch literal 5088 zcmeHLdpK3;8sBcYOtyMxbdeCE65>db?^{e;rExn&Ck#p2mFg(t64Tjc%Iprc-KNro z21f|F-?i3GB)5rjDcL30i5bordUle|F6&!+o;{g|F@Mf_9^Uo7-}`%i@B3SOee6$$ zMx#jze$Me{D5)%)EZN^ z^!WzhIu^!o2)qa4+#)Rdt(1tv+YZW{e>H?7TxF}Lo&F_rI7#AE_Pk8VmmI?(iAzrI zjZL+sE;z-t=X`E(-7tdo%t|W*-pcyF}uAR}IkCs+2# zz!Ev$MP^+W2q5QkBKr&``G!ecn1mQ>-|G#qBkHci53)wE!aNKU&(ncp7Tg%06fx*V z;!4T+Mo8RQk`Ljs-k!qL)gYux?EII>wUtmes$JPpW&*^LdLAWp=_luFA^W^d@+pwG zCC1KCs_q8xsf()fFZ-pT7x^4`q@H(4T}sLMej)o@Me_BKxSd@M8mzC>;m!2-ml_m& zlmwS9{9tDN3*k2YLA;RguYQDDeC+P}!+B;$XqGToDa*R+q#yWL&hNz#Zpxk}@s{xS zFv7JzKhN^r3itbW@4Cctz2R8Y2x2VQ*f$*|w9blj6!GVHIGiq|YZ6Tk3u99VrhH@ZZ+7*8dL z3$^8?_}%>Q!B(9l+{Z;>%_gf@06(7>Vz?*|A3D3RIcie@PTvyRnf8zi_QF$tq~In()xv=9dT8+&7(*?&m=M?|bp z@!8#>IL82av$Z22E$K&%{A-V?_n2D@ zx_@9i!BM4!X7x!&#Cj-yDlX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&18pH**V;yWsX8bh#S@f|nUtR82;Pet#~mp)1dXOyYPic$ zU;~Z3qU{7$r!TA*BR*rfP0m;M=8i|*yTxrjgekrmPfi^1#pqY`g4DZDaF;uon}kMh z!nQ1XWfgqx80N6<98tRWFgNr1cJrky56mq%TmM4!2`tOVbWrxREB3;Um#SID#Om>k wh6`J_8D?i<_PxZHd|xAD}w!*ap$L_`GWl!o!_BzJ9J+6f0vWbLjV8( literal 0 HcmV?d00001 diff --git a/runtime/experiments/applications/ekf/result.dat b/runtime/experiments/applications/ekf/result.dat new file mode 100644 index 0000000000000000000000000000000000000000..1229f11ef4c95e3f33a405927779bff326f70651 GIT binary patch literal 5088 zcmeHLc{o*T7eBW$3$cXKz^sgE2_* zx1V<+Up595t0$R8R$X-=CX4&pnnk3FD6fk!?rwQx!Uh3N#0LpWg zFSpq>f?8^87JY|TNlAH2F*2p@5v?<*XTvi$Qdc?>wckBDOc}t5J4!QBs4~G&@9tL@ zh`1;nZ}ZFLlwL_$Q~laolmXXg=y`4`)sPvkJ-Z>9@Kw%PS=(AlMaFWgtUQXTRv%N- zntiE6Pm^6iWk@;Uuu%N!V09Eh9h}pf(o#-%z7RN1o*6~RDOS}uYGx3gk$;K;uWcY4 zj=fxJbSDGpFYagi6#uzjxX#a^{+^BNVEgxsAB+4d9<$&&*y8xl+F!+EK3oS|9RFD> zCK8-D^5>Ht($}$S?_}u;t49>B#5}cYyWek3wEs2U$J@r(CCaL5rt!%Ko+M=(@o0Z+ z8F>3?ljys6uhn&jkEYhq`7&Lsw8>i6>HHPiwrUN@&uG6tzqx3BW3*}wy`EmCl)5^w ziuOJCJP)e2Z>IhJcsxIz1NYOvF4m*J#d_hnasU1M=#Rrb))(u9=lyoy7}ek6{rH~k zpWoldxc>1U^)VjXAH{ty?^o+!JhtEC`O)~V*1>pef0XxodB0i*G(h34*sK?$-xB@# zJPD83V+6_MECBi=?2CaK z3uqsxQE`<0K%7Q;?m@b=p!v3=K5G!40m4x=T3Zzg9e|>L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<9%KHES literal 0 HcmV?d00001 diff --git a/runtime/experiments/applications/ekf/run.sh b/runtime/experiments/applications/ekf/run.sh new file mode 100755 index 0000000..1feb93e --- /dev/null +++ b/runtime/experiments/applications/ekf/run.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +project_directory=$(cd ../../.. && pwd) +binary_directory=$(cd "$project_directory"/bin && pwd) + +# Copy data if not here +if [[ ! -f "./ekf_raw.dat" ]]; then + cp ../../../tests/TinyEKF/extras/c/ekf_raw.dat ./ekf_raw.dat +fi + +if [ "$1" != "-d" ]; then + PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" & + sleep 1 +else + echo "Running under gdb" +fi + +# expected_result="$(cat ./expected_result.jpg)" +# expected_size="$(find expected_result.jpg -printf "%s")" +success_count=0 +total_count=50 + +curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@ekf_raw.dat" --output "result.dat" localhost:10000 +# ab -c 1 -n 10000 -p ekf_raw.dat -T "application/octet-stream" + +# WIP +exit + +for ((i = 0; i < total_count; i++)); do + echo "$i" + ext="$RANDOM" + curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@flower.jpg" --output "result_$ext.jpg" localhost:10000 2>/dev/null + actual_size="$(find result_"$ext".jpg -printf "%s")" + + # echo "$result" + if [[ "$expected_size" == "$actual_size" ]]; then + success_count=$((success_count + 1)) + rm result.jpg + else + echo "FAIL" + echo "Expected Size:" + echo "$expected_size" + echo "===============================================" + echo "Actual Size:" + echo "$actual_size" + fi +done + +echo "$success_count / $total_count" + +if [ "$1" != "-d" ]; then + sleep 5 + echo -n "Running Cleanup: " + rm result_*.jpg + pkill sledgert >/dev/null 2>/dev/null + echo "[DONE]" +fi diff --git a/runtime/experiments/applications/ekf/spec.json b/runtime/experiments/applications/ekf/spec.json new file mode 100644 index 0000000..de317c7 --- /dev/null +++ b/runtime/experiments/applications/ekf/spec.json @@ -0,0 +1,14 @@ +{ + "active": "yes", + "name": "resize", + "path": "ekf_wasm.so", + "port": 10000, + "relative-deadline-us": 50000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "application/octet-stream", + "http-req-size": 1024000, + "http-resp-headers": [], + "http-resp-size": 1024000, + "http-resp-content-type": "application/octet-stream" +}