@ -1 +0,0 @@
|
||||
flower.jpg
|
@ -0,0 +1 @@
|
||||
result_*.png
|
After Width: | Height: | Size: 158 KiB |
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 93 KiB |
After Width: | Height: | Size: 29 KiB |
@ -0,0 +1,70 @@
|
||||
#!/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 Flower Image if not here
|
||||
if [[ ! -f "./flower.jpg" ]]; then
|
||||
cp ../../../../tests/sod/bin/flower.jpg ./flower.jpg
|
||||
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
|
||||
|
||||
success_count=0
|
||||
total_count=10
|
||||
|
||||
for ((i = 0; i < total_count; i++)); do
|
||||
echo "$i"
|
||||
ext="$RANDOM"
|
||||
|
||||
curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_small.jpg" --output "result_${ext}_small.png" localhost:10000 2>/dev/null 1>/dev/null
|
||||
pixel_differences="$(compare -identify -metric AE "result_${ext}_small.png" expected_result.png null: 2>&1 >/dev/null)"
|
||||
if [[ "$pixel_differences" == "0" ]]; then
|
||||
success_count=$((success_count + 1))
|
||||
else
|
||||
echo "Small FAIL"
|
||||
echo "$pixel_differences pixel differences detected"
|
||||
exit
|
||||
fi
|
||||
|
||||
curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_medium.jpg" --output "result_${ext}_medium.png" localhost:10001 2>/dev/null 1>/dev/null
|
||||
pixel_differences="$(compare -identify -metric AE "result_${ext}_medium.png" expected_result.png null: 2>&1 >/dev/null)"
|
||||
if [[ "$pixel_differences" == "0" ]]; then
|
||||
success_count=$((success_count + 1))
|
||||
else
|
||||
echo "Medium FAIL"
|
||||
echo "$pixel_differences pixel differences detected"
|
||||
exit
|
||||
fi
|
||||
|
||||
curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_large.jpg" --output "result_${ext}_large.png" localhost:10002 2>/dev/null 1>/dev/null
|
||||
pixel_differences="$(compare -identify -metric AE "result_${ext}_large.png" expected_result.png null: 2>&1 >/dev/null)"
|
||||
|
||||
if [[ "$pixel_differences" == "0" ]]; then
|
||||
success_count=$((success_count + 1))
|
||||
else
|
||||
echo "Large FAIL"
|
||||
echo "$pixel_differences pixel differences detected"
|
||||
exit
|
||||
fi
|
||||
done
|
||||
|
||||
echo "$success_count / $total_count"
|
||||
rm result_*.png
|
||||
|
||||
if [ "$1" != "-d" ]; then
|
||||
sleep 5
|
||||
echo -n "Running Cleanup: "
|
||||
pkill sledgert >/dev/null 2>/dev/null
|
||||
echo "[DONE]"
|
||||
fi
|
After Width: | Height: | Size: 358 KiB |
After Width: | Height: | Size: 381 KiB |
After Width: | Height: | Size: 100 KiB |
@ -0,0 +1,42 @@
|
||||
{
|
||||
"active": "yes",
|
||||
"name": "resize_small",
|
||||
"path": "resize_wasm.so",
|
||||
"port": 10000,
|
||||
"relative-deadline-us": 50000,
|
||||
"argsize": 1,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "image/jpeg",
|
||||
"http-req-size": 1024000,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 1024000,
|
||||
"http-resp-content-type": "image/png"
|
||||
}
|
||||
{
|
||||
"active": "yes",
|
||||
"name": "resize_medium",
|
||||
"path": "resize_wasm.so",
|
||||
"port": 10001,
|
||||
"relative-deadline-us": 50000,
|
||||
"argsize": 1,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "image/jpeg",
|
||||
"http-req-size": 1024000,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 1024000,
|
||||
"http-resp-content-type": "image/png"
|
||||
}
|
||||
{
|
||||
"active": "yes",
|
||||
"name": "resize_large",
|
||||
"path": "resize_wasm.so",
|
||||
"port": 10002,
|
||||
"relative-deadline-us": 50000,
|
||||
"argsize": 1,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "image/jpeg",
|
||||
"http-req-size": 1024000,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 1024000,
|
||||
"http-resp-content-type": "image/png"
|
||||
}
|
@ -0,0 +1 @@
|
||||
result_*.png
|
@ -0,0 +1,17 @@
|
||||
# Resize
|
||||
|
||||
Resizes Images
|
||||
|
||||
It appears that the initial request cuts off the bottom of the image. Thereafter, it seems that the runtime crashes out due to a socket error.
|
||||
|
||||
```
|
||||
write: Bad file descriptor
|
||||
C: 07, T: 0x7f20eed26700, F: current_sandbox_main>
|
||||
Unable to build and send client response
|
||||
|
||||
C: 07, T: 0x7f20eed26700, F: client_socket_send>
|
||||
Error sending to client: Bad file descriptor
|
||||
C: 07, T: 0x7f20eed26700, F: sandbox_close_http> PANIC!
|
||||
Bad file descriptor
|
||||
find: 'result_13192.jpg': No such file or directory
|
||||
```
|
@ -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
|
After Width: | Height: | Size: 93 KiB |
After Width: | Height: | Size: 29 KiB |