From d48b2e7bdc2fbf324b168c59218012e3d2785ffe Mon Sep 17 00:00:00 2001 From: virusdefender Date: Wed, 6 Dec 2017 12:02:01 +0800 Subject: [PATCH] update doc --- docs/judger/api.md | 1 + docs/judgeserver/deploy.md | 47 +++++--------------------------------- 2 files changed, 7 insertions(+), 41 deletions(-) diff --git a/docs/judger/api.md b/docs/judger/api.md index 0460865..b82fe1a 100644 --- a/docs/judger/api.md +++ b/docs/judger/api.md @@ -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` diff --git a/docs/judgeserver/deploy.md b/docs/judgeserver/deploy.md index 9962fb7..0fc0534 100644 --- a/docs/judgeserver/deploy.md +++ b/docs/judgeserver/deploy.md @@ -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