-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve isolation, execution limits and execution metrics by using Isolate #683
Merged
Conversation
This file contains 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
HexF
approved these changes
Sep 8, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
@@ -117,7 +129,7 @@ const options = { | |||
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.
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
/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: