Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): 在 code.md 中添加关于 nfs 的描述 #1704

Merged
merged 2 commits into from
Apr 1, 2024
Merged
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 docs/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ permalink: /code
4. 若语言为解释型语言(`py`),则前端更改数据库`compile_status`为`No Need`(可与第二步合并)
5. 若语言为编译型语言(`cpp`),则前端向后端发请求`/code/compile-start`(见后),使后端开始编译代码
6. 后端下载`cos`上的代码文件,在服务器上启动编译`docker`,并在数据库中更新`compile_status`为`Compiling`
- 选手代码文件在`cos`中,后端需要从`cos`上临时下载队伍的代码到后端服务器上。后端服务器存储空间有限,需要定期清理下载的队伍代码和文件。
- 后端服务器和`docker`服务器是分离的,`docker`服务器并不能直接获取队伍代码。因此,后端服务器与`docker`服务器之间通过[NFS](https://eesast.github.io/web/nfs)进行文件共享,`docker`服务器自动同步了队伍文件。(备注:建议提前服务器之间组内网减少流量费。)
7. `docker`完成编译后,请求后端`/code/compile-finish`路由(见后)。若编译成功无报错,后端在数据库中更新`compile_status`为`Completed`;若编译出错,后端在数据库中更新`compile_status`为`Failed`
8. 后端将`docker`生成的可执行文件`${code_id}`与`${code_id}.log`上传至`cos`,同代码文件夹
9. 前端通过`subscription`实时更新`compile_status`
Expand Down
Loading