mirror of
https://github.com/QingdaoU/oj-docs.git
synced 2025-01-16 00:22:52 +00:00
update doc
This commit is contained in:
parent
2ef7ae7bfb
commit
d48b2e7bdc
@ -34,6 +34,7 @@ mkdir build && cd build && cmake .. && make && sudo make install
|
|||||||
|
|
||||||
- `cpu_time`: cpu time the process has used
|
- `cpu_time`: cpu time the process has used
|
||||||
- `real_time`: actual running time of the process
|
- `real_time`: actual running time of the process
|
||||||
|
- `real_time`: max vaule of memory used by the processd
|
||||||
- `signal`: signal number
|
- `signal`: signal number
|
||||||
- `exit_code`: process's exit code
|
- `exit_code`: process's exit code
|
||||||
- `result`: judger result, details in `runner.h`
|
- `result`: judger result, details in `runner.h`
|
||||||
|
@ -7,59 +7,24 @@ Reuqirements:
|
|||||||
|
|
||||||
Docker images:
|
Docker images:
|
||||||
|
|
||||||
- docker pull qduoj/judge_server (from Docker Hub)
|
- docker pull registry.cn-hangzhou.aliyuncs.com/onlinejudge/judge_server
|
||||||
- docker pull registry.cn-hangzhou.aliyuncs.com/v-image/judge_server && docker tag registry.cn-hangzhou.aliyuncs.com/v-image/judge_server qduoj/judge_server (from Aliyun mirror)
|
|
||||||
|
|
||||||
Three environment variables below must be set manually in `docker-compose.yml`
|
Three environment variables below must be set manually in `docker-compose.yml`
|
||||||
|
|
||||||
- `service_discovery_url`
|
- `SERVICE_URL`
|
||||||
- `service_url`
|
- `BACKEND_URL`
|
||||||
|
- `TOKEN`
|
||||||
|
|
||||||
You should manually create `token.txt` to store `judger_token`.
|
`judge_server` will send heartbeat request to `backend_url` every five seconds.
|
||||||
|
|
||||||
`judge_server` will send heartbeat request to `service_discovery_url` every five seconds.
|
|
||||||
|
|
||||||
`service_url` is used to tell server to send task to this url(`judge_server`).
|
`service_url` is used to tell server to send task to this url(`judge_server`).
|
||||||
|
|
||||||
Example of `docker-compose.yml`
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: "2"
|
|
||||||
services:
|
|
||||||
judge_server:
|
|
||||||
image: qduoj/judge_server
|
|
||||||
cpu_quota: 90000
|
|
||||||
read_only: true
|
|
||||||
cap_drop:
|
|
||||||
- SETPCAP
|
|
||||||
- MKNOD
|
|
||||||
- NET_BIND_SERVICE
|
|
||||||
- SYS_CHROOT
|
|
||||||
- SETFCAP
|
|
||||||
- FSETID
|
|
||||||
tmpfs:
|
|
||||||
- /tmp
|
|
||||||
- /judger_run:exec,mode=777
|
|
||||||
- /spj:exec,mode=777
|
|
||||||
volumes:
|
|
||||||
- $PWD/tests/test_case:/test_case:ro
|
|
||||||
- /data/log:/log
|
|
||||||
- $PWD/server:/code:ro
|
|
||||||
- $PWD/token.txt:/token.txt
|
|
||||||
environment:
|
|
||||||
- service_discovery_url=https://virusdefender.net/service.php
|
|
||||||
- service_url=http://1.2.3.4:12358
|
|
||||||
ports:
|
|
||||||
- "0.0.0.0:12358:8080"
|
|
||||||
```
|
|
||||||
|
|
||||||
# Heartbeat request
|
# Heartbeat request
|
||||||
|
|
||||||
- `Method`: `POST`
|
- `Method`: `POST`
|
||||||
- `X-JUDGE-SERVER-TOKEN`: `sha256(token)`
|
- `X-JUDGE-SERVER-TOKEN`: `sha256(token).hex`
|
||||||
- `Content-Type`: `application/json`
|
- `Content-Type`: `application/json`
|
||||||
|
|
||||||
|
|
||||||
Request data
|
Request data
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
Loading…
x
Reference in New Issue
Block a user