This commit is contained in:
MeiK2333 2020-11-06 14:03:29 +08:00
parent a2f016a66c
commit 405e2dbd56
8 changed files with 45 additions and 5 deletions

6
.dockerignore Normal file
View File

@ -0,0 +1,6 @@
example
node_modules
.git
target
nohup
README.md

View File

@ -1,12 +1,12 @@
FROM rust:latest as builder
RUN rustup component add rustfmt --toolchain 1.47.0-x86_64-unknown-linux-gnu
COPY . /river
WORKDIR /river
RUN rustup component add rustfmt --toolchain 1.47.0-x86_64-unknown-linux-gnu && \
cargo build --release
RUN cargo build --release
FROM ubuntu:18.04

View File

@ -25,3 +25,4 @@ python3 main.py
- docker 部署
- 更多语言支持
- 使用配置文件配置语言
- 使用环境变量等机制自定义评测目录

View File

@ -5,8 +5,7 @@ echo "Hello World!"
mkdir -p /river/runner
# 运行的上层目录创建 node_modules以便 Node 与 TypeScript 使用
cd /river/runner
npm init -y
npm i @types/node
npm i
cd /plugins/js
npm install

3
runner/.gitignore vendored
View File

@ -2,3 +2,6 @@
*
# Except this file
!.gitignore
!package.json
!tsconfig.json

15
runner/package.json Normal file
View File

@ -0,0 +1,15 @@
{
"name": "river",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@types/node": "^14.14.6"
}
}

15
runner/tsconfig.json Normal file
View File

@ -0,0 +1,15 @@
{
"compileOnSave": true,
"compilerOptions": {
"module": "commonjs",
"target": "ESNext",
"skipLibCheck": true,
"strict": false,
"resolveJsonModule": true,
"esModuleInterop": true,
"noErrorTruncation": true,
"allowSyntheticDefaultImports": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
}
}

View File

@ -63,6 +63,7 @@ pub async fn judger(
if request.language == Language::Java as i32
|| request.language == Language::Go as i32
|| request.language == Language::Node as i32
|| request.language == Language::TypeScript as i32
{
runner.memory_limit = -1;
runner.traceme = false;