Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.idea
uoj_data/
confs/
.php-cs-fixer.cache
.config.local.php
*.pcap
7 changes: 5 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ services:
dockerfile: Dockerfile
container_name: uoj-db
restart: always
ports:
- "3306:3306"
volumes:
- ./uoj_data/db/mysql:/var/lib/mysql
environment:
- MYSQL_DATABASE=app_uoj233
- MYSQL_ROOT_PASSWORD=root

uoj-judger:
image: ghcr.io/universaloj/uoj-judger:latest
image: yanagiorigami/uoj-judger:latest
build:
context: ./judger/
dockerfile: Dockerfile
Expand All @@ -27,6 +29,7 @@ services:
- SYS_PTRACE
volumes:
- ./uoj_data/judger/log:/opt/uoj_judger/log
#- ./judger/uoj_judger/include:/opt/uoj_judger/include
environment:
- UOJ_PROTOCOL=http
- UOJ_HOST=uoj-web
Expand All @@ -36,7 +39,7 @@ services:
- SOCKET_PASSWORD=_judger_socket_password_

uoj-web:
image: ghcr.io/universaloj/uoj-web:latest
image: yanagiorigami/uoj-web:latest
build:
context: ./
dockerfile: web/Dockerfile
Expand Down
5 changes: 4 additions & 1 deletion judger/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ARG CLONE_ADDFLAG
RUN apt-get update && \
apt-get install -y --no-install-recommends gnupg ca-certificates apt-transport-https && \
apt-get update && \
for pkg in git vim ntp zip unzip curl wget build-essential fp-compiler python python3 python3-requests openjdk-8-jdk openjdk-11-jdk tzdata; do \
for pkg in git vim ntp zip unzip curl wget build-essential fp-compiler python python3 python3-requests pypy3 openjdk-8-jdk openjdk-11-jdk tzdata; do \
cnt=10 && \
while ! apt-get install -y "$pkg"; do \
if [ $cnt -le 0 ]; then \
Expand All @@ -23,6 +23,9 @@ RUN apt-get update && \
done; \
done

ENV PYTHONNOUSERSITE=1
ENV PYTHONDONTWRITEBYTECODE=1

ADD . /opt/uoj_judger
WORKDIR /opt/uoj_judger

Expand Down
16 changes: 16 additions & 0 deletions judger/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@
getAptPackage(){
printf "\n\n==> Getting environment packages\n"
export DEBIAN_FRONTEND=noninteractive

apt-get update && apt-get install -y software-properties-common

# ✅ 添加新的 GCC 工具链源
add-apt-repository ppa:ubuntu-toolchain-r/test -y
apt-get update

# ✅ 安装 g++-13
apt-get install -y g++-13 gcc-13

# ✅ 设置 g++ 默认版本为 g++-13
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100

apt-get update && apt-get install -y vim ntp zip unzip curl wget build-essential fp-compiler python2.7 python3.8 python3-requests
apt-get install -y pypy3
}

setJudgeConf(){
Expand All @@ -26,6 +41,7 @@ cat >uoj_judger/include/uoj_work_path.h <<UOJEOF
#define UOJ_JUDGER_BASESYSTEM_UBUNTU1804
#define UOJ_JUDGER_PYTHON3_VERSION "3.8"
#define UOJ_JUDGER_FPC_VERSION "3.0.4"
#define UOJ_PYPY3_VERSION "3.6"
UOJEOF
cd uoj_judger && make -j$(($(nproc) + 1))
EOD
Expand Down
2 changes: 1 addition & 1 deletion judger/uoj_judger/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ checker: $(EXE_CHECKER)
run/run_program: include/uoj_env.h run/run_program_conf.h
run/formatter : include/testlib.h
run/run_interaction: run/run_interaction.cpp include/uoj_env.h
$(CXX) $(CXXFLAGS) --std=c++11 -pthread $< -o $@
$(CXX) $(CXXFLAGS) --std=c++17 -O2 -pthread $< -o $@

builtin/judger/judger: include
main_judger: include
Expand Down
5,577 changes: 4,116 additions & 1,461 deletions judger/uoj_judger/include/testlib.h

Large diffs are not rendered by default.

Loading