Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aleksrutins/bounce
code execution engine (uses firecracker)
https://github.com/aleksrutins/bounce
Last synced: about 22 hours ago
JSON representation
code execution engine (uses firecracker)
- Host: GitHub
- URL: https://github.com/aleksrutins/bounce
- Owner: aleksrutins
- License: mit
- Created: 2023-03-14T21:34:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-24T13:01:40.000Z (11 months ago)
- Last Synced: 2023-12-24T14:23:21.395Z (11 months ago)
- Language: Go
- Homepage:
- Size: 76.2 KB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bounce
Bounce is a scalable and fault-tolerant code execution engine that uses [Firecracker](https://github.com/firecracker-microvm/firecracker) for running code in isolated microVMs and [RabbitMQ](https://rabbitmq.com) for scheduling them.
**IMPORTANT NOTE:** This was not made by me (@aleksrutins)! I just forked it, and then the original author (wyzlle) deleted their account. I have no clue how this thing works, but I'm hoping to figure it out.
## Getting Started
1. Install the following dependencies:
- [Docker](https://docs.docker.com/install/)
- [Go](https://golang.org/doc/install)
- [Node.js](https://nodejs.org/en/download/)2. Clone the repository:
```bash
git clone https://github.com/wyzlle/bounce.git .
```
3. Start RabbitMQ and Postgres containers:
```bash
docker-compose up -d
```
4. Start the worker (and agent):
```bash
./worker/start.sh
```
5. Start the backend server:
```bash
cd backend
yarn install
yarn build
yarn start
```## API
Bounce exposes a simple API for submitting code and retrieving the results.
### POST /exec
Submits code for execution. Accepts the following parameters in the request body:
- code: the code to be executed (required)
- language: the language the code is written in (required)
- input: input to be provided to the code during execution (optional)### GET /exec/:id
Retrieves the results of a code execution by its submission ID. Returns a JSON object with the following properties:
- stdout: the standard output produced by the code
- stderr: the standard error produced by the code
- exitCode: the exit code of the code### Examples
```bash
# submit code for execution
curl -X POST -H "Content-Type: application/json" -d '{"code": "print(input())", "input": "Hello World", "language": "py"}' http://localhost:3004/exec# get execution results
curl http://localhost:3004/exec/
```## License
Bounce is licensed under the [MIT License](https://github.com/wyzlle/bounce/blob/main/LICENSE).