算法评测平台前端。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
赵俊哲 6005d191a8 bugfix: 修改静态资源路径问题 3 years ago
bin Add code format 6 years ago
docs 更正 5 years ago
libs bugfix: 修复比赛加分异常的情况。 5 years ago
migrates Add migration script to build statistics table 5 years ago
models bugfix: 解决练习不能加分的bug。 5 years ago
models-built Merge branch 'feature/unlimited-reply' of https://git.fanruan.com/zhaojunzhe/fair-web 5 years ago
modules bugfix: 修复练习功能异常 5 years ago
static update: 替换cdn,把cdn资源下载到本地 3 years ago
uploads Add non-traditional problem support; add problem additional_file 7 years ago
views bugfix: 修改静态资源路径问题 3 years ago
.babelrc Initial commit 8 years ago
.editorconfig Add .editorconfig 7 years ago
.gitignore 默认不公开代码,自己选择公开 5 years ago
LICENSE Initial commit 8 years ago
README.md 更正 5 years ago
app.js Disable bluebird warning wForgottenReturn 5 years ago
config-example.json Limit redis cache size of renderer by using a LRU cache 5 years ago
language-config.json Finish monaco editor 5 years ago
package.json Limit redis cache size of renderer by using a LRU cache 5 years ago
tsconfig.json Move to TypeORM 5 years ago
utility.js 排名显示昵称 5 years ago
yarn.lock Limit redis cache size of renderer by using a LRU cache 5 years ago

README.md

一个用于算法学习和竞赛的在线评测系统,主要用于帆软开发和测试团队。

部署

服务器要求

Ubuntu 18.04(64位)

环境准备

评测机使用的沙箱需要使用boost库,因此需要安装boost

apt install build-essential libboost-all-dev

平台系统依赖NodeJS运行环境(目前测试下来仅支持8.x版本)

apt install nodejs

评测系统的前端和评测机之间通过rabbitmq通信,评测时需要使用7zip对用例进行解压

apt install rabbitmq-server p7zip-full

web服务器

apt install nginx

Redis 5.0.x版本

参见文档:安装最新的Redis

MariaDB 10.4版本

参见文档:安装MariaDB

安装完成后进入数据库命令行

mysql -uroot -p

创建OJ所需要的数据库

CREATE DATABASE syzoj;
ALTER DATABASE syzoj CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
CREATE USER 'syzoj'@'localhost' IDENTIFIED BY '[your_password]';
GRANT ALL ON syzoj.* TO 'syzoj'@'localhost';
FLUSH PRIVILEGES;

注意: Redis和MariaDB均需要创建systemd系统服务,要注意检查。

修改内存控制内核选项

simple-sandbox 使用了 cgroup 来进行内存用量控制,该过程需要用到 memory.memsw(控制内存和交换空间的总用量)。一些 Linux 发行版的内核在默认情况下,没有启用这个内核选项,你需要手动启用它。

检查文件 /sys/fs/cgroup/memory/memory.memsw.usage_in_bytes 是否存在。如果不存在,你需要使用你的 grub 启用。 打开 /etc/default/grub,找到其中的

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

这一行(引号内内容可能有不同),在其后添加 cgroup_enable=memory swapaccount=1。以上述为例,添加后该行应为

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash cgroup_enable=memory swapaccount=1"

修改后执行

update-grub && reboot

来更新 grub 配置并重启。重启后,重新检查文件 /sys/fs/cgroup/memory/memory.memsw.usage_in_bytes 是否存在。

部署沙箱

这个链接下载 sandbox-rootfs,使用 root 权限解压到根目录下。

源码构建和配置

参见这里