## Hybrid execution environment for Serverless Workloads
Execution environments are typically container oriented for FaaS platforms but this creates problems since containers are on one hand not totally secure and on the other hand not capable of high-performance. This project looks into creating a hybrid execution environment to cater to different workload needs.
### System Requirements
- Node.js (10.x and above)
- g++
- build-essential
### How to execute?
After nodejs has been installed
- install the dependencies: execute `npm install` from within the project folder
- run the server as `npm start` or `node index.js`
### How to interact?
The platform works via a HTTP API based interface, the interface is divided into two parts:
- Deploy: The deploy interface is used to upload the function file and store on the server, and also setup containers and VM images. <br>
<br> The POST request contains two parameters: 1. <emp>runtime</emp> which specifies the runtime to use viz. isolate, process, container or virtual machine and 2. <emp>severless</emp> which sends the serverless function as file via multipart/form-data.
<br> On successful deployment the API returns a function key which is to be for function execution.
- Execute: To execute the submitted function, we use the Execute API. <br>
## A Hybrid execution environment for Serverless Workloads
Execution environments are typically container oriented for FaaS platforms but this creates problems since containers are on one hand not totally secure and on the other hand not capable of high-performance. This project looks into creating a hybrid execution environment to cater to different workload needs.
## Architecture
Xanadu is divided into two extremely loosely coupled modules, the **Dispatch Module (DM)** and the **Resource Manager (RM)** module. The RM looks after resource provisioning and consolidation at the host level while the DM looks after handling user requests and executing those requests at the requisite isolation level using resources provided by the RM. \
A loose architecture diagram of Xanadu is given below.
The DM is divided into two submodules the **Dispatcher** and the **Dispatch Daemon**. The Dispatcher runs on the Master node while the Dispatch Daemon runs on each Worker nodes. When a request arrives at the dispatcher, it queries the RM for resources and on receiving the resource requests the Dispatch Daemon to run and execute the function on the specified worker node.
### Directory Structure
```bash
.
├── constants.json
├── dispatch_daemon
│ ├── config.json
│ ├── execute.js
│ ├── index.js
│ ├── isolate.js
│ ├── lib.js
│ ├── local_repository
│ ├── package.json
│ └── package-lock.json
├── dispatcher
│ ├── index.js
│ ├── isolate.js
│ ├── lib.js
│ ├── package.json
│ ├── package-lock.json
│ └── repository
└── package-lock.json
```
### System Requirements
- Node.js (10.x and above)
- g++
- build-essential
- Docker
- Java
- Apache Kafka (Configure to allow auto-delete and auto-registration of topics)
### Starting the server
After nodejs has been installed
- Install the dependencies: execute `npm install` from within the project folder
- Modify the constants.json file as required.
- For Worker nodes modify the config.json in dispatch_daemon to provide an unique ID to each node.
- Run the Master and Worker server as `npm start` or `node index.js`
### Interaction API
The platform works via a HTTP API based interface, the interface is divided into two parts:
- Deploy: The deploy interface is used to upload the function file and store on the server, and also setup containers and VM images.\
The POST request contains two parameters: 1. *runtime* which specifies the runtime to use viz. isolate, process, container or virtual machine and 2. *severless* which sends the serverless function as file via multipart/form-data.\
On successful deployment the API returns a function key which is to be for function execution.
- Execute: To execute the submitted function, we use the Execute API.\