ランナー - Experimental code runner microservice based on Docker containers.
First of all, this project is currently work in progress and not fully finished.
Also, this service allows arbitrary code execution in Docker containers. This will be a high security risk! If you want to use this service, only use this on a separate, encapsulated server environment!
👉 Take a look in the issue tracker.
Maybe, to make my thoughts behind the project more clear, here is a little introduction into the project's architecture.
As you can see, the project is split up in different services.
- REST API: The REST API service is the main entrypoint for code execution.
- Config Provider: All services need specific configuration. These are obtained by this service.
- Spec Provider: ranna works with
specs
, which describe the runner environments for theSandbox Provider
. It provides a map oflanguage
specifiers (likego
, orpython3
) with their specific runnerspecs
. - Sandbox Manager: A higher levbel abstraction to execute code in sandboxes. Also keeps track of running containers to clean them up after teardown.
- Sandbox Provider: This is the high level API to create a sandbox environment where the passed code can be run inside and the output can be obtained from.
- Namespace Provider: This service is responsible for generating unique namespace identifiers which can be used to pass the provided code as file into the sandbox.
- File Provider: This service is responsible for creating the nessecary directory structure and the file, containing the code, which is then passed to the sandbox to be executed.
👉 Take a look in the wiki.
👉 Take a look in the wiki.
ranna also provides a Go client package available in pkg/client
.
See the simple example implementation how to use the client package.
Here you can find some handy documentation for the provided packages.
© 2021 Ringo Hoffmann (zekro Development).
Covered by the MIT License.