mirror of
https://github.com/QingdaoU/oj-docs.git
synced 2024-12-28 23:41:43 +00:00
update
This commit is contained in:
parent
80e6e7f5a8
commit
0eb54be46c
239
docs/JudgeServer/Chinese/deploy/index.html
Normal file
239
docs/JudgeServer/Chinese/deploy/index.html
Normal file
@ -0,0 +1,239 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="../../../img/favicon.ico">
|
||||
|
||||
<title>部署 - Online Judge Docs</title>
|
||||
|
||||
<link href="../../../css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="../../../css/font-awesome-4.0.3.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="../../../css/highlight.css">
|
||||
<link href="../../../css/base.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
|
||||
<!-- Collapsed navigation -->
|
||||
<div class="navbar-header">
|
||||
<!-- Expander button -->
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
|
||||
<!-- Main title -->
|
||||
<a class="navbar-brand" href="../../..">Online Judge Docs</a>
|
||||
</div>
|
||||
|
||||
<!-- Expanded navigation -->
|
||||
<div class="navbar-collapse collapse">
|
||||
<!-- Main navigation -->
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../..">Home</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Judger <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../../Judger/">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../../Judger/English/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown active">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">JudgeServer <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../English/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../English/deploy/">Deploy</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">中文</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="active">
|
||||
<a href="./">部署</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- Search, Navigation and Repo links -->
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
|
||||
<i class="fa fa-search"></i> Search
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a rel="next" href="../">
|
||||
<i class="fa fa-arrow-left"></i> Previous
|
||||
</a>
|
||||
</li>
|
||||
<li class="disabled">
|
||||
<a rel="prev" >
|
||||
Next <i class="fa fa-arrow-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<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="#link">同主机link场景</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#_1">跨主机场景</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="col-md-9" role="main">
|
||||
|
||||
<h1 id="link">同主机link场景</h1>
|
||||
<p>oj_web_server和judge_server在同一台服务器上,而且judge_server中link oj_web_server。</p>
|
||||
<p>oj_web_server需要设置环境变量<code>judger_token</code>,这样<code>judge_server</code>就可以在<code>OJ_WEB_SERVER_ENV_judger_token</code>环境变量中得到token,在<code>OJ_WEB_SERVER_PORT_8080_TCP_ADDR</code>得到ip,在<code>OJ_WEB_SERVER_PORT_8080_TCP_PORT</code>得到端口,从而每5秒向该ip发送心跳包,在HTTP头中携带了<code>X-JUDGE-SERVER-TOKEN</code>,值为token的sha256。</p>
|
||||
<h1 id="_1">跨主机场景</h1>
|
||||
<p>如果不在同一台服务器上,需要手动设置judge_server的下面四个环境变量</p>
|
||||
<ul>
|
||||
<li><code>service_discovery_url</code></li>
|
||||
<li><code>judger_token</code></li>
|
||||
</ul>
|
||||
<p>通过以上两个环境变量这样就可以向该url发送心跳包了</p>
|
||||
<ul>
|
||||
<li><code>service_host</code></li>
|
||||
<li><code>service_port</code></li>
|
||||
</ul>
|
||||
<p>因为跨主机的情况下,oj_web_server是无法得知judge_server的ip和端口的,需要主动的设置,然后在心跳包中会带上这两个信息,让oj_web_server能够主动访问。此时judge_server只能使用固定端口映射。</p></div>
|
||||
</div>
|
||||
|
||||
<footer class="col-md-12">
|
||||
<hr>
|
||||
|
||||
<center>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</center>
|
||||
</footer>
|
||||
|
||||
<script src="../../../js/jquery-1.10.2.min.js"></script>
|
||||
<script src="../../../js/bootstrap-3.0.3.min.js"></script>
|
||||
<script src="../../../js/highlight.pack.js"></script>
|
||||
<script>var base_url = '../../..';</script>
|
||||
<script data-main="../../../mkdocs/js/search.js" src="../../../mkdocs/js/require.js"></script>
|
||||
<script src="../../../js/base.js"></script>
|
||||
|
||||
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="Search Modal" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title" id="exampleModalLabel">Search</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
From here you can search these documents. Enter
|
||||
your search terms below.
|
||||
</p>
|
||||
<form role="form">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query">
|
||||
</div>
|
||||
</form>
|
||||
<div id="mkdocs-search-results"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
420
docs/JudgeServer/Chinese/index.html
Normal file
420
docs/JudgeServer/Chinese/index.html
Normal file
@ -0,0 +1,420 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="../../img/favicon.ico">
|
||||
|
||||
<title>API - Online Judge Docs</title>
|
||||
|
||||
<link href="../../css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="../../css/font-awesome-4.0.3.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="../../css/highlight.css">
|
||||
<link href="../../css/base.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
|
||||
<!-- Collapsed navigation -->
|
||||
<div class="navbar-header">
|
||||
<!-- Expander button -->
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
|
||||
<!-- Main title -->
|
||||
<a class="navbar-brand" href="../..">Online Judge Docs</a>
|
||||
</div>
|
||||
|
||||
<!-- Expanded navigation -->
|
||||
<div class="navbar-collapse collapse">
|
||||
<!-- Main navigation -->
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../..">Home</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Judger <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../Judger/">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../Judger/English/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown active">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">JudgeServer <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../English/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../English/deploy/">Deploy</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">中文</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li class="active">
|
||||
<a href="./">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="deploy/">部署</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- Search, Navigation and Repo links -->
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
|
||||
<i class="fa fa-search"></i> Search
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a rel="next" href="../English/deploy/">
|
||||
<i class="fa fa-arrow-left"></i> Previous
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a rel="prev" href="deploy/">
|
||||
Next <i class="fa fa-arrow-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<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="#judgeserver-api">JudgeServer API</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#_1">获取系统状态</a></li>
|
||||
|
||||
<li><a href="#_2">参数</a></li>
|
||||
|
||||
<li><a href="#_3">响应</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#special-judge">判题(非Special Judge)</a></li>
|
||||
|
||||
<li><a href="#_4">参数</a></li>
|
||||
|
||||
<li><a href="#_5">响应</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#special-judge_1">编译Special Judge</a></li>
|
||||
|
||||
<li><a href="#_6">参数</a></li>
|
||||
|
||||
<li><a href="#_7">响应</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#special-judge_2">判题(Special Judge)</a></li>
|
||||
|
||||
<li><a href="#_8">参数</a></li>
|
||||
|
||||
<li><a href="#_9">响应</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#result">result 字段含义</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="col-md-9" role="main">
|
||||
|
||||
<h1 id="judgeserver-api">JudgeServer API</h1>
|
||||
<p>所有的请求,请在HTTP头中放入<code>X-Judge-Server-Token</code>字段,值为token的sha256结果。</p>
|
||||
<p>所有的响应都是两个字段,<code>err</code>和<code>data</code>,正常情况下<code>err</code>为<code>null</code>,<code>data</code>为响应的数据。出现错误的情况下,<code>err</code>是错误代码,<code>data</code>为错误详情。下面所有的响应都是<code>data</code>的内容。</p>
|
||||
<h1 id="_1">获取系统状态</h1>
|
||||
<ul>
|
||||
<li>URL <code>/ping</code></li>
|
||||
<li>Method <code>POST</code></li>
|
||||
</ul>
|
||||
<h2 id="_2">参数</h2>
|
||||
<ul>
|
||||
<li>无参数</li>
|
||||
</ul>
|
||||
<h2 id="_3">响应</h2>
|
||||
<pre><code class="js">{
|
||||
"judger_version": "2.0.1",
|
||||
"hostname": "d3765528134e",
|
||||
// cpu核数,这个数字也确定了可以并发运行的判题任务数量
|
||||
"cpu_core": 1,
|
||||
// cpu和内存使用率,百分比
|
||||
"cpu": 4.1,
|
||||
"memory": 24.5
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<h1 id="special-judge">判题(非Special Judge)</h1>
|
||||
<ul>
|
||||
<li>URL <code>/judge</code></li>
|
||||
<li>Method <code>POST</code></li>
|
||||
</ul>
|
||||
<h2 id="_4">参数</h2>
|
||||
<ul>
|
||||
<li>src,源码</li>
|
||||
<li>language_config,参考<code>languages.py</code>中,一般不需要修改</li>
|
||||
<li>submission_id,这个提交唯一的id,请不要出现重复,比如使用时间戳也是不推荐的</li>
|
||||
<li>max_cpu_time,单位毫秒</li>
|
||||
<li>max_memory,最大内存,单位字节</li>
|
||||
<li>test_case_id,用于找到存放有测试用例的文件夹</li>
|
||||
</ul>
|
||||
<h2 id="_5">响应</h2>
|
||||
<pre><code class="js">[
|
||||
// 每组都是一个测试用例,通过test_case字段区分
|
||||
{
|
||||
// cpu时间,毫秒
|
||||
"cpu_time": 1,
|
||||
// 见本文档最后部分
|
||||
"result": 0,
|
||||
// 内存,字节
|
||||
"memory": 12836864,
|
||||
// 实际时间,毫秒
|
||||
"real_time": 2,
|
||||
"signal": 0,
|
||||
"error": 0,
|
||||
"exit_code": 0,
|
||||
"output_md5": "eccbc87e4b5ce2fe28308fd9f2a7baf3",
|
||||
// 测试用例id
|
||||
"test_case": 1
|
||||
},
|
||||
{
|
||||
"cpu_time": 1,
|
||||
"result": 0,
|
||||
"memory": 12849152,
|
||||
"real_time": 1,
|
||||
"signal": 0,
|
||||
"error": 0,
|
||||
"exit_code": 0,
|
||||
"output_md5": "eccbc87e4b5ce2fe28308fd9f2a7baf3",
|
||||
"test_case": 2
|
||||
}
|
||||
]
|
||||
</code></pre>
|
||||
|
||||
<p>在编译错误的时候,返回</p>
|
||||
<pre><code class="js">{
|
||||
"err": "CompileError",
|
||||
"data": "编译器的错误输出"
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<h1 id="special-judge_1">编译Special Judge</h1>
|
||||
<ul>
|
||||
<li>URL <code>/compile_spj</code></li>
|
||||
<li>Method <code>POST</code></li>
|
||||
</ul>
|
||||
<h2 id="_6">参数</h2>
|
||||
<ul>
|
||||
<li>src,源码</li>
|
||||
<li>spj_version,Special Judge的版本,用于决定是否要重新编译二进制</li>
|
||||
<li>spj_compile_config,参考<code>languages.py</code>,一般不需要修改</li>
|
||||
<li>test_case_id</li>
|
||||
</ul>
|
||||
<h2 id="_7">响应</h2>
|
||||
<pre><code class="js">"success"
|
||||
</code></pre>
|
||||
|
||||
<p>在编译错误的时候,返回</p>
|
||||
<pre><code class="js">{
|
||||
"err": "SPJCompileError",
|
||||
"data": "编译器的错误输出"
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<h1 id="special-judge_2">判题(Special Judge)</h1>
|
||||
<p>注意,必须提前编译Special Judge,见上一个API</p>
|
||||
<ul>
|
||||
<li>URL <code>/judge</code></li>
|
||||
<li>Method <code>POST</code></li>
|
||||
</ul>
|
||||
<h2 id="_8">参数</h2>
|
||||
<ul>
|
||||
<li>src</li>
|
||||
<li>language_config</li>
|
||||
<li>submission_id</li>
|
||||
<li>max_cpu_time</li>
|
||||
<li>max_memory</li>
|
||||
<li>test_case_id</li>
|
||||
<li>spj_version</li>
|
||||
<li>spj_config,参考<code>languages.py</code>,一般不需要修改</li>
|
||||
</ul>
|
||||
<h2 id="_9">响应</h2>
|
||||
<pre><code class="js">[
|
||||
// 每组都是一个测试用例,通过test_case字段区分
|
||||
{
|
||||
// cpu时间,毫秒
|
||||
"cpu_time": 1,
|
||||
// 见本文档最后部分
|
||||
"result": 0,
|
||||
// 内存,字节
|
||||
"memory": 12836864,
|
||||
// 实际时间,毫秒
|
||||
"real_time": 2,
|
||||
"signal": 0,
|
||||
"error": 0,
|
||||
"exit_code": 0,
|
||||
"output_md5": None,
|
||||
// 测试用例id
|
||||
"test_case": 1
|
||||
},
|
||||
{
|
||||
"cpu_time": 1,
|
||||
"result": 0,
|
||||
"memory": 12849152,
|
||||
"real_time": 1,
|
||||
"signal": 0,
|
||||
"error": 0,
|
||||
"exit_code": 0,
|
||||
"output_md5": None,
|
||||
"test_case": 2
|
||||
}
|
||||
]
|
||||
</code></pre>
|
||||
|
||||
<p>在编译错误的时候,返回</p>
|
||||
<pre><code class="js">{
|
||||
"err": "CompileError",
|
||||
"data": "编译器的错误输出"
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<h1 id="result">result 字段含义</h1>
|
||||
<ul>
|
||||
<li>WRONG_ANSWER = -1</li>
|
||||
<li>AEECPTED = 0</li>
|
||||
<li>CPU_TIME_LIMITED = 1</li>
|
||||
<li>REAL_TIME_LIMIT_EXCEEDED = 2</li>
|
||||
<li>MEMORY_LIMIT_EXCEEDED = 3</li>
|
||||
<li>RUNTIME_ERROR = 4</li>
|
||||
<li>SYSTEM_ERROR = 5</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
|
||||
<footer class="col-md-12">
|
||||
<hr>
|
||||
|
||||
<center>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</center>
|
||||
</footer>
|
||||
|
||||
<script src="../../js/jquery-1.10.2.min.js"></script>
|
||||
<script src="../../js/bootstrap-3.0.3.min.js"></script>
|
||||
<script src="../../js/highlight.pack.js"></script>
|
||||
<script>var base_url = '../..';</script>
|
||||
<script data-main="../../mkdocs/js/search.js" src="../../mkdocs/js/require.js"></script>
|
||||
<script src="../../js/base.js"></script>
|
||||
|
||||
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="Search Modal" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title" id="exampleModalLabel">Search</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
From here you can search these documents. Enter
|
||||
your search terms below.
|
||||
</p>
|
||||
<form role="form">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query">
|
||||
</div>
|
||||
</form>
|
||||
<div id="mkdocs-search-results"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
287
docs/JudgeServer/English/deploy/index.html
Normal file
287
docs/JudgeServer/English/deploy/index.html
Normal file
@ -0,0 +1,287 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="../../../img/favicon.ico">
|
||||
|
||||
<title>Deploy - Online Judge Docs</title>
|
||||
|
||||
<link href="../../../css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="../../../css/font-awesome-4.0.3.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="../../../css/highlight.css">
|
||||
<link href="../../../css/base.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
|
||||
<!-- Collapsed navigation -->
|
||||
<div class="navbar-header">
|
||||
<!-- Expander button -->
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
|
||||
<!-- Main title -->
|
||||
<a class="navbar-brand" href="../../..">Online Judge Docs</a>
|
||||
</div>
|
||||
|
||||
<!-- Expanded navigation -->
|
||||
<div class="navbar-collapse collapse">
|
||||
<!-- Main navigation -->
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../..">Home</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Judger <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../../Judger/">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../../Judger/English/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown active">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">JudgeServer <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="active">
|
||||
<a href="./">Deploy</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">中文</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../Chinese/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../Chinese/deploy/">部署</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- Search, Navigation and Repo links -->
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
|
||||
<i class="fa fa-search"></i> Search
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a rel="next" href="../">
|
||||
<i class="fa fa-arrow-left"></i> Previous
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a rel="prev" href="../../Chinese/">
|
||||
Next <i class="fa fa-arrow-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<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="#containers-are-in-the-same-host-and-can-be-linked">Containers are in the same host and can be linked</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#containers-are-deployed-in-multi-hosts">Containers are deployed in multi hosts</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#heartbeat-request">heartbeat request</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="col-md-9" role="main">
|
||||
|
||||
<p>There are two methods to deplloy this server depending on the scene.</p>
|
||||
<h1 id="containers-are-in-the-same-host-and-can-be-linked">Containers are in the same host and can be linked</h1>
|
||||
<p>Example of <code>docker-compose.yml</code></p>
|
||||
<pre><code class="yml">oj_web_server:
|
||||
environment:
|
||||
- judger_token=SOME TOKEN
|
||||
ports:
|
||||
- "0.0.0.0:8000:8080"
|
||||
|
||||
judge_server:
|
||||
links:
|
||||
- oj_web_server:oj_web_server
|
||||
ports:
|
||||
- "127.0.0.1::8080"
|
||||
</code></pre>
|
||||
|
||||
<p>When containers are linked, <code>judge_server</code> can get environment variable <code>OJ_WEB_SERVER_ENV_judger_token</code> as token, get <code>OJ_WEB_SERVER_PORT_8080_TCP_ADDR</code> as server ip, get <code>OJ_WEB_SERVER_PORT_8080_TCP_PORT</code> as server port. As a result, <code>judge_server</code> can send heartbeat request to <code>oj_web_server</code>.</p>
|
||||
<h1 id="containers-are-deployed-in-multi-hosts">Containers are deployed in multi hosts</h1>
|
||||
<p>Three environment variables below must be set manully in <code>docker-compose.yml</code></p>
|
||||
<ul>
|
||||
<li><code>service_discovery_url</code></li>
|
||||
<li><code>judger_token</code></li>
|
||||
<li><code>service_url</code></li>
|
||||
</ul>
|
||||
<p><code>judge_server</code> will send heartbeat request to <code>service_discovery_url</code>.</p>
|
||||
<p><code>service_url</code> is used to tell server to send task to this url(<code>judge_server</code>).</p>
|
||||
<p>Example of <code>docker-compose.yml</code></p>
|
||||
<pre><code class="yml">judge_server:
|
||||
- environment
|
||||
- judger_token=SOME TOKEN
|
||||
- service_discovery_url=http://onlinejudge.com/api/judge_server
|
||||
- service_url=http://1.2.3.4:8005
|
||||
- ports:
|
||||
- "0.0.0.0:8005:8080"
|
||||
</code></pre>
|
||||
|
||||
<h1 id="heartbeat-request">heartbeat request</h1>
|
||||
<ul>
|
||||
<li>Method <code>POST</code></li>
|
||||
<li><code>X-JUDGE-SERVER-TOKEN</code>: <code>sha256(token)</code></li>
|
||||
<li><code>Content-Type</code>: <code>application/json</code></li>
|
||||
</ul>
|
||||
<p>Request data</p>
|
||||
<pre><code class="js"> {
|
||||
"judger_version": "2.0.1",
|
||||
"hostname": "c45acd557074",
|
||||
"cpu_core": 1,
|
||||
"memory": 30.3,
|
||||
"action": "heartbeat",
|
||||
"cpu": 0,
|
||||
"service_url": null or "http://1.2.3.4:8005"
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<p>If everything is OK, you should give a JSON response as follows</p>
|
||||
<pre><code class="js">{
|
||||
"data": "success",
|
||||
"err": null
|
||||
}
|
||||
</code></pre></div>
|
||||
</div>
|
||||
|
||||
<footer class="col-md-12">
|
||||
<hr>
|
||||
|
||||
<center>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</center>
|
||||
</footer>
|
||||
|
||||
<script src="../../../js/jquery-1.10.2.min.js"></script>
|
||||
<script src="../../../js/bootstrap-3.0.3.min.js"></script>
|
||||
<script src="../../../js/highlight.pack.js"></script>
|
||||
<script>var base_url = '../../..';</script>
|
||||
<script data-main="../../../mkdocs/js/search.js" src="../../../mkdocs/js/require.js"></script>
|
||||
<script src="../../../js/base.js"></script>
|
||||
|
||||
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="Search Modal" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title" id="exampleModalLabel">Search</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
From here you can search these documents. Enter
|
||||
your search terms below.
|
||||
</p>
|
||||
<form role="form">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query">
|
||||
</div>
|
||||
</form>
|
||||
<div id="mkdocs-search-results"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
440
docs/JudgeServer/English/index.html
Normal file
440
docs/JudgeServer/English/index.html
Normal file
@ -0,0 +1,440 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="../../img/favicon.ico">
|
||||
|
||||
<title>API - Online Judge Docs</title>
|
||||
|
||||
<link href="../../css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="../../css/font-awesome-4.0.3.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="../../css/highlight.css">
|
||||
<link href="../../css/base.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
|
||||
<!-- Collapsed navigation -->
|
||||
<div class="navbar-header">
|
||||
<!-- Expander button -->
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
|
||||
<!-- Main title -->
|
||||
<a class="navbar-brand" href="../..">Online Judge Docs</a>
|
||||
</div>
|
||||
|
||||
<!-- Expanded navigation -->
|
||||
<div class="navbar-collapse collapse">
|
||||
<!-- Main navigation -->
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../..">Home</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Judger <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../Judger/">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../Judger/English/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown active">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">JudgeServer <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li class="active">
|
||||
<a href="./">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="deploy/">Deploy</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">中文</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../Chinese/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../Chinese/deploy/">部署</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- Search, Navigation and Repo links -->
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
|
||||
<i class="fa fa-search"></i> Search
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a rel="next" href="../">
|
||||
<i class="fa fa-arrow-left"></i> Previous
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a rel="prev" href="deploy/">
|
||||
Next <i class="fa fa-arrow-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<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="#judgeserver-api">JudgeServer API</a></li>
|
||||
|
||||
<li><a href="#preparement">Preparement</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#get-system-info">Get system info</a></li>
|
||||
|
||||
<li><a href="#args">Args</a></li>
|
||||
|
||||
<li><a href="#response">Response</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#judge-not-for-special-judge">Judge (not for Special Judge)</a></li>
|
||||
|
||||
<li><a href="#args_1">Args</a></li>
|
||||
|
||||
<li><a href="#response_1">Response</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#compile-special-judge">Compile Special Judge</a></li>
|
||||
|
||||
<li><a href="#args_2">Args</a></li>
|
||||
|
||||
<li><a href="#response_2">Response</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#judge-for-special-judge">Judge (for Special Judge)</a></li>
|
||||
|
||||
<li><a href="#args_3">Args</a></li>
|
||||
|
||||
<li><a href="#response_3">Response</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#result-field-return-value">result field return value</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#error-field-return-value">error field return value</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="col-md-9" role="main">
|
||||
|
||||
<h1 id="judgeserver-api">JudgeServer API</h1>
|
||||
<h2 id="preparement">Preparement</h2>
|
||||
<ul>
|
||||
<li><code>X-Judge-Server-Token</code> HTTP header is required for all requests, the value of this header is <code>sha256(token)</code>.</li>
|
||||
<li>Type of request and response data is JSON.</li>
|
||||
<li>Request method is <code>POST</code>.</li>
|
||||
<li>
|
||||
<p>For all responses, <code>err</code> and <code>data</code> fields will be returned. </p>
|
||||
<ul>
|
||||
<li>If the request is processed successfully, <code>err</code> field will be <code>null</code>, <code>data</code> field will be the data returned. </li>
|
||||
<li>If error occured while processing request, <code>err</code> field will be error code, <code>data</code> field will be the reason.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h1 id="get-system-info">Get system info</h1>
|
||||
<ul>
|
||||
<li>URL <code>/ping</code></li>
|
||||
</ul>
|
||||
<h2 id="args">Args</h2>
|
||||
<ul>
|
||||
<li>Do not need args</li>
|
||||
</ul>
|
||||
<h2 id="response">Response</h2>
|
||||
<pre><code class="js">{
|
||||
"judger_version": "2.0.1",
|
||||
"hostname": "d3765528134e",
|
||||
// number of cpu cores, this value will determine the number of concurrent tasks
|
||||
"cpu_core": 1,
|
||||
// usage of cpu and memory
|
||||
"cpu": 4.1,
|
||||
"memory": 24.5
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<h1 id="judge-not-for-special-judge">Judge (not for Special Judge)</h1>
|
||||
<ul>
|
||||
<li>URL <code>/judge</code></li>
|
||||
</ul>
|
||||
<h2 id="args_1">Args</h2>
|
||||
<ul>
|
||||
<li><code>src</code>: source code</li>
|
||||
<li><code>language_config</code>: refer to <code>client/Python/languages.py</code>, do not need to modify generally</li>
|
||||
<li><code>submission_id</code>: the only id of the submission, do not repeat</li>
|
||||
<li><code>max_cpu_time</code>: unit is ms</li>
|
||||
<li><code>max_memory</code>: unit is byte</li>
|
||||
<li><code>test_case_id</code>: used to get the test_case directory</li>
|
||||
</ul>
|
||||
<h2 id="response_1">Response</h2>
|
||||
<pre><code class="js">[
|
||||
// each object/dict is a test case file running result
|
||||
{
|
||||
"cpu_time": 1,
|
||||
// refer to the end of this document
|
||||
"result": 0,
|
||||
"memory": 12836864,
|
||||
"real_time": 2,
|
||||
"signal": 0,
|
||||
"error": 0,
|
||||
// refer to the end of this document
|
||||
"exit_code": 0,
|
||||
"output_md5": "eccbc87e4b5ce2fe28308fd9f2a7baf3",
|
||||
// test case file id
|
||||
"test_case": 1
|
||||
},
|
||||
{
|
||||
"cpu_time": 1,
|
||||
"result": 0,
|
||||
"memory": 12849152,
|
||||
"real_time": 1,
|
||||
"signal": 0,
|
||||
"error": 0,
|
||||
"exit_code": 0,
|
||||
"output_md5": "eccbc87e4b5ce2fe28308fd9f2a7baf3",
|
||||
"test_case": 2
|
||||
}
|
||||
]
|
||||
</code></pre>
|
||||
|
||||
<p>When compilation is failed, following data will be returned</p>
|
||||
<pre><code class="js">{
|
||||
"err": "CompileError",
|
||||
"data": "error resson"
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<h1 id="compile-special-judge">Compile Special Judge</h1>
|
||||
<ul>
|
||||
<li>URL <code>/compile_spj</code></li>
|
||||
</ul>
|
||||
<h2 id="args_2">Args</h2>
|
||||
<ul>
|
||||
<li><code>src</code>: special judge soure code</li>
|
||||
<li><code>spj_version</code>: version of special judge, used to determine whether to recompile special judge</li>
|
||||
<li><code>spj_compile_config</code>: refer to <code>client/Python/languages.py</code>, do not need to modify generally</li>
|
||||
<li><code>test_case_id</code></li>
|
||||
</ul>
|
||||
<h2 id="response_2">Response</h2>
|
||||
<pre><code class="js">"success"
|
||||
</code></pre>
|
||||
|
||||
<p>When compilation is failed, following data will be returned</p>
|
||||
<pre><code class="js">{
|
||||
"err": "SPJCompileError",
|
||||
"data": "error resson"
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<h1 id="judge-for-special-judge">Judge (for Special Judge)</h1>
|
||||
<p>Special Judge must be compiled before, refer to the above API</p>
|
||||
<ul>
|
||||
<li>URL <code>/judge</code></li>
|
||||
</ul>
|
||||
<h2 id="args_3">Args</h2>
|
||||
<ul>
|
||||
<li><code>src</code></li>
|
||||
<li><code>language_config</code></li>
|
||||
<li><code>submission_id</code></li>
|
||||
<li><code>max_cpu_time</code></li>
|
||||
<li><code>max_memory</code></li>
|
||||
<li><code>test_case_id</code></li>
|
||||
<li><code>spj_version</code></li>
|
||||
<li><code>spj_config</code>, refer to <code>client/Python/languages.py</code>, do not need to modify generally</li>
|
||||
</ul>
|
||||
<h2 id="response_3">Response</h2>
|
||||
<pre><code class="js">[
|
||||
{
|
||||
"cpu_time": 1,
|
||||
"result": 0,
|
||||
"memory": 12836864,
|
||||
"real_time": 2,
|
||||
"signal": 0,
|
||||
"error": 0,
|
||||
"exit_code": 0,
|
||||
"output_md5": None,
|
||||
"test_case": 1
|
||||
},
|
||||
{
|
||||
"cpu_time": 1,
|
||||
"result": 0,
|
||||
"memory": 12849152,
|
||||
"real_time": 1,
|
||||
"signal": 0,
|
||||
"error": 0,
|
||||
"exit_code": 0,
|
||||
"output_md5": None,
|
||||
"test_case": 2
|
||||
}
|
||||
]
|
||||
</code></pre>
|
||||
|
||||
<p>When compilation is failed, following data will be returned</p>
|
||||
<pre><code class="js">{
|
||||
"err": "CompileError",
|
||||
"data": "error reason"
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<p>If SPJ process crashed, <code>result = SYSTEM_ERROR</code> and <code>ERROR = SPJ_ERROR</code> is returned.</p>
|
||||
<h1 id="result-field-return-value"><code>result</code> field return value</h1>
|
||||
<ul>
|
||||
<li>WRONG_ANSWER = -1 (this means the process exited normally, but the answer is wrong)</li>
|
||||
<li>SUCCESS = 0 (this means the answer is accepted)</li>
|
||||
<li>CPU_TIME_LIMIT_EXCEEDED = 1 </li>
|
||||
<li>REAL_TIME_LIMIT_EXCEEDED = 2</li>
|
||||
<li>MEMORY_LIMIT_EXCEEDED = 3</li>
|
||||
<li>RUNTIME_ERROR = 4</li>
|
||||
<li>SYSTEM_ERROR = 5</li>
|
||||
</ul>
|
||||
<h1 id="error-field-return-value"><code>error</code> field return value</h1>
|
||||
<ul>
|
||||
<li>SUCCESS = 0</li>
|
||||
<li>INVALID_CONFIG = -1</li>
|
||||
<li>CLONE_FAILED = -2</li>
|
||||
<li>PTHREAD_FAILED = -3</li>
|
||||
<li>WAIT_FAILED = -4</li>
|
||||
<li>ROOT_REQUIRED = -5</li>
|
||||
<li>LOAD_SECCOMP_FAILED = -6</li>
|
||||
<li>SETRLIMIT_FAILED = -7</li>
|
||||
<li>DUP2_FAILED = -8</li>
|
||||
<li>SETUID_FAILED = -9</li>
|
||||
<li>EXECVE_FAILED = -10</li>
|
||||
<li>SPJ_ERROR = -11</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
|
||||
<footer class="col-md-12">
|
||||
<hr>
|
||||
|
||||
<center>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</center>
|
||||
</footer>
|
||||
|
||||
<script src="../../js/jquery-1.10.2.min.js"></script>
|
||||
<script src="../../js/bootstrap-3.0.3.min.js"></script>
|
||||
<script src="../../js/highlight.pack.js"></script>
|
||||
<script>var base_url = '../..';</script>
|
||||
<script data-main="../../mkdocs/js/search.js" src="../../mkdocs/js/require.js"></script>
|
||||
<script src="../../js/base.js"></script>
|
||||
|
||||
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="Search Modal" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title" id="exampleModalLabel">Search</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
From here you can search these documents. Enter
|
||||
your search terms below.
|
||||
</p>
|
||||
<form role="form">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query">
|
||||
</div>
|
||||
</form>
|
||||
<div id="mkdocs-search-results"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
237
docs/JudgeServer/index.html
Normal file
237
docs/JudgeServer/index.html
Normal file
@ -0,0 +1,237 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="../img/favicon.ico">
|
||||
|
||||
<title>index - Online Judge Docs</title>
|
||||
|
||||
<link href="../css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="../css/font-awesome-4.0.3.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="../css/highlight.css">
|
||||
<link href="../css/base.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
|
||||
<!-- Collapsed navigation -->
|
||||
<div class="navbar-header">
|
||||
<!-- Expander button -->
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
|
||||
<!-- Main title -->
|
||||
<a class="navbar-brand" href="..">Online Judge Docs</a>
|
||||
</div>
|
||||
|
||||
<!-- Expanded navigation -->
|
||||
<div class="navbar-collapse collapse">
|
||||
<!-- Main navigation -->
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="..">Home</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Judger <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../Judger/">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../Judger/English/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown active">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">JudgeServer <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li class="active">
|
||||
<a href="./">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="English/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="English/deploy/">Deploy</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">中文</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="Chinese/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="Chinese/deploy/">部署</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- Search, Navigation and Repo links -->
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
|
||||
<i class="fa fa-search"></i> Search
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a rel="next" href="../Judger/English/">
|
||||
<i class="fa fa-arrow-left"></i> Previous
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a rel="prev" href="English/">
|
||||
Next <i class="fa fa-arrow-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<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="#table-of-contents">Table of contents</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="col-md-9" role="main">
|
||||
|
||||
<h1 id="table-of-contents">Table of contents</h1>
|
||||
<ul>
|
||||
<li>JudgeServer <ul>
|
||||
<li>English <ul>
|
||||
<li><a href="../JudgeServer/English/">API</a></li>
|
||||
<li><a href="../JudgeServer/English/deploy">Deploy</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>中文 <ul>
|
||||
<li><a href="../JudgeServer/Chinese/">API</a></li>
|
||||
<li><a href="../JudgeServer/Chinese/deploy">部署</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
|
||||
<footer class="col-md-12">
|
||||
<hr>
|
||||
|
||||
<center>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</center>
|
||||
</footer>
|
||||
|
||||
<script src="../js/jquery-1.10.2.min.js"></script>
|
||||
<script src="../js/bootstrap-3.0.3.min.js"></script>
|
||||
<script src="../js/highlight.pack.js"></script>
|
||||
<script>var base_url = '..';</script>
|
||||
<script data-main="../mkdocs/js/search.js" src="../mkdocs/js/require.js"></script>
|
||||
<script src="../js/base.js"></script>
|
||||
|
||||
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="Search Modal" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title" id="exampleModalLabel">Search</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
From here you can search these documents. Enter
|
||||
your search terms below.
|
||||
</p>
|
||||
<form role="form">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query">
|
||||
</div>
|
||||
</form>
|
||||
<div id="mkdocs-search-results"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -61,13 +61,19 @@
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="Judger/">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="judger/English/">API</a>
|
||||
<a href="Judger/English/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
@ -85,19 +91,46 @@
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="JudgeServer/">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="judge_server/English/">API</a>
|
||||
<a href="JudgeServer/English/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="judge_server/English/deploy/">Deploy</a>
|
||||
<a href="JudgeServer/English/deploy/">Deploy</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">中文</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="JudgeServer/Chinese/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="JudgeServer/Chinese/deploy/">部署</a>
|
||||
</li>
|
||||
|
||||
|
||||
@ -124,7 +157,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a rel="prev" href="judger/English/">
|
||||
<a rel="prev" href="Judger/">
|
||||
Next <i class="fa fa-arrow-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
@ -147,7 +180,30 @@
|
||||
|
||||
<h1 id="welcome-to-online-judge">Welcome to Online Judge</h1>
|
||||
<p>目前此处的文档均为未公开发布版本的,最新release的版本请参考github。</p>
|
||||
<p>https://github.com/QingdaoU</p></div>
|
||||
<p>https://github.com/QingdaoU</p>
|
||||
<ul>
|
||||
<li><a href="./">Home</a></li>
|
||||
<li>Judger <ul>
|
||||
<li>English <ul>
|
||||
<li><a href="./Judger/English/">API</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>JudgeServer <ul>
|
||||
<li>English <ul>
|
||||
<li><a href="./JudgeServer/English/">API</a></li>
|
||||
<li><a href="./JudgeServer/English/deploy">Deploy</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>中文 <ul>
|
||||
<li><a href="./JudgeServer/Chinese/">API</a></li>
|
||||
<li><a href="./JudgeServer/Chinese/deploy">部署</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
|
||||
<footer class="col-md-12">
|
||||
|
@ -61,6 +61,12 @@
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
@ -85,19 +91,46 @@
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../JudgeServer/">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">English</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../judge_server/English/">API</a>
|
||||
<a href="../../JudgeServer/English/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../judge_server/English/deploy/">Deploy</a>
|
||||
<a href="../../JudgeServer/English/deploy/">Deploy</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="dropdown-submenu">
|
||||
<a tabindex="-1" href="">中文</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../JudgeServer/Chinese/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../../JudgeServer/Chinese/deploy/">部署</a>
|
||||
</li>
|
||||
|
||||
|
||||
@ -119,12 +152,12 @@
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a rel="next" href="../..">
|
||||
<a rel="next" href="../">
|
||||
<i class="fa fa-arrow-left"></i> Previous
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a rel="prev" href="../../judge_server/English/">
|
||||
<a rel="prev" href="../../JudgeServer/">
|
||||
Next <i class="fa fa-arrow-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<link rel="shortcut icon" href="../img/favicon.ico">
|
||||
|
||||
<title>Index - Online Judge Docs</title>
|
||||
<title>index - Online Judge Docs</title>
|
||||
|
||||
<link href="../css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="../css/font-awesome-4.0.3.css" rel="stylesheet">
|
||||
@ -62,7 +62,7 @@
|
||||
|
||||
|
||||
<li class="active">
|
||||
<a href="./">Index</a>
|
||||
<a href="./">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
@ -92,7 +92,7 @@
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../judge_server/">Index</a>
|
||||
<a href="../JudgeServer/">index</a>
|
||||
</li>
|
||||
|
||||
|
||||
@ -103,7 +103,13 @@
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../judge_server/English/">API</a>
|
||||
<a href="../JudgeServer/English/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../JudgeServer/English/deploy/">Deploy</a>
|
||||
</li>
|
||||
|
||||
|
||||
@ -118,13 +124,13 @@
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../judge_server/Chinese/">API</a>
|
||||
<a href="../JudgeServer/Chinese/">API</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li >
|
||||
<a href="../judge_server/Chinese/deploy/">部署</a>
|
||||
<a href="../JudgeServer/Chinese/deploy/">部署</a>
|
||||
</li>
|
||||
|
||||
|
||||
@ -165,20 +171,23 @@
|
||||
<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="#_1">中文版本</a></li>
|
||||
|
||||
|
||||
<li class="main "><a href="#english-version">English Version</a></li>
|
||||
<li class="main active"><a href="#table-of-contents">Table of contents</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="col-md-9" role="main">
|
||||
|
||||
<h1 id="_1">中文版本</h1>
|
||||
<p><a href="./Chinese">链接</a></p>
|
||||
<h1 id="english-version">English Version</h1>
|
||||
<p><a href="./English">link</a></p></div>
|
||||
<h1 id="table-of-contents">Table of contents</h1>
|
||||
<ul>
|
||||
<li>Judger <ul>
|
||||
<li>English <ul>
|
||||
<li><a href="../Judger/English/">API</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
|
||||
<footer class="col-md-12">
|
||||
|
File diff suppressed because one or more lines are too long
@ -11,6 +11,12 @@
|
||||
|
||||
|
||||
|
||||
<url>
|
||||
<loc>None/Judger/</loc>
|
||||
<lastmod>2016-10-05</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>None</loc>
|
||||
<lastmod></lastmod>
|
||||
@ -21,6 +27,18 @@
|
||||
|
||||
|
||||
|
||||
<url>
|
||||
<loc>None/JudgeServer/</loc>
|
||||
<lastmod>2016-10-05</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>None</loc>
|
||||
<lastmod></lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>None</loc>
|
||||
<lastmod></lastmod>
|
||||
|
Loading…
Reference in New Issue
Block a user