Bounce is a scalable and fault-tolerant code execution engine that uses Firecracker for running code in isolated microVMs and RabbitMQ 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.
git clone https://github.com/wyzlle/bounce.git .
- Start RabbitMQ and Postgres containers:
docker-compose up -d
- Start the worker (and agent):
./worker/start.sh
- Start the backend server:
cd backend
yarn install
yarn build
yarn start
Bounce exposes a simple API for submitting code and retrieving the results.
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)
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
# 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/<submission_id>
Bounce is licensed under the MIT License.