The First Idea

Just run the generated code inside Docker.

Run the Script


docker build -t python-sandbox .
docker run --rm \
  -v "$PWD/script.py:/sandbox/script.py:ro" \
  python-sandbox \
  python /sandbox/script.py
  

For a Demo…

This works perfectly.

One user. One container. One execution.

Then Reality Arrives

Multiple users.

Now you must manage:

  • container lifecycle
  • timeouts
  • cleanup
  • per-user limits

You Now Need

An Execution Platform

  • per-user environments
  • quotas
  • job scheduling
  • sandbox cleanup