You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bibimbap@asus:~$ isolate
Please specify an isolate command (e.g. --init, --run).
Usage: isolate [<options>] <command>
Options:
--as-uid=<uid> Perform action on behalf of a given user (requires root)
--as-gid=<gid> Perform action on behalf of a given group (requires root)
-b, --box-id=<id> When multiple sandboxes are used in parallel, each must get a unique ID
--cg Enable use of control groups
--cg-mem=<size> Limit memory usage of the control group to <size> KB
-c, --chdir=<dir> Change directory to <dir> before executing the program
--core=<size> Limit core files to <size> KB (default: 0)
-d, --dir=<dir> Make a directory <dir> visible inside the sandbox
--dir=<in>=<out> Make a directory <out> outside visible as <in> inside
--dir=<in>= Delete a previously defined directory rule (even a default one)
--dir=...:<opt> Specify options for a rule:
dev Allow access to block/char devices
fs Mount a filesystem (e.g., --dir=/proc:proc:fs)
maybe Skip the rule if<out> does not exist
noexec Do not allow execution of binaries
norec Do not bind the directory recursively
rw Allow read-write access
tmp Create as a temporary directory (implies rw)
-D, --no-default-dirs Do not add default directory rules
-f, --fsize=<size> Max size (in KB) of files that can be created
-E, --env=<var> Inherit the environment variable <var> from the parent process
-E, --env=<var>=<val> Set the environment variable <var> to <val>;unset it if<var> is empty
-x, --extra-time=<time> Set extra timeout, before which a timing-out program is not yet killed,
so that its real execution time is reported (seconds, fractions allowed)
-e, --full-env Inherit full environment of the parent process
--inherit-fds Inherit all file descriptors of the parent process
-m, --mem=<size> Limit address space to <size> KB
-M, --meta=<file> Output process information to <file> (name:value)
-n, --open-files=<max> Limit number of open files to <max> (default: 64, 0=unlimited)
-q, --quota=<blk>,<ino> Set disk quota to <blk> blocks and <ino> inodes
--share-net Share network namespace with the parent process
-s, --silent Do not print status messages except for fatal errors
--special-files Keep non-regular files (symlinks etc.) produced inside sandbox
-k, --stack=<size> Limit stack size to <size> KB (default: 0=unlimited)
-r, --stderr=<file> Redirect stderr to <file>
--stderr-to-stdout Redirect stderr to stdout
-i, --stdin=<file> Redirect stdin from <file>
-o, --stdout=<file> Redirect stdout to <file>
-p, --processes[=<max>] Enable multiple processes (at most <max> of them); needs --cg
-t, --time=<time> Set run time limit (seconds, fractions allowed)
--tty-hack Allow interactive programs in the sandbox (see man for caveats)
-v, --verbose Be verbose (use multiple timesfor even more verbosity)
--wait If the sandbox is currently busy, wait instead of refusing to run
-w, --wall-time=<time> Set wall clock time limit (seconds, fractions allowed)
Commands:
--init Initialize sandbox (and its control group when --cg is used)
--run -- <cmd> ... Run given command within sandbox
--cleanup Clean up sandbox
--print-cg-root Print the root of cgroup hierarchy
--version Display program version and configuration
bibimbap@asus:~$ vi hello.py
print('hello')
bibimbap@asus:~$ sudo cp hello.py /var/local/lib/isolate/0/box
bibimbap@asus:~$ isolate --run python3 hello.py
execve("python3"): No such file or directory
Exited with error status 127
documentationImprovements or additions to documentation
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
isolate
https://github.com/ioi/isolate
Isolate는 프로그래밍 경연 대회에서 경쟁자가 제출한 프로그램과 같은 신뢰할 수 없는 실행 파일을 안전하게 실행하도록 설계된 샌드박스입니다. Isolate는 제한된 접근 환경을 제공하여 호스트 시스템에 영향을 미치지 않도록 합니다.
Installation
isolate
가 설치되고 사용자 권한으로 실행 가능합니다.Options
Cpp 소스코드 컴파일 및 실행
hello.c 컴파일 및 실행
box로 옮겨서 실행 결과를 확인할 수 있습니다.
컴파일을 로컬에서 한게 신경 쓰입니다.
hello.py 실행 실패
isolate에서 python3를 읽지 못합니다.
python 실행파일 복사 후 실행
python 실행파일 복사 후 실행하니 정상적으로 됩니다.
isolate 내부에서 hello.c 컴파일하기
python 맹키로 gcc 실행파일만 복사 후 컴파일은 실패
의존하는 라이브러리가 같이 필요함..
--precesses
옵션 3 이상부터 정상적으로 컴파일 됨gcc 컴파일 시 멀티프로세스로 실행되기 때문으로, 이때 가용 프로세스 개수를 널널하게 잡아줘야 할 것 같음
채점 환경 isolate 내부에서 실행하기
관련 파일들 복사
generator 컴파일 및 실행
쉘 스크립트 반복문으로 bulk 생성하는 예제는 다음과 같습니다.
정해 컴파일 및 데이터 생성
cpp 소스코드 컴파일 및 데이터 생성
체커 컴파일 및 cpp 소스코드 채점 진행
python 소스코드 실행 및 데이터 생성
Beta Was this translation helpful? Give feedback.
All reactions