Skip to content

Commit 2e97233

Browse files
authored
release: v0.3.2 Triangle Patch 2
release: v0.3.2 Triangle Patch 2
2 parents ecb27c5 + fb40f12 commit 2e97233

File tree

4 files changed

+60
-14
lines changed

4 files changed

+60
-14
lines changed

Dockerfile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,35 @@ LABEL org.opencontainers.image.vendor="NJUPTAAA"
55
LABEL org.opencontainers.image.documentation="https://njuptaaa.github.io/docs/#/judgeserver/deploy"
66

77
COPY build/java_policy /etc
8+
COPY --chmod=0755 build/nojasm-compiler /usr/bin
89

910
RUN buildDeps='software-properties-common git libtool cmake python-dev python3-pip python-pip libseccomp-dev wget ncurses-dev curl' && \
1011
export DEBIAN_FRONTEND=noninteractive && \
1112
apt-get update && \
1213
apt-get install -y \
1314
python \
14-
python3.7 \
1515
python-pkg-resources \
1616
python3-pkg-resources \
1717
fp-compiler \
1818
rustc \
1919
haskell-platform \
2020
gcc \
2121
g++ \
22+
gcc-multilib \
23+
nasm \
2224
ruby \
2325
mono-runtime \
2426
mono-mcs \
27+
iverilog \
2528
apt-transport-https \
2629
lsb-release \
2730
ca-certificates \
2831
$buildDeps && \
2932
curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && \
30-
add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk && \
33+
add-apt-repository ppa:deadsnakes/ppa && apt-get update && apt-get install -y python3.10 && \
34+
add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk openjdk-17-jdk && \
3135
add-apt-repository ppa:longsleep/golang-backports && apt-get update && apt-get install -y golang-go && \
32-
add-apt-repository ppa:ondrej/php && apt-get update && apt-get install -y php7.3-cli && \
36+
add-apt-repository ppa:ondrej/php && apt-get update && apt-get install -y php8.1-cli && \
3337
cd /tmp && wget -O FreeBASIC.tar.gz https://versaweb.dl.sourceforge.net/project/fbc/FreeBASIC-1.09.0/Binaries-Linux/ubuntu-18.04/FreeBASIC-1.09.0-ubuntu-18.04-x86_64.tar.gz && \
3438
tar zxvf FreeBASIC.tar.gz && rm -f FreeBASIC.tar.gz && cd /tmp/FreeBASIC-1.09.0-ubuntu-18.04-x86_64 && ./install.sh -i && cd /tmp && rm -rf /tmp/FreeBASIC-1.09.0-ubuntu-18.04-x86_64 && \
3539
pip3 install -I --no-cache-dir psutil gunicorn flask requests idna && \
@@ -41,7 +45,12 @@ RUN buildDeps='software-properties-common git libtool cmake python-dev python3-p
4145
mkdir -p /code && \
4246
useradd -u 12001 compiler && useradd -u 12002 code && useradd -u 12003 spj && usermod -a -G code spj
4347

44-
ENV NJS_VERSION v0.3.0-Triangle
48+
RUN ln -sfn /usr/lib/jvm/java-17-openjdk-amd64/bin/java /usr/bin/java17 && \
49+
ln -sfn /usr/lib/jvm/java-17-openjdk-amd64/bin/javac /usr/bin/javac17 && \
50+
ln -sfn /usr/lib/jvm/java-8-openjdk-amd64/bin/java /usr/bin/java8 && \
51+
ln -sfn /usr/lib/jvm/java-8-openjdk-amd64/bin/javac /usr/bin/javac8
52+
53+
ENV NJS_VERSION v0.3.2-Triangle
4554

4655
ADD server /code
4756
WORKDIR /code

Dockerfile.cn

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LABEL org.opencontainers.image.vendor="NJUPTAAA"
55
LABEL org.opencontainers.image.documentation="https://njuptaaa.github.io/docs/#/judgeserver/deploy"
66

