-
Notifications
You must be signed in to change notification settings - Fork 0
도커 기반 컴파일 파이프라인 구현 #22
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
Comments
domjudgebuildscript switch ($execlang) {
case 'c':
$buildscript .= "gcc -Wall -O2 -std=gnu11 $source -o run -lm\n";
break;
case 'cpp':
$buildscript .= "g++ -Wall -O2 -std=gnu++20 $source -o run\n";
break;
case 'java':
$buildscript .= "javac -cp . -d . $source\n";
$buildscript .= "echo '#!/bin/sh' > run\n";
// no main class detection here
$buildscript .= "echo 'COMPARE_DIR=\$(dirname \"\$0\")' >> run\n";
$mainClass = basename($unescapedSource, '.java');
// Note: since the $@ is within single quotes, we do not need to double escape it.
$buildscript .= "echo 'java -cp \"\$COMPARE_DIR\" $mainClass \"\$@\"' >> run\n";
$buildscript .= "chmod +x run\n";
break;
case 'py':
$buildscript .= "echo '#!/bin/sh' > run\n";
$buildscript .= "echo 'COMPARE_DIR=\$(dirname \"\$0\")' >> run\n";
// Note: since the $@ is within single quotes, we do not need to double escape it.
$buildscript .= "echo 'python3 \"\$COMPARE_DIR/$source\" \"\$@\"' >> run\n";
$buildscript .= "chmod +x run\n";
break;
} 쉘스크립트 작성하여 빌드 및 실행합니다. |
DMOJGrader: 채점 호출def _launch_process(self, case: TestCase, input_file=None) -> None:
self._current_proc = self.binary.launch(
time=self.problem.time_limit,
memory=self.problem.memory_limit,
symlinks=case.config.symlinks,
stdin=input_file or subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
wall_time=case.config.wall_time_factor * self.problem.time_limit,
) Grader에서 테스트 케이스와 인풋 데이터를 가지고 채점을 요청합니다. Executer: 채점 준비
BaseExecuter > CompiledExecuter > (CLikeExecuter, JavaExecuter, PythonExecuter ...) CompiledExecuter의 메타클래스를 활용하여 모든 생성자가 실행된 이후 Executable이 상속 과정에서 생성됩니다. TracedPopen: 채점 진행BaseExecuter에서 아래 launch 함수 호출시 채점 프로세스가 실행됩니다. def launch(self, *args, **kwargs) -> TracedPopen:
...
return TracedPopen(
[utf8bytes(a) for a in self.get_cmdline(**kwargs) + list(args)],
executable=utf8bytes(executable),
security=self.get_security(launch_kwargs=kwargs, extra_fs=kwargs.get('extra_fs')),
address_grace=self.get_address_grace(),
data_grace=self.data_grace,
personality=self.personality,
time=kwargs.get('time', 0),
memory=kwargs.get('memory', 0),
wall_time=kwargs.get('wall_time'),
stdin=kwargs.get('stdin'),
stdout=kwargs.get('stdout'),
stderr=kwargs.get('stderr'),
env=child_env,
cwd=utf8bytes(self._dir),
nproc=self.get_nproc(),
fsize=self.fsize,
cpu_affinity=env.submission_cpu_affinity,
) |
CMShttps://justicehui.github.io/etc/2021/05/18/cms-1/ 제가 찾던 채점 시스템 분석 여기 있네요 |
https://github.com/Bibimbap-Team/rpc-playground
|
|
위 일련의 과정을 구현합니다.
The text was updated successfully, but these errors were encountered: