fixed make of libsledge (add flto support)

added DNDEBUG to the clang compilations to remove assertions
refactor the cmu-sod test client requests
added fibonacci app to cmu-sod
master
emil 2 years ago
parent 50fd8c4853
commit 5f86707403

@ -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

@ -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

@ -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"

@ -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()

@ -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",

Loading…
Cancel
Save