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 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
sb-judger 使用 grpc
和 http
作为通讯协议,且使用 grpc-http-gateway
提供 http
服务。
ℹ️ Support cgroupv2
ℹ️ Test
ℹ️ Metric API
ℹ️ ...
ℹ️ c/cpp
ℹ️ golang
ℹ️ python
ℹ️ java
ℹ️ rust
ℹ️ ...
Contributions are welcome! Here are several ways you can contribute:
- Submit Pull Requests: Review open PRs, and submit your own PRs.
- Join the Discussions: Share your insights, provide feedback, or ask questions.
- Report Issues: Submit bugs found or log feature requests for MSQTT.
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.
This project is protected under the MPL2 License. For more details, refer to the LICENSE file.