This commit is contained in:
virusdefender 2016-10-10 20:22:49 +08:00
parent 87f3d9d5e4
commit b4b4088dd7
3 changed files with 14 additions and 2 deletions

View File

@ -150,13 +150,18 @@
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
<li class="main active"><a href="#heartbeat-request">Heartbeat request</a></li>
<li class="main active"><a href="#deploy">Deploy</a></li>
<li class="main "><a href="#heartbeat-request">Heartbeat request</a></li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<h1 id="deploy">Deploy</h1>
<p>Reuqirements:</p>
<ul>
<li>docker &gt;= 1.12</li>
<li>docker-compose &gt;= 1.8</li>

View File

@ -182,7 +182,12 @@
},
{
"location": "/JudgeServer/English/deploy/",
"text": "docker \n= 1.12\n\n\ndocker-compose \n= 1.8\n\n\n\n\nThree environment variables below must be set manully in \ndocker-compose.yml\n\n\n\n\nservice_discovery_url\n\n\njudger_token\n\n\nservice_url\n\n\n\n\njudge_server\n will send heartbeat request to \nservice_discovery_url\n.\n\n\nservice_url\n is used to tell server to send task to this url(\njudge_server\n).\n\n\nExample of \ndocker-compose.yml\n\n\nversion: \n2\n\nservices:\n judge_server:\n image: judge_server\n cpu_quota: 90000\n read_only: true\n tmpfs:\n - /tmp\n - /judger_run\n - /spj\n volumes:\n - /data/JudgeServer/tests/test_case:/test_case:ro\n - /data/log:/log\n - /data/JudgeServer:/code:ro\n environment:\n - judger_token=token\n - service_discovery_url=https://onlinejudge.me/service\n - service_url=http://1.2.3.4:12358\n ports:\n - \n0.0.0.0:12358:8080\n\n\n\n\n\nHeartbeat request\n\n\n\n\nMethod \nPOST\n\n\nX-JUDGE-SERVER-TOKEN\n: \nsha256(token)\n\n\nContent-Type\n: \napplication/json\n\n\n\n\nRequest data\n\n\n {\n \njudger_version\n: \n2.0.1\n,\n \nhostname\n: \nc45acd557074\n,\n \ncpu_core\n: 1,\n \nmemory\n: 30.3,\n \naction\n: \nheartbeat\n,\n \ncpu\n: 0,\n \nservice_url\n: null or \nhttp://1.2.3.4:8005\n\n}\n\n\n\n\nIf everything is OK, you should give a JSON response as follows\n\n\n{\n \ndata\n: \nsuccess\n,\n \nerr\n: null\n}",
"text": "Deploy\n\n\nReuqirements:\n\n\n\n\ndocker \n= 1.12\n\n\ndocker-compose \n= 1.8\n\n\n\n\nThree environment variables below must be set manully in \ndocker-compose.yml\n\n\n\n\nservice_discovery_url\n\n\njudger_token\n\n\nservice_url\n\n\n\n\njudge_server\n will send heartbeat request to \nservice_discovery_url\n.\n\n\nservice_url\n is used to tell server to send task to this url(\njudge_server\n).\n\n\nExample of \ndocker-compose.yml\n\n\nversion: \n2\n\nservices:\n judge_server:\n image: judge_server\n cpu_quota: 90000\n read_only: true\n tmpfs:\n - /tmp\n - /judger_run\n - /spj\n volumes:\n - /data/JudgeServer/tests/test_case:/test_case:ro\n - /data/log:/log\n - /data/JudgeServer:/code:ro\n environment:\n - judger_token=token\n - service_discovery_url=https://onlinejudge.me/service\n - service_url=http://1.2.3.4:12358\n ports:\n - \n0.0.0.0:12358:8080\n\n\n\n\n\nHeartbeat request\n\n\n\n\nMethod \nPOST\n\n\nX-JUDGE-SERVER-TOKEN\n: \nsha256(token)\n\n\nContent-Type\n: \napplication/json\n\n\n\n\nRequest data\n\n\n {\n \njudger_version\n: \n2.0.1\n,\n \nhostname\n: \nc45acd557074\n,\n \ncpu_core\n: 1,\n \nmemory\n: 30.3,\n \naction\n: \nheartbeat\n,\n \ncpu\n: 0,\n \nservice_url\n: null or \nhttp://1.2.3.4:8005\n\n}\n\n\n\n\nIf everything is OK, you should give a JSON response as follows\n\n\n{\n \ndata\n: \nsuccess\n,\n \nerr\n: null\n}",
"title": "Deploy"
},
{
"location": "/JudgeServer/English/deploy/#deploy",
"text": "Reuqirements: docker = 1.12 docker-compose = 1.8 Three environment variables below must be set manully in docker-compose.yml service_discovery_url judger_token service_url judge_server will send heartbeat request to service_discovery_url . service_url is used to tell server to send task to this url( judge_server ). Example of docker-compose.yml version: 2 \nservices:\n judge_server:\n image: judge_server\n cpu_quota: 90000\n read_only: true\n tmpfs:\n - /tmp\n - /judger_run\n - /spj\n volumes:\n - /data/JudgeServer/tests/test_case:/test_case:ro\n - /data/log:/log\n - /data/JudgeServer:/code:ro\n environment:\n - judger_token=token\n - service_discovery_url=https://onlinejudge.me/service\n - service_url=http://1.2.3.4:12358\n ports:\n - 0.0.0.0:12358:8080",
"title": "Deploy"
},
{

View File

@ -1,3 +1,5 @@
# Deploy
Reuqirements:
- docker >= 1.12