chore: first rename pass

main
Sean McBride 4 years ago
parent 4b107f3033
commit bd78bccb38

20
.gitmodules vendored

@ -1,13 +1,13 @@
[submodule "silverfish"] [submodule "awsm"]
path = silverfish path = awsm
url = https://github.com/gparmer/silverfish.git url = https://github.com/gwsystems/aWsm
ignore = dirty ignore = dirty
[submodule "runtime/thirdparty/http-parser"] [submodule "runtime/thirdparty/http-parser"]
path = runtime/thirdparty/http-parser path = runtime/thirdparty/http-parser
url = https://github.com/gwsystems/http-parser.git url = https://github.com/gwsystems/http-parser.git
[submodule "runtime/thirdparty/jsmn"] [submodule "runtime/thirdparty/jsmn"]
path = runtime/thirdparty/jsmn path = runtime/thirdparty/jsmn
url = https://github.com/gwsystems/jsmn.git url = https://github.com/gwsystems/jsmn.git
[submodule "runtime/thirdparty/ck"] [submodule "runtime/thirdparty/ck"]
path = runtime/thirdparty/ck path = runtime/thirdparty/ck
url = https://github.com/gwsystems/ck.git url = https://github.com/gwsystems/ck.git

@ -4,8 +4,8 @@
FROM ubuntu:bionic FROM ubuntu:bionic
# install some basic packages # install some basic packages
RUN apt-get update \ RUN apt-get update &&
&& apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
build-essential \ build-essential \
curl \ curl \
git \ git \
@ -38,8 +38,8 @@ RUN apt-get update \
libtool \ libtool \
strace \ strace \
less \ less \
libuv1-dev \ libuv1-dev &&
&& rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# set to use our installed clang version # set to use our installed clang version
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 100 RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 100
@ -48,7 +48,7 @@ RUN update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm
# set LD_LIBRARY_PATH # set LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=/usr/local/lib ENV LD_LIBRARY_PATH=/usr/local/lib
RUN curl https://sh.rustup.rs -sSf | \ RUN curl https://sh.rustup.rs -sSf |
sh -s -- --default-toolchain stable -y sh -s -- --default-toolchain stable -y
ENV PATH=/root/.cargo/bin:$PATH ENV PATH=/root/.cargo/bin:$PATH
@ -57,5 +57,4 @@ RUN rustup target add wasm32-wasi
RUN cargo install --debug cargo-audit cargo-watch rsign2 RUN cargo install --debug cargo-audit cargo-watch rsign2
ENV PATH=/opt/awsm/bin:$PATH ENV PATH=/opt/sledge/bin:$PATH

@ -61,5 +61,5 @@ RUN curl -sS -L -O https://github.com/CraneStation/wasi-sdk/releases/download/wa
&& dpkg -i wasi-sdk_7.0_amd64.deb && rm -f wasi-sdk_7.0_amd64.deb && dpkg -i wasi-sdk_7.0_amd64.deb && rm -f wasi-sdk_7.0_amd64.deb
ENV WASI_SDK=/opt/wasi-sdk ENV WASI_SDK=/opt/wasi-sdk
ENV PATH=/opt/awsm/bin:$PATH ENV PATH=/opt/sledge/bin:$PATH

@ -290,7 +290,7 @@ to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found. the "copyright" line and a pointer to where the full notice is found.
aWsm Serverless Framework SLEdge Serverless Framework
Copyright (C) 2019 ARM Ltd Copyright (C) 2019 ARM Ltd
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify

@ -1,31 +1,31 @@
SFCC='silverfish' COMPILER='awsm'
ROOT=${ROOT:-$(cd "$(dirname ${BASH_SOURCE:-$0})" && pwd)} ROOT=${ROOT:-$(cd "$(dirname ${BASH_SOURCE:-$0})" && pwd)}
.PHONY: build .PHONY: build
build: build:
@echo "Building wasmception toolchain, takes a while." @echo "Building wasmception toolchain, takes a while."
@cd ${SFCC} && make -C wasmception && cd ${ROOT} @cd ${COMPILER} && make -C wasmception && cd ${ROOT}
@echo "Building silverfish compiler (release)" @echo "Building aWsm compiler (release)"
@cd ${SFCC} && cargo build --release && cd ${ROOT} @cd ${COMPILER} && cargo build --release && cd ${ROOT}
.PHONY: build-dev .PHONY: build-dev
build-dev: build-dev:
@echo "Building wasmception toolchain, takes a while." @echo "Building wasmception toolchain, takes a while."
@cd ${SFCC} && make -C wasmception && cd ${ROOT} @cd ${COMPILER} && make -C wasmception && cd ${ROOT}
@echo "Building silverfish compiler (default==debug)" @echo "Building aWsm compiler (default==debug)"
@cd ${SFCC} && cargo build && cd ${ROOT} @cd ${COMPILER} && cargo build && cd ${ROOT}
.PHONY: clean .PHONY: clean
clean: clean:
@echo "Cleaning silverfish compiler" @echo "Cleaning aWsm compiler"
@cd ${SFCC} && cargo clean && cd ${ROOT} @cd ${COMPILER} && cargo clean && cd ${ROOT}
# wasmception is too slow to recompile, # wasmception is too slow to recompile,
# so lets not make that part of the "silverfish" cleanup # so lets not make that part of the "aWsm" cleanup
.PHONY: wclean .PHONY: wclean
wclean: wclean:
@echo "Cleaning wasmception toolchain" @echo "Cleaning wasmception toolchain"
@cd ${SFCC} && make -C wasmception clean && cd ${ROOT} @cd ${COMPILER} && make -C wasmception clean && cd ${ROOT}
.PHONY: rtinit .PHONY: rtinit
rtinit: rtinit:

@ -1,6 +1,6 @@
# aWsm (awesome) # SLEdge
**aWsm** is an efficient serverless runtime built with the `silverfish` compiler. It combines WebAssembly sandboxing with asynchronous I/O to provide a lightweight serverless solution suitable for edge computing. **SLEdge** is a lightweight serverless solution suitable for edge computing. It combines WebAssembly sandboxing provided by the [aWsm compiler](https://github.com/gwsystems/aWsm) with asynchronous I/O provided by [libuv](https://github.com/libuv/libuv).
## Host Dependencies ## Host Dependencies
@ -17,7 +17,7 @@ sudo apt-get install libuv1-dev
**Note: These steps require Docker. Make sure you've got it installed!** **Note: These steps require Docker. Make sure you've got it installed!**
We provide a Docker build environment configured with the dependencies and toolchain needed to build the aWsm runtime and serverless functions. We provide a Docker build environment configured with the dependencies and toolchain needed to build the SLEdge runtime and serverless functions.
To setup this environment, run: To setup this environment, run:
@ -33,21 +33,21 @@ To enter the docker environment, run:
./devenv.sh run ./devenv.sh run
``` ```
The first time you enter this environment, run the following to copy the awsmrt binary to /awsm/runtime/bin. The first time you enter this environment, run the following to copy the sledgert binary to /sledge/runtime/bin.
```bash ```bash
cd /awsm/runtime cd /sledge/runtime
make clean all make clean all
``` ```
There are a set of benchmarking applications in the `/awsm/runtime/tests` directory. Run the following to compile all benchmarks runtime tests using silverfish and then copy all resulting `<application>_wasm.so` files to /awsm/runtime/bin. There are a set of benchmarking applications in the `/sledge/runtime/tests` directory. Run the following to compile all benchmarks runtime tests using the aWsm compiler and then copy all resulting `<application>_wasm.so` files to /sledge/runtime/bin.
```bash ```bash
cd /awsm/runtime/tests/ cd /sledge/runtime/tests/
make clean all make clean all
``` ```
You now have everything that you need to execute your first serverless function on aWsm You now have everything that you need to execute your first serverless function on SLEdge
To exit the container: To exit the container:
@ -63,7 +63,7 @@ To stop the Docker container:
## Running your first serverless function ## Running your first serverless function
An aWsm serverless function consists of a shared library (\*.so) and a JSON configuration file that determines how the runtime should execute the serverless function. As an example, here is the configuration file for our sample fibonacci function: An SLEdge serverless function consists of a shared library (\*.so) and a JSON configuration file that determines how the runtime should execute the serverless function. As an example, here is the configuration file for our sample fibonacci function:
```json ```json
{ {
@ -83,11 +83,11 @@ An aWsm serverless function consists of a shared library (\*.so) and a JSON conf
The `port` and `name` fields are used to determine the path where our serverless function will be served served. The `port` and `name` fields are used to determine the path where our serverless function will be served served.
In our case, we are running the aWsm runtime on localhost, so our function is available at `http://localhost:10000/fibonacci` In our case, we are running the SLEdge runtime on localhost, so our function is available at `http://localhost:10000/fibonacci`
Our fibonacci function will parse a single argument from the HTTP POST body that we send. The expected Content-Type is "text/plain" and the buffer is sized to 1024 bytes for both the request and response. This is sufficient for our simple Fibonacci function, but this must be changed and sized for other functions, such as image processing. Our fibonacci function will parse a single argument from the HTTP POST body that we send. The expected Content-Type is "text/plain" and the buffer is sized to 1024 bytes for both the request and response. This is sufficient for our simple Fibonacci function, but this must be changed and sized for other functions, such as image processing.
Now that we understand roughly how the aWsm runtime interacts with serverless function, let's run Fibonacci! Now that we understand roughly how the SLEdge runtime interacts with serverless function, let's run Fibonacci!
From the root project directory of the host environment (not the Docker container!), navigate to the binary directory From the root project directory of the host environment (not the Docker container!), navigate to the binary directory
@ -95,10 +95,10 @@ From the root project directory of the host environment (not the Docker containe
cd runtime/bin/ cd runtime/bin/
``` ```
Now run the awsmrt binary, passing the JSON file of the serverless function we want to serve. Because serverless functions are loaded by aWsm as shared libraries, we want to add the `runtime/tests/` directory to LD_LIBRARY_PATH. Now run the sledgert binary, passing the JSON file of the serverless function we want to serve. Because serverless functions are loaded by SLEdge as shared libraries, we want to add the `runtime/tests/` directory to LD_LIBRARY_PATH.
```bash ```bash
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./awsmrt ../tests/test_fibonacci.json LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci.json
``` ```
While you don't see any output to the console, the runtime is running in the foreground. While you don't see any output to the console, the runtime is running in the foreground.
@ -121,11 +121,11 @@ Content-type: text/plain
55 55
``` ```
When done, terminal the aWsm runtime with `Ctrl+c` When done, terminal the SLEdge runtime with `Ctrl+c`
## Removing the aWsm Runtime ## Removing the SLEdge Runtime
If you are finished working with the aWsm runtime and wish to remove it, run the following command to delete our Docker build and runtime images. If you are finished working with the SLEdge runtime and wish to remove it, run the following command to delete our Docker build and runtime images.
```bash ```bash
./devenv.sh rma ./devenv.sh rma

@ -5,38 +5,38 @@
# Root directory of host # Root directory of host
HOST_ROOT=${HOST_ROOT:-$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd)} HOST_ROOT=${HOST_ROOT:-$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd)}
# Name use to represent the Awsm system # Name use to represent the SLEdge system
SYS_NAME='awsm' SYS_NAME='sledge'
# /awsm # /sledge
HOST_SYS_MOUNT=${HOST_SYS_MOUNT:-"/${SYS_NAME}"} HOST_SYS_MOUNT=${HOST_SYS_MOUNT:-"/${SYS_NAME}"}
SYS_WASMCEPTION='silverfish/wasmception' # SYS_WASMCEPTION='silverfish/wasmception'
# awsm # sledge
SYS_DOC_NAME=${SYS_NAME} SYS_DOC_NAME=${SYS_NAME}
# awsm-dev # sledge-dev
SYS_DOC_DEVNAME=${SYS_DOC_NAME}'-dev' SYS_DOC_DEVNAME=${SYS_DOC_NAME}'-dev'
# Docker Tag we want to use # Docker Tag we want to use
SYS_DOC_TAG='latest' SYS_DOC_TAG='latest'
# The name of the non-dev Docker container that we want to build. awsm:latest # The name of the non-dev Docker container that we want to build. sledge:latest
SYS_DOC_NAMETAG=${SYS_DOC_NAME}:${SYS_DOC_TAG} SYS_DOC_NAMETAG=${SYS_DOC_NAME}:${SYS_DOC_TAG}
SYS_DOC_DEVNAMETAG=${SYS_DOC_DEVNAME}:${SYS_DOC_TAG} SYS_DOC_DEVNAMETAG=${SYS_DOC_DEVNAME}:${SYS_DOC_TAG}
# An optional timeout that allows a user to terminate the script if awsm-dev is detected # An optional timeout that allows a user to terminate the script if sledge-dev is detected
SYS_BUILD_TIMEOUT=0 SYS_BUILD_TIMEOUT=0
# Provides help to user on how to use this script # Provides help to user on how to use this script
usage() { usage() {
echo "usage $0 <setup||run||stop||rm||rma/>" echo "usage $0 <setup||run||stop||rm||rma/>"
echo " setup Build aWsm and a Docker container with toolchain needed to compile your own functions" echo " setup Build a sledge runtime container and sledge-dev, a build container with toolchain needed to compile your own functions"
echo " run Start the aWsm Docker image as an interactive container with this repository mounted" echo " run Start the sledge Docker image as an interactive container with this repository mounted"
echo " stop Stop and remove the aWsm Docker container after use" echo " stop Stop and remove the sledge Docker container after use"
echo " rm Remove the aWsm runtime container and image, but leaves the awsm-dev container in place" echo " rm Remove the sledge runtime container and image, but leaves the sledge-dev container in place"
echo " rma Removes all the awsm and awsm-dev containers and images" echo " rma Removes all the sledge and sledge-dev containers and images"
} }
# Given a number of seconds, initiates a countdown sequence # Given a number of seconds, initiates a countdown sequence
@ -50,19 +50,19 @@ countdown() {
echo echo
} }
# Build and runs the build container awsm-dev and then executes make install on the project # Build and runs the build container sledge-dev and then executes make install on the project
# Finally "forks" the awsm-dev build container into the awsm execution container # Finally "forks" the sledge-dev build container into the sledge execution container
envsetup() { envsetup() {
# I want to create this container before the Makefile executes so that my user owns it # I want to create this container before the Makefile executes so that my user owns it
# This allows me to execute the awsmrt binary from my local host # This allows me to execute the sledgert binary from my local host
mkdir -p "$HOST_ROOT/runtime/bin" mkdir -p "$HOST_ROOT/runtime/bin"
# Check to see if the awsm:latest image exists, exiting if it does # Check to see if the sledge:latest image exists, exiting if it does
# Because awsm:latest is "forked" after completing envsetup, this suggests that envsetup was already run # Because sledge:latest is "forked" after completing envsetup, this suggests that envsetup was already run
if docker image inspect ${SYS_DOC_NAMETAG} 1>/dev/null 2>/dev/null; then if docker image inspect ${SYS_DOC_NAMETAG} 1>/dev/null 2>/dev/null; then
echo "${SYS_DOC_NAMETAG} image exists, which means that 'devenv.sh setup' already ran to completion!" echo "${SYS_DOC_NAMETAG} image exists, which means that 'devenv.sh setup' already ran to completion!"
echo "If you are explicitly trying to rebuild Awsm, run the following:" echo "If you are explicitly trying to rebuild SLEdge, run the following:"
echo "devenv.sh rma | Removes the images awsm:latest AND awsm-dev:latest" echo "devenv.sh rma | Removes the images sledge:latest AND sledge-dev:latest"
exit 1 exit 1
fi fi
@ -75,8 +75,8 @@ envsetup() {
rm -f Dockerfile rm -f Dockerfile
ln -s Dockerfile.$(uname -m) Dockerfile ln -s Dockerfile.$(uname -m) Dockerfile
# As a user nicety, warn the user if awsm-dev is detected # As a user nicety, warn the user if sledge-dev is detected
# This UX differs from detecting awsm, which immediately exits # This UX differs from detecting sledge, which immediately exits
# This is disabled because it doesn't seem useful # This is disabled because it doesn't seem useful
if if
docker image inspect "${SYS_DOC_DEVNAMETAG}" 1>/dev/null 2>/dev/null && [ $SYS_BUILD_TIMEOUT -gt 0 ] docker image inspect "${SYS_DOC_DEVNAMETAG}" 1>/dev/null 2>/dev/null && [ $SYS_BUILD_TIMEOUT -gt 0 ]
@ -86,11 +86,11 @@ envsetup() {
countdown ${SYS_BUILD_TIMEOUT} countdown ${SYS_BUILD_TIMEOUT}
fi fi
# Build the image awsm-dev:latest # Build the image sledge-dev:latest
echo "Building ${SYS_DOC_DEVNAMETAG}" echo "Building ${SYS_DOC_DEVNAMETAG}"
docker build --tag "${SYS_DOC_DEVNAMETAG}" . docker build --tag "${SYS_DOC_DEVNAMETAG}" .
# Run the awsm-dev:latest image as a background container named awsm-dev with the project directly mounted at /awsm # Run the sledge-dev:latest image as a background container named sledge-dev with the project directly mounted at /sledge
echo "Creating the build container ${SYS_DOC_NAMETAG} from the image ${SYS_DOC_DEVNAMETAG}" echo "Creating the build container ${SYS_DOC_NAMETAG} from the image ${SYS_DOC_DEVNAMETAG}"
docker run \ docker run \
--privileged \ --privileged \
@ -99,18 +99,18 @@ envsetup() {
--mount type=bind,src="$(cd "$(dirname "${0}")" && pwd -P || exit 1),target=/${SYS_NAME}" \ --mount type=bind,src="$(cd "$(dirname "${0}")" && pwd -P || exit 1),target=/${SYS_NAME}" \
"${SYS_DOC_DEVNAMETAG}" /bin/sleep 99999999 >/dev/null "${SYS_DOC_DEVNAMETAG}" /bin/sleep 99999999 >/dev/null
# Execute the make install command on the awsm-dev image to build the project # Execute the make install command on the sledge-dev image to build the project
echo "Building ${SYS_NAME}" echo "Building ${SYS_NAME}"
docker exec \ docker exec \
--tty \ --tty \
--workdir "${HOST_SYS_MOUNT}" \ --workdir "${HOST_SYS_MOUNT}" \
${SYS_DOC_DEVNAME} make install ${SYS_DOC_DEVNAME} make install
# Create the image awsm:latest from the current state of docker-dev # Create the image sledge:latest from the current state of docker-dev
echo "Tagging the new image" echo "Tagging the new image"
docker container commit ${SYS_DOC_DEVNAME} ${SYS_DOC_NAMETAG} docker container commit ${SYS_DOC_DEVNAME} ${SYS_DOC_NAMETAG}
# Kill and remove the running awsm-dev container # Kill and remove the running sledge-dev container
echo "Cleaning up ${SYS_DOC_DEVNAME}" echo "Cleaning up ${SYS_DOC_DEVNAME}"
docker kill ${SYS_DOC_DEVNAME} docker kill ${SYS_DOC_DEVNAME}
docker rm ${SYS_DOC_DEVNAME} docker rm ${SYS_DOC_DEVNAME}
@ -118,10 +118,10 @@ envsetup() {
echo "Done!" echo "Done!"
} }
# Executes an interactive BASH shell in the awsm container with /awsm as the working directory # Executes an interactive BASH shell in the sledge container with /sledge as the working directory
# This is the Awsm project directory mounted from the host environment. # This is the SLEdge project directory mounted from the host environment.
# If the image awsm:latest does not exist, automatically runs envsetup to build awsm and create it # If the image sledge:latest does not exist, automatically runs envsetup to build sledge and create it
# If the a container names awsm is not running, starts it from awsm:latest, mounting the Awsm project directory to /awsm # If the a container names sledge is not running, starts it from sledge:latest, mounting the SLEdge project directory to /sledge
envrun() { envrun() {
if ! docker image inspect ${SYS_DOC_NAMETAG} >/dev/null; then if ! docker image inspect ${SYS_DOC_NAMETAG} >/dev/null; then
envsetup envsetup
@ -145,7 +145,7 @@ envrun() {
docker exec --tty --interactive --workdir "${HOST_SYS_MOUNT}" ${SYS_DOC_NAME} /bin/bash docker exec --tty --interactive --workdir "${HOST_SYS_MOUNT}" ${SYS_DOC_NAME} /bin/bash
} }
# Stops and removes the awsm "runtime" container # Stops and removes the sledge "runtime" container
envstop() { envstop() {
echo "Stopping container" echo "Stopping container"
docker stop ${SYS_DOC_NAME} docker stop ${SYS_DOC_NAME}
@ -153,13 +153,13 @@ envstop() {
docker rm ${SYS_DOC_NAME} docker rm ${SYS_DOC_NAME}
} }
# Stops and removes the awsm "runtime" container and then removes the awsm "runtime" image # Stops and removes the sledge "runtime" container and then removes the sledge "runtime" image
envrm() { envrm() {
envstop envstop
docker rmi ${SYS_DOC_NAME} docker rmi ${SYS_DOC_NAME}
} }
# Stops and removes the awsm "runtime" container and image and then removes the awsm-dev "build image" image # Stops and removes the sledge "runtime" container and image and then removes the sledge-dev "build image" image
envrma() { envrma() {
envrm envrm
docker rmi ${SYS_DOC_DEVNAME} docker rmi ${SYS_DOC_DEVNAME}

@ -1,7 +1,5 @@
#!/bin/sh #!/bin/sh
# Executing by the root Makefile, typically within the awsm-dev build container # Executing by the root Makefile, typically within the sledge-dev build container
echo "Setting up toolchain environment" echo "Setting up toolchain environment"
@ -17,21 +15,21 @@ if [ ! -x "${SYS_SRC_PREFIX}/install.sh" ]; then
exit 1 exit 1
fi fi
SYS_NAME='awsm' SYS_NAME='sledge'
SILVERFISH='silverfish' COMPILER='awsm'
# /opt/awsm # /opt/sledge
SYS_PREFIX=${SYS_PREFIX:-"/opt/${SYS_NAME}"} SYS_PREFIX=${SYS_PREFIX:-"/opt/${SYS_NAME}"}
# /awsm, where the awsm repo is mounted from the host # /sledge, where the sledge repo is mounted from the host
SYS_SRC_PREFIX=${SYS_SRC_PREFIX:-"/${SYS_NAME}"} SYS_SRC_PREFIX=${SYS_SRC_PREFIX:-"/${SYS_NAME}"}
# The release directory containing the silverfish binary # The release directory containing the binary of the aWsm compiler
SYS_SF_REL_DIR=${SYS_SF_REL_DIR:-"${SYS_SRC_PREFIX}/${SILVERFISH}/target/release"} SYS_COMPILER_REL_DIR=${SYS_COMPILER_REL_DIR:-"${SYS_SRC_PREFIX}/${COMPILER}/target/release"}
# /opt/awsm/bin? # /opt/sledge/bin?
SYS_BIN_DIR=${SYS_BIN_DIR:-"${SYS_PREFIX}/bin"} SYS_BIN_DIR=${SYS_BIN_DIR:-"${SYS_PREFIX}/bin"}
# /opt/awsm/lib? # /opt/sledge/lib?
SYS_LIB_DIR=${SYS_LIB_DIR:-"${SYS_PREFIX}/lib"} SYS_LIB_DIR=${SYS_LIB_DIR:-"${SYS_PREFIX}/lib"}
# The first argument can be either wasi or wasmception. This determines the system interface used # The first argument can be either wasi or wasmception. This determines the system interface used
@ -39,7 +37,7 @@ SYS_LIB_DIR=${SYS_LIB_DIR:-"${SYS_PREFIX}/lib"}
# Currently, WASI is not actually supported by the runtime. # Currently, WASI is not actually supported by the runtime.
if [ $# -eq 0 ] || [ "$1" = "wasmception" ]; then if [ $# -eq 0 ] || [ "$1" = "wasmception" ]; then
echo "Setting up for wasmception" echo "Setting up for wasmception"
WASM_PREFIX=${WASM_PREFIX:-"${SYS_SRC_PREFIX}/${SILVERFISH}/wasmception"} WASM_PREFIX=${WASM_PREFIX:-"${SYS_SRC_PREFIX}/${COMPILER}/wasmception"}
WASM_BIN=${WASM_BIN:-"${WASM_PREFIX}/dist/bin"} WASM_BIN=${WASM_BIN:-"${WASM_PREFIX}/dist/bin"}
WASM_SYSROOT=${WASM_SYSROOT:-"${WASM_PREFIX}/sysroot"} WASM_SYSROOT=${WASM_SYSROOT:-"${WASM_PREFIX}/sysroot"}
WASM_TARGET=${WASM_TARGET:-"wasm32-unknown-unknown-wasm"} WASM_TARGET=${WASM_TARGET:-"wasm32-unknown-unknown-wasm"}
@ -59,10 +57,10 @@ rm -f "${SYS_BIN_DIR}"/*
install -d -v "$SYS_BIN_DIR" || exit 1 install -d -v "$SYS_BIN_DIR" || exit 1
# Link each of the binaries in the system bin directory # Link each of the binaries in the system bin directory
BINS=${SILVERFISH} BINS=${COMPILER}
for bin in $BINS; do for bin in $BINS; do
# i.e. ./silverfish/target/release/silverfish -> /opt/awsm/bin/silverfish # i.e. ./silverfish/target/release/silverfish -> /opt/sledge/bin/silverfish
ln -sfv "${SYS_SF_REL_DIR}/${bin}" "${SYS_BIN_DIR}/${bin}" ln -sfv "${SYS_COMPILER_REL_DIR}/${bin}" "${SYS_BIN_DIR}/${bin}"
done done
for file in clang clang++; do for file in clang clang++; do

@ -2,7 +2,7 @@ CC=clang
RTDIR=src/ RTDIR=src/
CFILES=${RTDIR}/*.c ${RTDIR}/libc/*.c ${RTDIR}/memory/common.c CFILES=${RTDIR}/*.c ${RTDIR}/libc/*.c ${RTDIR}/memory/common.c
RUNTIME=bin/awsmrt RUNTIME=bin/sledgert
INC=include/ INC=include/
ARCH := $(shell uname -m) ARCH := $(shell uname -m)

@ -1,4 +1,4 @@
BASE=awsm BASE=sledge
SFCC=silverfish SFCC=silverfish
CC=clang CC=clang
WASMCC=wasm32-unknown-unknown-wasm-clang WASMCC=wasm32-unknown-unknown-wasm-clang
@ -15,7 +15,7 @@ MEMC_GEN=generic.c
MEMC_MPX=mpx.c MEMC_MPX=mpx.c
MEMC_SEG=segmented.c MEMC_SEG=segmented.c
BASE_DIR=../../silverfish/ BASE_DIR=../../awsm/
RT_DIR=${BASE_DIR}/runtime/ RT_DIR=${BASE_DIR}/runtime/
RT_MEM=${RT_DIR}/memory/ RT_MEM=${RT_DIR}/memory/
RT_LIBC=${RT_DIR}/libc/libc_backing.c RT_LIBC=${RT_DIR}/libc/libc_backing.c
@ -25,7 +25,7 @@ RT_ENV=${RT_DIR}/libc/env.c ${RT_DIR}/libc/env_${ARCH}.c
MEMC=${RT_MEM}/${MEMC_64} MEMC=${RT_MEM}/${MEMC_64}
DUMMY=${BASE_DIR}/code_benches/dummy.c DUMMY=${BASE_DIR}/code_benches/dummy.c
# for awsm # for SLEdge
ABASE_DIR=../../ ABASE_DIR=../../
ART_DIR=${ABASE_DIR}/runtime/ ART_DIR=${ABASE_DIR}/runtime/
ART_INC=${ART_DIR}/include/ ART_INC=${ART_DIR}/include/

@ -13,7 +13,7 @@ cd ../../bin
export LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" export LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH"
gdb --eval-command="handle SIGUSR1 nostop" \ gdb --eval-command="handle SIGUSR1 nostop" \
--eval-command="set pagination off" \ --eval-command="set pagination off" \
--eval-command="set substitute-path /awsm/runtime $project_path" \ --eval-command="set substitute-path /sledge/runtime $project_path" \
--eval-command="run ../tests/preemption/test_fibonacci_multiple.json" \ --eval-command="run ../tests/preemption/test_fibonacci_multiple.json" \
./awsmrt ./sledgert
cd ../../tests cd ../../tests

@ -1,4 +1,4 @@
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./awsmrt ../tests/test_fibonacci_multiple.json LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci_multiple.json
# fib(20) # fib(20)

@ -1,26 +0,0 @@
CURR_DIR= $(shell pwd)
DIST_PREFIX=${CURR_DIR}/dist/
all: clean build
build: ck jsmn http-parser
ck:
mkdir -p ${DIST_PREFIX}
cd ck; ./configure --cores=$(shell getconf _NPROCESSORS_CONF) --prefix=${DIST_PREFIX}
make -C ck all
make -C ck install
http-parser: http-parser/http_parser.c
mkdir -p ${DIST_PREFIX}/lib/
cd http-parser; $(CC) $(CFLAGS) -I. -c http_parser.c; mv http_parser.o ${DIST_PREFIX}/lib/; cp http_parser.h ${DIST_PREFIX}/include/
jsmn:
mkdir -p ${DIST_PREFIX}/include/
cp jsmn/jsmn.h ${DIST_PREFIX}/include/
clean:
make -C ck uninstall
rm -rf ${DIST_PREFIX}
.PHONY: clean all build ck jsmn http-parser

@ -1 +0,0 @@
Subproject commit 94f37128144287d35274225f99da4927d3f41ab4

@ -1 +0,0 @@
Subproject commit 2343fd6b5214b2ded2cdcf76de2bf60903bb90cd

@ -1 +0,0 @@
Subproject commit 053d3cd29200edb1bfd181d917d140c16c1f8834

@ -1 +0,0 @@
Subproject commit e270b5edb24cf3a7d9cdc162eb4d6945cdabf1b5
Loading…
Cancel
Save