77
COPY build/java_policy /etc
8+
COPY --chmod=0755 build/nojasm-compiler /usr/bin
89

910
RUN sed -i s/archive.ubuntu.com/mirrors.aliyun.com/g /etc/apt/sources.list && \
1011
sed -i s/security.ubuntu.com/mirrors.aliyun.com/g /etc/apt/sources.list && \
@@ -14,25 +15,28 @@ RUN sed -i s/archive.ubuntu.com/mirrors.aliyun.com/g /etc/apt/sources.list && \
1415
apt-get update && \
1516
apt-get install -y \
1617
python \
17-
python3.7 \
1818
python-pkg-resources \
1919
python3-pkg-resources \
2020
fp-compiler \
2121
rustc \
2222
haskell-platform \
2323
gcc \
2424
g++ \
25+
gcc-multilib \
26+
nasm \
2527
ruby \
2628
mono-runtime \
2729
mono-mcs \
30+
iverilog \
2831
apt-transport-https \
2932
lsb-release \
3033
ca-certificates \
3134
$buildDeps && \
3235
curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && \
33-
add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk && \
36+
add-apt-repository ppa:deadsnakes/ppa && apt-get update && apt-get install -y python3.10 && \
37+
add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk openjdk-17-jdk && \
3438
add-apt-repository ppa:longsleep/golang-backports && apt-get update && apt-get install -y golang-go && \
35-
add-apt-repository ppa:ondrej/php && apt-get update && apt-get install -y php7.3-cli && \
39+
add-apt-repository ppa:ondrej/php && apt-get update && apt-get install -y php8.1-cli && \
3640
cd /tmp && wget -O FreeBASIC.tar.gz https://versaweb.dl.sourceforge.net/project/fbc/FreeBASIC-1.09.0/Binaries-Linux/ubuntu-18.04/FreeBASIC-1.09.0-ubuntu-18.04-x86_64.tar.gz && \
3741
tar zxvf FreeBASIC.tar.gz && rm -f FreeBASIC.tar.gz && cd /tmp/FreeBASIC-1.09.0-ubuntu-18.04-x86_64 && ./install.sh -i && cd /tmp && rm -rf /tmp/FreeBASIC-1.09.0-ubuntu-18.04-x86_64 && \
3842
pip3 install -I --no-cache-dir psutil gunicorn flask requests idna && \
@@ -44,7 +48,7 @@ RUN sed -i s/archive.ubuntu.com/mirrors.aliyun.com/g /etc/apt/sources.list && \
4448
mkdir -p /code && \
4549
useradd -u 12001 compiler && useradd -u 12002 code && useradd -u 12003 spj && usermod -a -G code spj
4650

47-
ENV NJS_VERSION v0.3.0-Triangle
51+
ENV NJS_VERSION v0.3.2-Triangle
4852

