From d0c4afb32f3cdcec319563686f6cdf6073fcbb9a Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 16 May 2013 17:02:45 -0400 Subject: [PATCH] More info in the capa/safe_exec/README --- common/lib/capa/capa/safe_exec/README.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/common/lib/capa/capa/safe_exec/README.rst b/common/lib/capa/capa/safe_exec/README.rst index 57eac6b9fd..c61100f709 100644 --- a/common/lib/capa/capa/safe_exec/README.rst +++ b/common/lib/capa/capa/safe_exec/README.rst @@ -28,5 +28,24 @@ __ https://github.com/edx/codejail/blob/master/README.rst /common/lib/sandbox-packages/** r, +3. You can configure resource limits in settings.py. A CODE_JAIL setting is + available, a dictionary. The "limits" key lets you adjust the limits for + CPU time, real time, and memory use. Setting any of them to zero disables + that limit:: + + # in settings.py... + CODE_JAIL = { + # Configurable limits. + 'limits': { + # How many CPU seconds can jailed code use? + 'CPU': 1, + # How many real-time seconds will a sandbox survive? + 'REALTIME': 1, + # How much memory (in bytes) can a sandbox use? + 'VMEM': 30000000, + }, + } + + That's it. Once you've finished the CodeJail configuration instructions, your course-hosted Python code should be run securely.