805 lines
19 KiB
YAML
805 lines
19 KiB
YAML
basePath: /api/v1
|
||
definitions:
|
||
handler.Response:
|
||
properties:
|
||
code:
|
||
description: 状态码
|
||
type: integer
|
||
data:
|
||
description: 数据对象
|
||
message:
|
||
description: 错误信息
|
||
type: string
|
||
type: object
|
||
models.BaseResourceSpec:
|
||
properties:
|
||
availableUnit:
|
||
type: string
|
||
availableValue:
|
||
type: integer
|
||
createTime:
|
||
type: string
|
||
id:
|
||
type: integer
|
||
name:
|
||
type: string
|
||
resourceSpecId:
|
||
type: integer
|
||
totalUnit:
|
||
type: string
|
||
totalValue:
|
||
type: integer
|
||
type:
|
||
type: string
|
||
updateTime:
|
||
type: string
|
||
userId:
|
||
type: string
|
||
type: object
|
||
models.Card:
|
||
properties:
|
||
card:
|
||
type: string
|
||
originImageID:
|
||
type: string
|
||
type: object
|
||
models.Cluster:
|
||
properties:
|
||
clusterID:
|
||
type: string
|
||
code:
|
||
$ref: '#/definitions/models.CodeInfo'
|
||
resources:
|
||
items:
|
||
$ref: '#/definitions/models.ResourcesItem'
|
||
type: array
|
||
runtime:
|
||
$ref: '#/definitions/models.Runtime'
|
||
type: object
|
||
models.ClusterImage:
|
||
properties:
|
||
cards:
|
||
items:
|
||
$ref: '#/definitions/models.Card'
|
||
type: array
|
||
clusterID:
|
||
type: string
|
||
imageID:
|
||
type: integer
|
||
originImageID:
|
||
type: string
|
||
originImageName:
|
||
type: string
|
||
originImageType:
|
||
type: string
|
||
type: object
|
||
models.CodeConfig:
|
||
properties:
|
||
code_repo_name:
|
||
type: string
|
||
code_repo_vis:
|
||
type: integer
|
||
git_branch:
|
||
type: string
|
||
git_password:
|
||
type: string
|
||
git_url:
|
||
type: string
|
||
git_user_name:
|
||
type: string
|
||
id:
|
||
type: integer
|
||
is_public:
|
||
type: boolean
|
||
mount_path:
|
||
type: string
|
||
ssh_key:
|
||
type: string
|
||
verify_mode:
|
||
type: string
|
||
required:
|
||
- code_repo_name
|
||
- git_branch
|
||
- git_url
|
||
- id
|
||
- mount_path
|
||
type: object
|
||
models.CodeInfo:
|
||
properties:
|
||
bindingID:
|
||
type: integer
|
||
type:
|
||
type: string
|
||
type: object
|
||
models.DataResourceConfig:
|
||
properties:
|
||
id:
|
||
type: integer
|
||
identifier:
|
||
type: string
|
||
mount_path:
|
||
type: string
|
||
name:
|
||
type: string
|
||
owner:
|
||
type: string
|
||
path:
|
||
type: string
|
||
version:
|
||
type: string
|
||
required:
|
||
- id
|
||
- identifier
|
||
- mount_path
|
||
- name
|
||
- owner
|
||
- path
|
||
- version
|
||
type: object
|
||
models.FileBinding:
|
||
properties:
|
||
bindingID:
|
||
type: integer
|
||
type:
|
||
type: string
|
||
type: object
|
||
models.ImageBinding:
|
||
properties:
|
||
imageID:
|
||
type: integer
|
||
type:
|
||
type: string
|
||
type: object
|
||
models.ImageInfo:
|
||
properties:
|
||
clusterImages:
|
||
items:
|
||
$ref: '#/definitions/models.ClusterImage'
|
||
type: array
|
||
createTime:
|
||
type: string
|
||
imageID:
|
||
type: integer
|
||
name:
|
||
type: string
|
||
type: object
|
||
models.InferenceAsyncSubmitRespData:
|
||
properties:
|
||
task_id:
|
||
type: string
|
||
type: object
|
||
models.InferenceAsyncSubmitResponse:
|
||
properties:
|
||
code:
|
||
type: integer
|
||
data:
|
||
$ref: '#/definitions/models.InferenceAsyncSubmitRespData'
|
||
msg:
|
||
type: string
|
||
type: object
|
||
models.InferenceAsyncTaskStatusData:
|
||
properties:
|
||
error:
|
||
type: string
|
||
job_set_id:
|
||
type: string
|
||
progress:
|
||
description: 进度描述
|
||
type: string
|
||
result:
|
||
allOf:
|
||
- $ref: '#/definitions/models.InferenceSubmitTaskResponse'
|
||
description: 任务完成后的结果
|
||
status:
|
||
description: PENDING/RUNNING/SUBMITTING/COMPLETED/FAILED
|
||
type: string
|
||
task_id:
|
||
type: string
|
||
type: object
|
||
models.InferenceAsyncTaskStatusRequest:
|
||
properties:
|
||
task_id:
|
||
type: string
|
||
required:
|
||
- task_id
|
||
type: object
|
||
models.InferenceAsyncTaskStatusResponse:
|
||
properties:
|
||
code:
|
||
type: integer
|
||
data:
|
||
$ref: '#/definitions/models.InferenceAsyncTaskStatusData'
|
||
msg:
|
||
type: string
|
||
type: object
|
||
models.InferenceResultInfo:
|
||
properties:
|
||
jobSetID:
|
||
description: 任务集ID
|
||
type: string
|
||
localJobID:
|
||
description: 本地任务ID
|
||
type: string
|
||
type: object
|
||
models.InferenceSubmitTaskRequest:
|
||
properties:
|
||
code_config:
|
||
allOf:
|
||
- $ref: '#/definitions/models.CodeConfig'
|
||
description: 代码配置
|
||
command:
|
||
description: 启动命令
|
||
type: string
|
||
description:
|
||
description: 描述
|
||
type: string
|
||
image:
|
||
allOf:
|
||
- $ref: '#/definitions/models.ImageInfo'
|
||
description: 镜像信息
|
||
model:
|
||
allOf:
|
||
- $ref: '#/definitions/models.DataResourceConfig'
|
||
description: 模型信息
|
||
resource:
|
||
allOf:
|
||
- $ref: '#/definitions/models.RemoteSourceConfig'
|
||
description: 资源配置
|
||
resource_type:
|
||
description: 资源类型
|
||
type: string
|
||
sub_model:
|
||
allOf:
|
||
- $ref: '#/definitions/models.DataResourceConfig'
|
||
description: 增量模型信息(可选)
|
||
version:
|
||
description: 版本
|
||
type: string
|
||
type: object
|
||
models.InferenceSubmitTaskResponse:
|
||
properties:
|
||
code:
|
||
description: 状态码
|
||
type: integer
|
||
data:
|
||
allOf:
|
||
- $ref: '#/definitions/models.InferenceSubmitTaskResponseData'
|
||
description: 响应数据
|
||
msg:
|
||
description: 消息
|
||
type: string
|
||
type: object
|
||
models.InferenceSubmitTaskResponseData:
|
||
properties:
|
||
resultInfo:
|
||
allOf:
|
||
- $ref: '#/definitions/models.InferenceResultInfo'
|
||
description: 结果信息
|
||
taskInfo:
|
||
allOf:
|
||
- $ref: '#/definitions/models.SubtaskRequest'
|
||
description: 任务信息
|
||
type: object
|
||
models.InferenceTaskStatusData:
|
||
properties:
|
||
status:
|
||
description: 任务状态
|
||
type: string
|
||
url:
|
||
description: 推理URL
|
||
type: string
|
||
type: object
|
||
models.InferenceTaskStatusRequest:
|
||
properties:
|
||
jobSetID:
|
||
description: 任务集ID
|
||
type: string
|
||
localJobID:
|
||
description: 本地任务ID
|
||
type: string
|
||
required:
|
||
- jobSetID
|
||
- localJobID
|
||
type: object
|
||
models.InferenceTaskStatusResponse:
|
||
properties:
|
||
code:
|
||
description: 状态码
|
||
type: integer
|
||
data:
|
||
allOf:
|
||
- $ref: '#/definitions/models.InferenceTaskStatusData'
|
||
description: 任务状态数据
|
||
msg:
|
||
description: 消息
|
||
type: string
|
||
type: object
|
||
models.InputParams:
|
||
properties:
|
||
ClusterID:
|
||
type: string
|
||
Output:
|
||
type: string
|
||
PackageName:
|
||
type: string
|
||
type: object
|
||
models.Job:
|
||
properties:
|
||
description:
|
||
type: string
|
||
files:
|
||
$ref: '#/definitions/models.JobFiles'
|
||
jobResources:
|
||
$ref: '#/definitions/models.JobResources'
|
||
jobSetID:
|
||
description: 停止任务时需要
|
||
type: string
|
||
localJobID:
|
||
type: string
|
||
name:
|
||
type: string
|
||
onlyCreate:
|
||
type: boolean
|
||
targetJob:
|
||
items:
|
||
$ref: '#/definitions/models.TargetJob'
|
||
type: array
|
||
type:
|
||
type: string
|
||
type: object
|
||
models.JobFiles:
|
||
properties:
|
||
dataset:
|
||
$ref: '#/definitions/models.FileBinding'
|
||
image:
|
||
$ref: '#/definitions/models.ImageBinding'
|
||
model:
|
||
$ref: '#/definitions/models.FileBinding'
|
||
sub_model:
|
||
$ref: '#/definitions/models.FileBinding'
|
||
type: object
|
||
models.JobResources:
|
||
properties:
|
||
clusters:
|
||
items:
|
||
$ref: '#/definitions/models.Cluster'
|
||
type: array
|
||
scheduleStrategy:
|
||
type: string
|
||
type: object
|
||
models.JobSetInfo:
|
||
properties:
|
||
jobs:
|
||
items:
|
||
$ref: '#/definitions/models.Job'
|
||
type: array
|
||
type: object
|
||
models.RemoteSourceConfig:
|
||
properties:
|
||
availableCount:
|
||
type: integer
|
||
baseResourceSpecs:
|
||
items:
|
||
$ref: '#/definitions/models.BaseResourceSpec'
|
||
type: array
|
||
changeType:
|
||
type: integer
|
||
clusterId:
|
||
type: string
|
||
costPerUnit:
|
||
type: integer
|
||
costType:
|
||
type: string
|
||
createTime:
|
||
type: string
|
||
id:
|
||
type: integer
|
||
name:
|
||
type: string
|
||
region:
|
||
type: string
|
||
sourceKey:
|
||
type: string
|
||
status:
|
||
type: integer
|
||
tag:
|
||
type: string
|
||
totalCount:
|
||
type: integer
|
||
type:
|
||
type: string
|
||
updateTime:
|
||
type: string
|
||
userId:
|
||
type: string
|
||
type: object
|
||
models.ResourceConfig:
|
||
properties:
|
||
availableCount:
|
||
type: integer
|
||
clusterID:
|
||
type: string
|
||
name:
|
||
type: string
|
||
resources:
|
||
items:
|
||
$ref: '#/definitions/models.ResourcesItem'
|
||
type: array
|
||
totalCount:
|
||
type: integer
|
||
type:
|
||
type: string
|
||
required:
|
||
- clusterID
|
||
type: object
|
||
models.ResourcesItem:
|
||
properties:
|
||
availableValue:
|
||
type: integer
|
||
name:
|
||
type: string
|
||
number:
|
||
type: integer
|
||
type:
|
||
type: string
|
||
required:
|
||
- availableValue
|
||
- name
|
||
- type
|
||
type: object
|
||
models.RunConfig:
|
||
properties:
|
||
code_config:
|
||
$ref: '#/definitions/models.CodeConfig'
|
||
command:
|
||
type: string
|
||
dataset:
|
||
$ref: '#/definitions/models.DataResourceConfig'
|
||
image:
|
||
type: integer
|
||
model_name:
|
||
$ref: '#/definitions/models.DataResourceConfig'
|
||
resource:
|
||
$ref: '#/definitions/models.ResourceConfig'
|
||
run_args:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
task_output:
|
||
type: string
|
||
type: object
|
||
models.Runtime:
|
||
properties:
|
||
envs:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
params:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
type: object
|
||
models.StopInferenceTaskRequest:
|
||
properties:
|
||
jobSetID:
|
||
description: 任务集ID
|
||
type: string
|
||
localJobID:
|
||
description: 本地任务ID
|
||
type: string
|
||
required:
|
||
- jobSetID
|
||
- localJobID
|
||
type: object
|
||
models.StopInferenceTaskResponse:
|
||
properties:
|
||
code:
|
||
description: 状态码
|
||
type: integer
|
||
message:
|
||
description: 消息
|
||
type: string
|
||
type: object
|
||
models.SubmitTaskRequest:
|
||
properties:
|
||
code_id:
|
||
description: 上传代码返回的ID
|
||
type: integer
|
||
dataset_id:
|
||
description: 数据集ID(可选)
|
||
type: integer
|
||
model_id:
|
||
description: 上传模型返回的ID
|
||
type: integer
|
||
run_config:
|
||
allOf:
|
||
- $ref: '#/definitions/models.RunConfig'
|
||
description: 运行配置
|
||
type: object
|
||
models.SubtaskRequest:
|
||
properties:
|
||
jobSetInfo:
|
||
$ref: '#/definitions/models.JobSetInfo'
|
||
userID:
|
||
type: integer
|
||
type: object
|
||
models.TargetJob:
|
||
properties:
|
||
inputParams:
|
||
$ref: '#/definitions/models.InputParams'
|
||
targetJobID:
|
||
type: string
|
||
type: object
|
||
models.UploadCodeRequest:
|
||
properties:
|
||
run_config:
|
||
allOf:
|
||
- $ref: '#/definitions/models.RunConfig'
|
||
description: 运行配置
|
||
type: object
|
||
host: localhost:8080
|
||
info:
|
||
contact:
|
||
email: support@example.com
|
||
name: API Support
|
||
url: http://www.example.com/support
|
||
description: 推理任务执行服务 API 文档
|
||
license:
|
||
name: Apache 2.0
|
||
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
||
termsOfService: http://swagger.io/terms/
|
||
title: Remote Task Executor API
|
||
version: "1.0"
|
||
paths:
|
||
/api/v1/getInferenceTaskAsync:
|
||
post:
|
||
consumes:
|
||
- application/json
|
||
description: 查询异步推理任务的处理状态、进度和最终结果
|
||
parameters:
|
||
- description: 查询参数
|
||
in: body
|
||
name: request
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/models.InferenceAsyncTaskStatusRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/models.InferenceAsyncTaskStatusResponse'
|
||
"400":
|
||
description: Bad Request
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
"500":
|
||
description: Internal Server Error
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
summary: 查询异步任务状态
|
||
tags:
|
||
- 任务查询
|
||
/api/v1/getTaskStatus:
|
||
post:
|
||
consumes:
|
||
- application/json
|
||
description: 查询推理任务的执行状态和推理URL
|
||
parameters:
|
||
- description: 查询参数
|
||
in: body
|
||
name: request
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/models.InferenceTaskStatusRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/models.InferenceTaskStatusResponse'
|
||
"400":
|
||
description: Bad Request
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
"500":
|
||
description: Internal Server Error
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
summary: 查询任务状态
|
||
tags:
|
||
- 任务查询
|
||
/api/v1/stopInferenceTask:
|
||
post:
|
||
consumes:
|
||
- application/json
|
||
description: 停止正在运行的推理任务
|
||
parameters:
|
||
- description: 停止任务参数
|
||
in: body
|
||
name: request
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/models.StopInferenceTaskRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/models.StopInferenceTaskResponse'
|
||
"400":
|
||
description: Bad Request
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
"500":
|
||
description: Internal Server Error
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
summary: 停止推理任务
|
||
tags:
|
||
- 任务控制
|
||
/api/v1/submitInferenceTaskAsync:
|
||
post:
|
||
consumes:
|
||
- application/json
|
||
description: 异步提交推理任务,立即返回 task_id,任务在后台处理
|
||
parameters:
|
||
- description: 推理任务配置
|
||
in: body
|
||
name: request
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/models.InferenceSubmitTaskRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/models.InferenceAsyncSubmitResponse'
|
||
"400":
|
||
description: Bad Request
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
"500":
|
||
description: Internal Server Error
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
summary: 异步提交推理任务
|
||
tags:
|
||
- 任务管理
|
||
/api/v1/submitTask:
|
||
post:
|
||
consumes:
|
||
- application/json
|
||
description: 同步提交推理任务,包含代码、模型、增量模型的准备步骤,等待完成后返回结果
|
||
parameters:
|
||
- description: 推理任务配置
|
||
in: body
|
||
name: request
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/models.InferenceSubmitTaskRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/models.InferenceSubmitTaskResponse'
|
||
"400":
|
||
description: Bad Request
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
"500":
|
||
description: Internal Server Error
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
summary: 提交推理任务(同步)
|
||
tags:
|
||
- 任务管理
|
||
/api/v1/uploadCode:
|
||
post:
|
||
consumes:
|
||
- application/json
|
||
description: 上传代码资源到远程存储
|
||
parameters:
|
||
- description: 代码配置
|
||
in: body
|
||
name: request
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/models.UploadCodeRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
allOf:
|
||
- $ref: '#/definitions/handler.Response'
|
||
- properties:
|
||
data:
|
||
properties:
|
||
codeID:
|
||
type: integer
|
||
type: object
|
||
type: object
|
||
"400":
|
||
description: Bad Request
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
"500":
|
||
description: Internal Server Error
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
summary: 上传代码资源
|
||
tags:
|
||
- 资源上传
|
||
/api/v1/uploadModel:
|
||
post:
|
||
consumes:
|
||
- application/json
|
||
description: 上传模型资源到远程存储
|
||
parameters:
|
||
- description: 模型配置
|
||
in: body
|
||
name: request
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/models.DataResourceConfig'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
allOf:
|
||
- $ref: '#/definitions/handler.Response'
|
||
- properties:
|
||
data:
|
||
properties:
|
||
modelID:
|
||
type: integer
|
||
type: object
|
||
type: object
|
||
"400":
|
||
description: Bad Request
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
"500":
|
||
description: Internal Server Error
|
||
schema:
|
||
$ref: '#/definitions/handler.Response'
|
||
summary: 上传模型资源
|
||
tags:
|
||
- 资源上传
|
||
/health:
|
||
get:
|
||
description: 检查服务健康状态
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
allOf:
|
||
- $ref: '#/definitions/handler.Response'
|
||
- properties:
|
||
data:
|
||
properties:
|
||
status:
|
||
type: string
|
||
type: object
|
||
type: object
|
||
summary: 健康检查
|
||
tags:
|
||
- 系统
|
||
schemes:
|
||
- http
|
||
- https
|
||
swagger: "2.0"
|