feat(judger): upgrade to ubuntu:20.04

This commit is contained in:
Baoshuo Ren 2022-03-16 20:10:44 +08:00
parent 4b54cf7560
commit e92b8a4e36
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
4 changed files with 18 additions and 8 deletions

View File

@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM ubuntu:20.04
ARG CLONE_ADDFLAG

View File

@ -8,6 +8,10 @@ getAptPackage(){
setJudgeConf(){
printf "\n\n==> Setting judger files\n"
#specify environment
cat > /etc/environment <<UOJEOF
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
UOJEOF
#Add judger user
adduser judger --gecos "" --disabled-password
#Set uoj_data path

View File

@ -193,6 +193,7 @@ int syscall_max_cnt_list_default[][2] = {
{__NR_write , -1},
{__NR_readv , -1},
{__NR_writev , -1},
{__NR_pread64 , -1},
{__NR_open , -1},
{__NR_unlink , -1},
{__NR_close , -1},
@ -395,7 +396,7 @@ void init_conf(const RunProgramConfig &config) {
statable_file_name_set.insert("/usr/bin");
statable_file_name_set.insert("/usr/lib");
# ifdef UOJ_JUDGER_BASESYSTEM_UBUNTU1804
statable_file_name_set.insert("/usr/lib/python36.zip");
statable_file_name_set.insert("/usr/lib/python38.zip");
# endif
} else if (config.type == "java8") {
syscall_max_cnt[__NR_gettid ] = -1;
@ -408,6 +409,7 @@ void init_conf(const RunProgramConfig &config) {
syscall_max_cnt[__NR_clone ] = 13;
syscall_max_cnt[__NR_getdents ] = 4;
syscall_max_cnt[__NR_getdents64 ] = 4;
syscall_max_cnt[__NR_clock_getres ] = 2;
@ -455,6 +457,7 @@ void init_conf(const RunProgramConfig &config) {
syscall_max_cnt[__NR_clone ] = 14;
syscall_max_cnt[__NR_getdents ] = 4;
syscall_max_cnt[__NR_getdents64 ] = 4;
syscall_max_cnt[__NR_clock_getres ] = 2;
@ -474,6 +477,7 @@ void init_conf(const RunProgramConfig &config) {
syscall_max_cnt[__NR_pread64 ] = -1;
syscall_max_cnt[__NR_prctl ] = -1;
syscall_max_cnt[__NR_nanosleep ] = -1;
syscall_max_cnt[__NR_clock_nanosleep] = -1;
# endif
syscall_should_soft_ban[__NR_socket ] = true;
@ -518,6 +522,7 @@ void init_conf(const RunProgramConfig &config) {
syscall_max_cnt[__NR_setrlimit ] = -1;
syscall_max_cnt[__NR_pipe ] = -1;
syscall_max_cnt[__NR_pipe2 ] = -1;
syscall_max_cnt[__NR_getdents64 ] = -1;
syscall_max_cnt[__NR_getdents ] = -1;
@ -544,6 +549,7 @@ void init_conf(const RunProgramConfig &config) {
syscall_max_cnt[__NR_pread64 ] = -1;
syscall_max_cnt[__NR_prctl ] = -1;
syscall_max_cnt[__NR_nanosleep ] = -1;
syscall_max_cnt[__NR_clock_nanosleep] = -1;
syscall_max_cnt[__NR_socketpair ] = -1;
# endif

View File

@ -47,13 +47,13 @@
</div>
<div id="collapseThree" class="collapse">
<div class="card-body">
<p>默认的测评环境是 Ubuntu Linux 18.04 LTS x64。</p>
<p>C的编译器是 gcc 7.4.0,编译命令:<code>gcc code.c -o code -lm -O2 -DONLINE_JUDGE</code></p>
<p>C++的编译器是 g++ 7.4.0,编译命令:<code>g++ code.cpp -o code -lm -O2 -DONLINE_JUDGE</code>。如果选择C++11会在编译命令后面添加<code>-std=c++11</code></p>
<p>Java8的JDK版本是 openjdk 1.8.0_222,编译命令:<code>javac code.java</code></p>
<p>Java11的JDK版本是 openjdk 11.0.4,编译命令:<code>javac code.java</code></p>
<p>默认的测评环境是 Ubuntu Linux 20.04 LTS x64。</p>
<p>C的编译器是 gcc 9.4.0,编译命令:<code>gcc code.c -o code -lm -O2 -DONLINE_JUDGE</code></p>
<p>C++的编译器是 g++ 9.4.0,编译命令:<code>g++ code.cpp -o code -lm -O2 -DONLINE_JUDGE</code>。如果选择C++11会在编译命令后面添加<code>-std=c++11</code></p>
<p>Java8的JDK版本是 openjdk 1.8.0_312,编译命令:<code>javac code.java</code></p>
<p>Java11的JDK版本是 openjdk 11.0.14,编译命令:<code>javac code.java</code></p>
<p>Pascal的编译器是 fpc 3.0.4,编译命令:<code>fpc code.pas -O2</code></p>
<p>Python会先编译为优化过的字节码<samp>.pyo</samp>文件。支持的Python版本分别为Python 2.7和3.6</p>
<p>Python会先编译为优化过的字节码<samp>.pyo</samp>文件。支持的Python版本分别为Python 2.7和3.8</p>
</div>
</div>
</div>