diff --git a/applications/Makefile b/applications/Makefile index 332a346..1ec969c 100644 --- a/applications/Makefile +++ b/applications/Makefile @@ -11,6 +11,9 @@ CFLAGS=-O3 -flto LDFLAGS=-shared -fPIC -Wl,--export-dynamic,--whole-archive -L../libsledge/dist/ -lsledge -Wl,--no-whole-archive # LDFLAGS=-flto -fvisibility=hidden +# Strips out calls to assert() and disables debuglog +CFLAGS+=-DNDEBUG + dist: mkdir -p dist diff --git a/libsledge/Makefile b/libsledge/Makefile index 84c3085..23128b7 100644 --- a/libsledge/Makefile +++ b/libsledge/Makefile @@ -1,7 +1,10 @@ CFILES := src/*.c INCLUDES := -Iinclude/ -CFLAGS := -fPIC -O3 +CFLAGS := -fPIC -O3 -flto + +# Strips out calls to assert() and disables debuglog +CFLAGS+=-DNDEBUG # CFI Sanitizer # CFLAGS+=-fvisibility=default -fsanitize=cfi diff --git a/tests/cmu-sod/Makefile b/tests/cmu-sod/Makefile index a0ca4b5..b212664 100644 --- a/tests/cmu-sod/Makefile +++ b/tests/cmu-sod/Makefile @@ -1,5 +1,6 @@ SLEDGE_BINARY_DIR=../../runtime/bin HOSTNAME=localhost +PORT=10000 default: run @@ -7,14 +8,23 @@ clean: rm -rf res/* run: - LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json + SLEDGE_SANDBOX_PERF_LOG=perf.log LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json debug: - SLEDGE_DISABLE_PREEMPTION=true SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json" + SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json" valgrind: SLEDGE_DISABLE_PREEMPTION=true SLEDGE_NWORKERS=1 LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} valgrind --leak-check=full --max-stackframe=11150456 --run-libc-freeres=no --run-cxx-freeres=no ${SLEDGE_BINARY_DIR}/sledgert spec.json .PHONY: client client: - cat ./0_depth.png | http "${HOSTNAME}:10000/depth_to_xyz" > ./out.png + cat ./0_depth.png | http "${HOSTNAME}:${PORT}/depth_to_xyz" > ./out.png + +client-cloudlab: + cat ./0_depth.png | http "c220g2-011017.wisc.cloudlab.us:${PORT}/depth_to_xyz" > ./out.png + +client-cmu: + cat ./0_depth.png | http "arena0.andrew.cmu.edu:${PORT}/depth_to_xyz" > ./out.png + +multi: + hey -n 180 -c 180 -t 0 -o csv -m POST -D "./0_depth.png" "http://${HOSTNAME}:${PORT}/depth_to_xyz" diff --git a/tests/cmu-sod/edward.py b/tests/cmu-sod/edward.py new file mode 100644 index 0000000..c36f135 --- /dev/null +++ b/tests/cmu-sod/edward.py @@ -0,0 +1,32 @@ +# import numpy as np +import requests +import threading +import time + +from flask import Flask, Response + +url = 'http://arena0.andrew.cmu.edu:10000/depth_to_xyz' + +# app = Flask(__name__) + +img = None + +def get_img(): + global img + while True: + print("start") + try: + payload = open('0_depth.png', 'rb') + response = requests.post(url, data=payload) + img = response.content + print("got img") + time.sleep(0.01) + except: + print("failed") + time.sleep(5) + +thread = threading.Thread(target=get_img) +thread.daemon = True +thread.start() + + diff --git a/tests/cmu-sod/spec.json b/tests/cmu-sod/spec.json index 146edbe..dfa5432 100644 --- a/tests/cmu-sod/spec.json +++ b/tests/cmu-sod/spec.json @@ -5,6 +5,14 @@ "replenishment-period-us": 0, "max-budget-us": 0, "routes": [ + { + "route": "/fib", + "path": "fibonacci.wasm.so", + "admissions-percentile": 50, + "expected-execution-us": 6000, + "relative-deadline-us": 20000, + "http-resp-content-type": "text/plain" + }, { "route": "/depth_to_xyz", "path": "depth_to_xyz.wasm.so",