SB-JUDGER 🤪
◦ ► 使用 Go 语言开发的轻量 OnlineJudge Server.
🖼️ 截图

📝 简介
sandbox-judger 使用 LXC 技术,为用户提交每一个的代码进程创建一个沙箱,并在指定的系统资源下运行程序,达到安全判题的效果。
它使用 namespace、cgroup 来隔离资源,使用 overlayfs 作为 Unionfs。
目前 sb-judger 还不支持 cgroupv1,在使用前请确保运行环境使用的是 cgroupv2。
🚀 开始
🔧 安装
- 克隆仓库:
git clone https://github.com/msqtt/sb-judger
- 切换目录:
cd sb-judger
- 制作 rootfs:
make rootfs
如果你有自己的 rootfs 请忽略这步
mkdir rootfs
后,直接把根目录解压到 rootfs
即可。
- 开始构建:
make build
🤖 启动
./sb-judger
打开运行代码测试页面 :
open http://localhost:8080
🐬 Docker
使用我的
docker pull msqt/sb-judger:latest
docker run --privileged -d -p8080:8080 -p9090:9090 msqt/sb-judger
自己构建
APP_IMAGE_NAME=xxx APP_IMAGE_TAG=0.1.0 make docker
🌐 API
sb-judger 使用 grpc
和 http
作为通讯协议,且使用 grpc-http-gateway
提供 http
服务。
⚙️ 配置
- 语言配置
- 软件配置
- 可以直接通过环境变量传入,比如:
HTTP_ADDR=0.0.0.0:8080 ./sb-judger
,docker 也是同理。
🛣 路线
-
ℹ️ Support cgroupv2
-
ℹ️ Test
-
ℹ️ Metric API
-
ℹ️ ...
🧮 支持语言
-
ℹ️ c/cpp
-
ℹ️ golang
-
ℹ️ python
-
ℹ️ java
-
ℹ️ rust
-
ℹ️ ...
🤝 Contributing
Contributions are welcome! Here are several ways you can contribute:
Contributing Guidelines
Click to expand
- Fork the Repository: Start by forking the project repository to your GitHub account.
- Clone Locally: Clone the forked repository to your local machine using a Git client.
git clone <your-forked-repo-url>
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear and concise message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to GitHub: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
Once your PR is reviewed and approved, it will be merged into the main branch.
📄 License
This project is protected under the MPL2 License. For more details, refer to the LICENSE file.