mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-20 20:16:26 +02:00
Improve isolation, execution limits and execution metrics by using Isolate (#683)
* Initial: use Isolate for isolation * Continue: use Isolate for isolation * Bug fixes * timeout is wall-time for backward compatibility * Documentation, signal names, reported time in ms * Report memory usage in bytes * Add privileged flags where needed * Remove tmpfs * Remove tmpfs * Fix package installation * Fix path, fix Zig: CRLF -> LF
This commit is contained in:
parent
59338eee33
commit
bd42fe3357
22 changed files with 508 additions and 454 deletions
13
api/src/docker-entrypoint.sh
Executable file
13
api/src/docker-entrypoint.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd /sys/fs/cgroup && \
|
||||
mkdir isolate/ && \
|
||||
echo 1 > isolate/cgroup.procs && \
|
||||
echo '+cpuset +cpu +io +memory +pids' > cgroup.subtree_control && \
|
||||
cd isolate && \
|
||||
mkdir init && \
|
||||
echo 1 > init/cgroup.procs && \
|
||||
echo '+cpuset +memory' > cgroup.subtree_control && \
|
||||
echo "Initialized cgroup" && \
|
||||
chown -R piston:piston /piston && \
|
||||
exec su -- piston -c 'ulimit -n 65536 && node /piston_api/src'
|
Loading…
Add table
Add a link
Reference in a new issue