mirror of
https://github.com/QingdaoU/oj-docs.git
synced 2024-12-28 07:21:43 +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
|
||||
- `real_time`: actual running time of the process
|
||||
- `real_time`: max vaule of memory used by the processd
|
||||
- `signal`: signal number
|
||||
- `exit_code`: process's exit code
|
||||
- `result`: judger result, details in `runner.h`
|
||||
|
@ -7,59 +7,24 @@ Reuqirements:
|
||||
|
||||
Docker images:
|
||||
|
||||
- docker pull qduoj/judge_server (from Docker Hub)
|
||||
- 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)
|
||||
- docker pull registry.cn-hangzhou.aliyuncs.com/onlinejudge/judge_server
|
||||
|
||||
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 `service_discovery_url` every five seconds.
|
||||
`judge_server` will send heartbeat request to `backend_url` every five seconds.
|
||||
|
||||
`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
|
||||
|
||||
- `Method`: `POST`
|
||||
- `X-JUDGE-SERVER-TOKEN`: `sha256(token)`
|
||||
- `X-JUDGE-SERVER-TOKEN`: `sha256(token).hex`
|
||||
- `Content-Type`: `application/json`
|
||||
|
||||
|
||||
Request data
|
||||
|
||||
```js
|
||||
|
Loading…
Reference in New Issue
Block a user