4953
ADD server /code
5054
WORKDIR /code

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,15 @@ NOJ JudgeServer is driven by Babel Extension NOJ, see [Babel Extension NOJ](http
6262
|Language|Compile/Run Command|
6363
|--------|-------------------|
6464
|C|/usr/bin/gcc -DONLINE_JUDGE -O2 -w -fmax-errors=3 -std=c99 {src_path} -lm -o {exe_path}|
65+
|C 11|/usr/bin/gcc -DONLINE_JUDGE -O2 -w -fmax-errors=3 -std=c11 {src_path} -lm -o {exe_path}|
6566
|C++|/usr/bin/g++ -DONLINE_JUDGE -O2 -w -fmax-errors=3 -std=c++11 {src_path} -lm -o {exe_path}|
66-
|Java|/usr/bin/javac {src_path} -d {exe_dir} -encoding UTF8<br>/usr/bin/java -cp {exe_dir} -XX:MaxRAM={max_memory}k -Djava.security.manager -Dfile.encoding=UTF-8 -Djava.security.policy==/etc/java_policy -Djava.awt.headless=true Main|
67-
|Python2|/usr/bin/python -m py_compile {src_path}<br>/usr/bin/python {exe_path}|
68-
|Python3|/usr/bin/python3.7 -m py_compile {src_path}<br>/usr/bin/python3.7 {exe_path}|
69-
|PHP7|/usr/bin/php {exe_path}|
67+
|C++ 14|/usr/bin/g++ -DONLINE_JUDGE -O2 -w -fmax-errors=3 -std=c++14 {src_path} -lm -o {exe_path}|
68+
|C++ 17|/usr/bin/g++ -DONLINE_JUDGE -O2 -w -fmax-errors=3 -std=c++17 {src_path} -lm -o {exe_path}|
69+
|Java 8|/usr/bin/javac8 {src_path} -d {exe_dir} -encoding UTF8<br>/usr/bin/java8 -cp {exe_dir} -XX:MaxRAM={max_memory}k -Djava.security.manager -Dfile.encoding=UTF-8 -Djava.security.policy==/etc/java_policy -Djava.awt.headless=true Main|
70+
|Java 17|/usr/bin/javac17 {src_path} -d {exe_dir} -encoding UTF8<br>/usr/bin/java17 -cp {exe_dir} -XX:MaxRAM={max_memory}k -Djava.security.manager -Dfile.encoding=UTF-8 -Djava.security.policy==/etc/java_policy -Djava.awt.headless=true Main|
71+
|Python 2.7|/usr/bin/python2.7 -m py_compile {src_path}<br>/usr/bin/python2.7 {exe_path}|
72+
|Python 3.10|/usr/bin/python3.10 -m py_compile {src_path}<br>/usr/bin/python3.10 {exe_path}|
73+
|PHP 8.1|/usr/bin/php {exe_path}|
7074
|Node.js 16|/usr/bin/node --stack-size=65536 {exe_path}|
7175
|Go|/usr/bin/go build -o {exe_path} {src_path}|
7276
|C#|/usr/bin/mcs -optimize+ -out:{exe_path} {src_path}|
@@ -76,8 +80,9 @@ NOJ JudgeServer is driven by Babel Extension NOJ, see [Babel Extension NOJ](http
7680
|Free Pascal|/usr/bin/fpc -O2 -o{exe_path} {src_path}|
7781
|Plaintext|/bin/cat {exe_path}|
7882
|Free Basic|/usr/local/bin/fbc {src_path}|
79-
80-
> Besides, `C++14`, `C++17` and `C11` are also supported, they are standards thus would not be listed from above.
83+
|Assembly (32bit)|/usr/bin/nasm -f elf32 -o {exe_path}.o {src_path} && /usr/bin/gcc -m32 -o {exe_path} {exe_path}.o|
84+
|Assembly (64bit)|/usr/bin/nasm -f elf64 -o {exe_path}.o {src_path} && /usr/bin/gcc -o {exe_path} {exe_path}.o|
85+
|SystemVerilog 2012|/usr/bin/iverilog -g2012 -o {exe_path} {src_path}<br>/usr/bin/vvp {exe_path}|
8186

8287
## Special Judge Support
8388

build/nojasm-compiler

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
target_arch=$1
4+
exe_path=$2
5+
src_path=$3
6+
7+
if (($target_arch == 32)); then
8+
/usr/bin/nasm -f elf32 -o $exe_path.o $src_path
9+
status=$?
10+
if (($status == 0)); then
11+
/usr/bin/gcc -m32 -o $exe_path $exe_path.o
12+
else
13+
echo ASM Compilation Fatal Error >&2
14+
exit $status
15+
fi
16+
elif (($target_arch == 64)); then
17+
/usr/bin/nasm -f elf64 -o $exe_path}.o $src_path
18+
status=$?
19+
if (($status == 0)); then
20+
/usr/bin/gcc -o $exe_path $exe_path.o
21+
else
22+
echo ASM Compilation Fatal Error >&2
23+
exit $status
24+
fi
25+
else
26+
echo Unsupported Arch >&2
27+
exit 1
28+
fi

0 commit comments

Comments
 (0)