code_runner v0.1.1 CodeRunner.Worker

Worker module responsible for actually running code. Each worker process spawns a Docker container in an external process, executes the code, returns the result or timeout message.

Attributes

A few attributes can be configured in config.exs to change Docker image or adjust resource consumption of each worker.

  • @timeout - determines how long the worker will wait for the code to terminate. Default is 5000.
  • @docker_memory - assigns how much memory should a sandbox Docker container should have. Default is “50m”.
  • @docker_image - designates which Docker image to mount a sandbox container. Default is “harfangk/elixir:latest”.

Link to this section Summary

Link to this section Functions

Link to this function start_link(args)