-
Notifications
You must be signed in to change notification settings - Fork 0
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
+120
−0
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6a397bd
feat: OpenAPI のスキーマ以外の部分を書いた
hayatroid 973d62b
feat: OpenAPI のスキーマの部分を書いた
hayatroid 8b3bea2
fix: ファイルパスは envs として渡す
hayatroid ab9ea18
fix: optional info を渡す
hayatroid f434329
fix: /execute の response として返す
hayatroid c4a4b92
fix: コンテナの話を外す
hayatroid 7b898cf
fix: 内部の通信なので security 外す
hayatroid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
title: readonlyFiles | ||
type: array | ||
description: ジャッジに使用したファイル(読み取り専用) | ||
items: | ||
$ref: "#/components/schemas/File" | ||
required: | ||
- exitCode | ||
- stdout | ||
- stderr | ||
- readonlyFiles |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
説明不足でごめん: ファイルパスは環境変数として渡すからenvsがあるなら消してしまってもいいかも