forked from JointCloud/pcm-coordinator
272 lines
7.9 KiB
Plaintext
272 lines
7.9 KiB
Plaintext
syntax = "v1"
|
||
|
||
info(
|
||
title: "schedule"
|
||
desc: "调度服务"
|
||
author: "tzwang"
|
||
email: "tzwang@qq.com"
|
||
)
|
||
|
||
type (
|
||
ScheduleReq {
|
||
Token string `json:"token,optional"`
|
||
AiOption *AiOption `json:"aiOption,optional"`
|
||
}
|
||
|
||
ScheduleResp {
|
||
Results []*ScheduleResult `json:"results"`
|
||
}
|
||
|
||
ScheduleResult {
|
||
ClusterId string `json:"clusterId"`
|
||
TaskId string `json:"taskId"`
|
||
Card string `json:"card"`
|
||
Strategy string `json:"strategy"`
|
||
JobId string `json:"jobId"`
|
||
Replica int32 `json:"replica"`
|
||
Msg string `json:"msg"`
|
||
}
|
||
|
||
ScheduleOverviewResp {
|
||
}
|
||
|
||
AiOption {
|
||
TaskName string `json:"taskName"`
|
||
AdapterId string `json:"adapterId"`
|
||
AiClusterIds []string `json:"aiClusterIds"`
|
||
ResourceType string `json:"resourceType"`
|
||
ComputeCard string `json:"card"`
|
||
Tops float64 `json:"Tops,optional"`
|
||
TaskType string `json:"taskType"`
|
||
Datasets string `json:"datasets"`
|
||
Algorithm string `json:"algorithm"`
|
||
Strategy string `json:"strategy"`
|
||
StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"`
|
||
Params []string `json:"params,optional"`
|
||
Envs []string `json:"envs,optional"`
|
||
Cmd string `json:"cmd,optional"`
|
||
Replica int32 `json:"replicas"`
|
||
}
|
||
|
||
AiResourceTypesResp {
|
||
ResourceTypes []string `json:"resourceTypes"`
|
||
}
|
||
|
||
AiTaskTypesResp {
|
||
TaskTypes []string `json:"taskTypes"`
|
||
}
|
||
|
||
AiDatasetsReq {
|
||
AdapterId string `path:"adapterId"`
|
||
}
|
||
|
||
AiDatasetsResp {
|
||
Datasets []string `json:"datasets"`
|
||
}
|
||
|
||
AiStrategyResp {
|
||
Strategies []string `json:"strategies"`
|
||
}
|
||
|
||
AiAlgorithmsReq {
|
||
AdapterId string `path:"adapterId"`
|
||
ResourceType string `path:"resourceType"`
|
||
TaskType string `path:"taskType"`
|
||
Dataset string `path:"dataset"`
|
||
}
|
||
|
||
AiAlgorithmsResp {
|
||
Algorithms []string `json:"algorithms"`
|
||
}
|
||
|
||
AiJobLogReq {
|
||
AdapterId string `path:"adapterId"`
|
||
ClusterId string `path:"clusterId"`
|
||
TaskId string `path:"taskId"`
|
||
instanceNum string `path:"instanceNum"`
|
||
}
|
||
|
||
AiJobLogResp {
|
||
Log string `json:"log"`
|
||
}
|
||
|
||
AiTaskDb {
|
||
Id string `json:"id,omitempty" db:"id"`
|
||
TaskId string `json:"taskId,omitempty" db:"task_id"`
|
||
AdapterId string `json:"adapterId,omitempty" db:"adapter_id"`
|
||
ClusterId string `json:"clusterId,omitempty" db:"cluster_id"`
|
||
Name string `json:"name,omitempty" db:"name"`
|
||
Replica string `json:"replica,omitempty" db:"replica"`
|
||
ClusterTaskId string `json:"clusterTaskId,omitempty" db:"c_task_id"`
|
||
Strategy string `json:"strategy,omitempty" db:"strategy"`
|
||
Status string `json:"status,omitempty" db:"status"`
|
||
Msg string `json:"msg,omitempty" db:"msg"`
|
||
CommitTime string `json:"commitTime,omitempty" db:"commit_time"`
|
||
StartTime string `json:"startTime,omitempty" db:"start_time"`
|
||
EndTime string `json:"endTime,omitempty" db:"end_time"`
|
||
}
|
||
|
||
DownloadAlgorithmCodeReq {
|
||
AdapterId string `form:"adapterId"`
|
||
ClusterId string `form:"clusterId"`
|
||
ResourceType string `form:"resourceType"`
|
||
Card string `form:"card"`
|
||
TaskType string `form:"taskType"`
|
||
Dataset string `form:"dataset"`
|
||
Algorithm string `form:"algorithm"`
|
||
}
|
||
|
||
DownloadAlgorithmCodeResp {
|
||
Code string `json:"code"`
|
||
}
|
||
|
||
UploadAlgorithmCodeReq {
|
||
AdapterId string `json:"adapterId"`
|
||
ClusterId string `json:"clusterId"`
|
||
ResourceType string `json:"resourceType"`
|
||
Card string `json:"card"`
|
||
TaskType string `json:"taskType"`
|
||
Dataset string `json:"dataset"`
|
||
Algorithm string `json:"algorithm"`
|
||
Code string `json:"code"`
|
||
}
|
||
|
||
UploadAlgorithmCodeResp {
|
||
}
|
||
|
||
GetComputeCardsByClusterReq {
|
||
AdapterId string `path:"adapterId"`
|
||
ClusterId string `path:"clusterId"`
|
||
}
|
||
|
||
GetComputeCardsByClusterResp {
|
||
Cards []string `json:"cards"`
|
||
}
|
||
|
||
GetClusterBalanceByIdReq{
|
||
AdapterId string `path:"adapterId"`
|
||
ClusterId string `path:"clusterId"`
|
||
}
|
||
|
||
GetClusterBalanceByIdResp{
|
||
Balance float64 `json:"balance"`
|
||
}
|
||
|
||
// 调度资源信息:/queryResources
|
||
QueryResourcesReq{
|
||
ClusterIDs []string `json:"clusterIDs,optional"`
|
||
}
|
||
|
||
QueryResourcesResp{
|
||
Data interface{} `json:"data"`
|
||
}
|
||
|
||
// 创建任务(下发资源):/createTask
|
||
CreateTaskReq{
|
||
Name string `json:"name"`
|
||
Description string `json:"description,optional"`
|
||
Token string `json:"token,optional"`
|
||
UserIp string `json:"userIp,optional"`
|
||
JobResources JobResources `json:"jobResources"`
|
||
DataDistributes DataDistribute `json:"dataDistributes"`
|
||
}
|
||
|
||
JobResources{
|
||
ScheduleStrategy string `json:"scheduleStrategy"`
|
||
Clusters []*JobClusterInfo `json:"clusters"`
|
||
}
|
||
|
||
JobClusterInfo{
|
||
ClusterID string `json:"clusterID"`
|
||
Resources []map[string]interface{} `json:"resources,optional"`
|
||
Runtime JobRuntimeInfo `json:"runtime,optional"`
|
||
}
|
||
|
||
JobRuntimeInfo{
|
||
Command string `json:"command,optional"`
|
||
Envs map[string]interface{} `json:"envs,optional"`
|
||
Params map[string]interface{} `json:"params,optional"`
|
||
}
|
||
|
||
DataDistribute {
|
||
Dataset []*DatasetDistribute `json:"dataset,optional"`
|
||
Code []*CodeDistribute `json:"code"`
|
||
Image []*ImageDistribute `json:"image"`
|
||
Model []*ModelDistribute `json:"model,optional"`
|
||
}
|
||
|
||
DatasetDistribute {
|
||
DataName string `json:"dataName,optional"`
|
||
PackageID int64 `json:"packageID"`
|
||
Clusters []*ClusterScheduled `json:"clusters"`
|
||
}
|
||
|
||
CodeDistribute {
|
||
DataName string `json:"dataName,optional"`
|
||
PackageID int64 `json:"packageID"`
|
||
Output string `json:"output"`
|
||
Clusters []*ClusterScheduled `json:"clusters"`
|
||
}
|
||
|
||
ImageDistribute {
|
||
DataName string `json:"dataName,optional"`
|
||
PackageID int64 `json:"packageID"`
|
||
Clusters []*ClusterScheduled `json:"clusters"`
|
||
}
|
||
|
||
ModelDistribute {
|
||
DataName string `json:"dataName,optional"`
|
||
PackageID int64 `json:"packageID"`
|
||
Clusters []*ClusterScheduled `json:"clusters"`
|
||
}
|
||
|
||
ClusterScheduled {
|
||
ClusterID string `json:"clusterID"`
|
||
JsonData string `json:"jsonData"`
|
||
}
|
||
|
||
CreateTaskResp {
|
||
TaskID int64 `json:"taskID"`
|
||
TaskName string `json:"taskName"`
|
||
ScheduleDatas []*ScheduleData `json:"scheduleDatas"`
|
||
}
|
||
|
||
ScheduleData {
|
||
DataType string `json:"dataType"` // 数据类型:数据集、镜像..
|
||
PackageID int64 `json:"packageID"`
|
||
StorageType string `json:"storageType"` // 目的地类型:如代码仓、JCS
|
||
ClusterIDs []string `json:"clusterIDs"`
|
||
}
|
||
|
||
// 启动任务(资源已就绪):/runTask
|
||
RunTaskReq {
|
||
TaskID int64 `json:"taskID"`
|
||
ScheduledDatas []*DataScheduleResults `json:"scheduledDatas,optional"`
|
||
}
|
||
|
||
DataScheduleResults {
|
||
DataType string `json:"dataType"`
|
||
Results []*DataScheduleResult `json:"results"`
|
||
}
|
||
|
||
DataScheduleResult {
|
||
Clusters []*ClusterScheduled `json:"clusters"`
|
||
PackageID int64 `json:"packageID"`
|
||
PackageFullPath string `json:"packageFullPath"`
|
||
Status bool `json:"status"`
|
||
Msg string `json:"msg"`
|
||
}
|
||
|
||
RunTaskResp {
|
||
|
||
}
|
||
|
||
CancelTaskReq {
|
||
TaskId int64 `json:"taskID"`
|
||
}
|
||
|
||
CancelTaskResp {
|
||
|
||
}
|
||
|
||
) |