Improve isolation, execution limits and execution metrics by using Isolate#683
Merged
HexF merged 11 commits intoengineer-man:masterfrom Sep 8, 2024
Merged
Conversation
This was referenced Sep 20, 2024
| @@ -1,20 +1,29 @@ | |||
| FROM node:15.10.0-buster-slim | |||
| FROM buildpack-deps:bookworm AS isolate | |||
| RUN apt-get update && \ | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| limit_overrides: { | ||
| desc: 'Per-language exceptions in JSON format for each of:\ | ||
| max_process_count, max_open_files, max_file_size, compile_memory_limit,\ | ||
| run_memory_limit, compile_timeout, run_timeout, output_max_size', |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
/tmpdirectory. 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)
cgroup2is enabled andcgroup v1is disabled. This is the default configuration on most distributions.privilegedflag is needed if usingdocker run. The patch adds the flag to the docker-compose files and the scripts usingdocker run2. API Compatibility (compatible)
compile_cpu_timeandrun_cpu_timeare added for CPU time limits.compile_timeoutandrun_timeoutcontinue to represent wall-time limits.cpu_time,wall_time, andmemoryare 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.yamlwas used: