Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

control ↔ exec の API を追加 #195

Merged
merged 7 commits into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions api/judge/exec/to_control.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
openapi: "3.0.3"
info:
title: exec to control API
version: "0.1"
license:
name: MIT
url: "https://github.com/traP-jp/traO-Judge-docs/blob/main/LICENSE"
servers:
- url: https://api.server.test/v1
paths:
"/execute":
post:
operationId: execute
description: control container から file placed message を受け取り,ジャッジの実行を開始する.
tags:
- judge
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/FilePlacedMessage"
required: true
summary: ジャッジの実行を開始
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/JudgeResultMessage"
"400":
description: Bad Request
components:
schemas:
File:
title: File
type: object
description: ファイル
properties:
fileId:
title: fileId
type: string
description: ファイルの UUID
format: uuid
example: 01234567-89ab-cdef-0123-456789abcdef
filePath:
title: filePath
type: string
description: ファイルのパス
example: "/path/to/file"
required:
- fileId
- filePath
FilePlacedMessage:
title: FilePlacedMessage
type: object
description: ジャッジの実行を開始するトリガーとなるメッセージ
properties:
cmd:
title: cmd
type: string
description: コマンド
example: cmd
envs:
title: envs
type: object
description: 環境たち
additionalProperties:
title: env
type: string
description: 環境
example: env
optionalInfo:
title: optionalInfo
type: object
description: 任意の情報
properties:
execTime:
title: execTime
type: number
description: 実行時間
example: 1.23
memorySize:
title: memorySize
type: number
description: メモリ使用量(byte)
example: 123456789
language:
title: language
type: string
description: 使用言語
example: python
required:
- cmd
- envs
JudgeResultMessage:
title: JudgeResultMessage
type: object
description: ジャッジの実行を終了したコンテナから受け取るメッセージ
properties:
exitCode:
title: exitCode
type: integer
description: 終了コード
example: 0
stdout:
$ref: "#/components/schemas/File"
stderr:
$ref: "#/components/schemas/File"
readonlyFiles:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

説明不足でごめん: ファイルパスは環境変数として渡すからenvsがあるなら消してしまってもいいかも

title: readonlyFiles
type: array
description: ジャッジに使用したファイル(読み取り専用)
items:
$ref: "#/components/schemas/File"
required:
- exitCode
- stdout
- stderr
- readonlyFiles
Loading