2025-09-30 08:40:52 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
2026-01-30 09:33:11 +08:00
|
|
|
|
import "time"
|
|
|
|
|
|
|
2025-09-30 08:40:52 +08:00
|
|
|
|
// SubmitTaskRequest 提交任务的请求结构体
|
|
|
|
|
|
type SubmitTaskRequest struct {
|
|
|
|
|
|
RunConfig RunConfig `json:"run_config"` // 运行配置
|
|
|
|
|
|
CodeID int `json:"code_id"` // 上传代码返回的ID
|
|
|
|
|
|
ModelID int `json:"model_id"` // 上传模型返回的ID
|
|
|
|
|
|
DatasetID int `json:"dataset_id"` // 数据集ID(可选)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// UploadCodeRequest 上传代码的请求结构体
|
|
|
|
|
|
type UploadCodeRequest struct {
|
|
|
|
|
|
RunConfig RunConfig `json:"run_config"` // 运行配置
|
|
|
|
|
|
}
|
2026-01-26 14:32:32 +08:00
|
|
|
|
|
|
|
|
|
|
// InferenceSubmitTaskRequest 推理任务提交请求结构体
|
|
|
|
|
|
type InferenceSubmitTaskRequest struct {
|
|
|
|
|
|
Version string `json:"version"` // 版本
|
|
|
|
|
|
Description string `json:"description"` // 描述
|
|
|
|
|
|
Model DataResourceConfig `json:"model"` // 模型信息
|
|
|
|
|
|
SubModel *DataResourceConfig `json:"sub_model"` // 增量模型信息(可选)
|
|
|
|
|
|
Image ImageInfo `json:"image"` // 镜像信息
|
|
|
|
|
|
CodeConfig CodeConfig `json:"code_config"` // 代码配置
|
|
|
|
|
|
ResourceType string `json:"resource_type"` // 资源类型
|
2026-01-30 09:33:11 +08:00
|
|
|
|
Resource RemoteSourceConfig `json:"resource"` // 资源配置
|
2026-01-26 14:32:32 +08:00
|
|
|
|
Command string `json:"command"` // 启动命令
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-30 09:33:11 +08:00
|
|
|
|
type RemoteSourceConfig struct {
|
|
|
|
|
|
Id int `json:"id"`
|
|
|
|
|
|
SourceKey string `json:"sourceKey"`
|
|
|
|
|
|
Type string `json:"type"`
|
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
|
TotalCount int `json:"totalCount"`
|
|
|
|
|
|
AvailableCount int `json:"availableCount"`
|
|
|
|
|
|
ChangeType int `json:"changeType"`
|
|
|
|
|
|
Status int `json:"status"`
|
|
|
|
|
|
Region string `json:"region"`
|
|
|
|
|
|
ClusterID string `json:"clusterId"`
|
|
|
|
|
|
CostPerUnit int `json:"costPerUnit"`
|
|
|
|
|
|
CostType string `json:"costType"`
|
|
|
|
|
|
Tag string `json:"tag"`
|
|
|
|
|
|
UserId string `json:"userId"`
|
|
|
|
|
|
CreateTime time.Time `json:"createTime"`
|
|
|
|
|
|
UpdateTime time.Time `json:"updateTime"`
|
|
|
|
|
|
BaseResourceSpecs []BaseResourceSpec
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type BaseResourceSpec struct {
|
|
|
|
|
|
Id int `json:"id"`
|
|
|
|
|
|
ResourceSpecId int `json:"resourceSpecId"`
|
|
|
|
|
|
Type string `json:"type"`
|
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
|
TotalValue int `json:"totalValue"`
|
|
|
|
|
|
TotalUnit string `json:"totalUnit"`
|
|
|
|
|
|
AvailableValue int `json:"availableValue"`
|
|
|
|
|
|
AvailableUnit string `json:"availableUnit"`
|
|
|
|
|
|
UserId string `json:"userId"`
|
|
|
|
|
|
CreateTime time.Time `json:"createTime"`
|
|
|
|
|
|
UpdateTime time.Time `json:"updateTime"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-26 14:32:32 +08:00
|
|
|
|
// ImageInfo 镜像信息
|
|
|
|
|
|
type ImageInfo struct {
|
|
|
|
|
|
ImageID int `json:"imageID"`
|
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
|
CreateTime string `json:"createTime"`
|
|
|
|
|
|
ClusterImages []ClusterImage `json:"clusterImages"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ClusterImage 集群镜像信息
|
|
|
|
|
|
type ClusterImage struct {
|
|
|
|
|
|
ImageID int `json:"imageID"`
|
|
|
|
|
|
ClusterID string `json:"clusterID"`
|
|
|
|
|
|
OriginImageType string `json:"originImageType"`
|
|
|
|
|
|
OriginImageID string `json:"originImageID"`
|
|
|
|
|
|
OriginImageName string `json:"originImageName"`
|
|
|
|
|
|
Cards []Card `json:"cards"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Card 卡片信息
|
|
|
|
|
|
type Card struct {
|
|
|
|
|
|
OriginImageID string `json:"originImageID"`
|
|
|
|
|
|
Card string `json:"card"`
|
|
|
|
|
|
}
|