Improve isolation, execution limits and execution metrics by using Isolate #683
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This patch integrates Isolate to manage isolation, set execution limits and report execution metrics for each submission. I use a fork (with very simple changes) of Isolate that we made for our graduation project that does not require systemd.
Improvements
1. Fine-Grained Execution Limits
cgroups
: Memory limits are now enforced on all processes spawned by a submission usingcgroups
. Previously, withprlimit
, child processes inherited the memory limit rather than contributed to it, leading to the possibility of memory exhaustion.2. Enhanced Execution Metrics Reporting
compile
,run
) of the submission:3. Enhanced isolation
/tmp
directory. They also can't view all of the processes running on the system now (e.g, viaps aux
)4. Other improvements
Backward Compatibility
1. Self-Hosting (might be breaking)
cgroup2
is enabled andcgroup v1
is disabled. This is the default configuration on most distributions.privileged
flag is needed if usingdocker run
. The patch adds the flag to the docker-compose files and the scripts usingdocker run
2. API Compatibility (compatible)
compile_cpu_time
andrun_cpu_time
are added for CPU time limits.compile_timeout
andrun_timeout
continue to represent wall-time limits.cpu_time
,wall_time
, andmemory
are added for each stage.Testing
The patch has been tested using the following NodeJS script:
The patch was tested on Piston's development environment with bash and gcc runtimes installed. The following
docker-compose.dev.yaml
was used: