**aWsm** is an efficient WASM runtime built with the `silverfish` compiler. This is an active research effort with regular breaking changes and no guarantees of stability.
**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.
Additionally, if you want to execute the Awsm runtime on your host environment, you need libuv. A reason you might want to do this is to debug your serverless function, as GDB does not seem to run properly within a Docker container.
If on Debian, you can install libuv with the following:
If on Debian, you can install libuv with the following:
@ -18,7 +17,7 @@ If on Debian, you can install libuv with the following:
**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 aWsm runtime and serverless functions.
To setup this environment, run:
To setup this environment, run:
@ -66,9 +65,9 @@ You should be in the root project directory (not in the Docker container)
cd runtime/bin/
cd runtime/bin/
```
```
We can now run Awsm with one of the serverless functions we built. Let's run Fibonacci!
We can now run aWsm with one of the serverless functions we built. Let's run Fibonacci!
Because serverless functions are loaded by Aswsm as shared libraries, we want to add the `runtime/tests/` directory to LD_LIBRARY_PATH.
Because serverless functions are loaded by aWsm as shared libraries, we want to add the `runtime/tests/` directory to LD_LIBRARY_PATH.
@ -96,75 +95,27 @@ Notice that it is configured to run on port 10000. The `name` field is also used
Our fibonacci function expects an HTTP POST body of type "text/plain" which it can parse as an integer to figure out which Fibonacci number we want.
Our fibonacci function expects an HTTP POST body of type "text/plain" which it can parse as an integer to figure out which Fibonacci number we want.
Let's get the 10th. Note that I'm using ApacheBench to make this request.
Let's get the 10th. Note that I'm using [HTTPie](https://httpie.org/) to send a POST request with a body containing the parameter I want to pass to my serverless function.
Note: You possibly run the awsmrt command in the foreground. If so, you should open a new terminal session.
Note: You possibly run the awsmrt command in the foreground. If so, you should open a new terminal session.
```bash
```bash
echo 10 >fib.txt
echo "10" | http :10000
ab -c 1 -n 1 -p fib.txt -v 2 http://localhost:10000/fibonacci
```
```
In my case, I received the following in response. The response is 55, which seems to be correct!
In my case, I received the following in response. The response is 55, which seems to be correct!
```bash
```bash
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)...INFO: POST header ==
---
POST /fibonacci HTTP/1.0
Content-length: 3
Content-type: text/plain
Host: localhost:10000
User-Agent: ApacheBench/2.3
Accept: */*
---
LOG: header received:
HTTP/1.1 200 OK
HTTP/1.1 200 OK
Content-type: text/plain
Content-length: 3
Content-length: 3
Content-type: text/plain
55
55
..done
Server Software:
Server Hostname: localhost
Server Port: 10000
Document Path: /fibonacci
Document Length: 3 bytes
Concurrency Level: 1
Time taken for tests: 0.001 seconds
Complete requests: 1
Failed requests: 0
Total transferred: 100 bytes
Total body sent: 141
HTML transferred: 3 bytes
Requests per second: 952.38 [#/sec] (mean)
Time per request: 1.050 [ms] (mean)
Time per request: 1.050 [ms] (mean, across all concurrent requests)