| @@ -172,12 +172,12 @@ type VmInfo struct { | |||||
| MinCount int64 `json:"minCount,omitempty"` | MinCount int64 `json:"minCount,omitempty"` | ||||
| Uuid string `json:"uuid,omitempty"` | Uuid string `json:"uuid,omitempty"` | ||||
| StartTime string `json:"startTime,omitempty"` | StartTime string `json:"startTime,omitempty"` | ||||
| RunningTime string `json:"runningTime,omitempty"` | |||||
| Result string `json:"result,omitempty"` | |||||
| DeletedAt string `json:"deletedAt,omitempty"` | |||||
| VmName string `json:"vmName,omitempty"` | |||||
| Replicas int64 `json:"replicas,omitempty"` | |||||
| ServerId string `json:"serverId,omitempty"` | |||||
| //RunningTime string `json:"runningTime,omitempty"` | |||||
| //Result string `json:"result,omitempty"` | |||||
| //DeletedAt string `json:"deletedAt,omitempty"` | |||||
| VmName string `json:"vmName,omitempty"` | |||||
| Replicas int64 `json:"replicas,omitempty"` | |||||
| ServerId string `json:"serverId,omitempty"` | |||||
| } | } | ||||
| type ResourceStats struct { | type ResourceStats struct { | ||||
| @@ -1149,7 +1149,7 @@ type ( | |||||
| ProjectId string `json:"projectId" copier:"ProjectId"` | ProjectId string `json:"projectId" copier:"ProjectId"` | ||||
| Param ListNotebookParam `json:"param,optional" copier:"Param"` | Param ListNotebookParam `json:"param,optional" copier:"Param"` | ||||
| /****************智算类型 ModelartsType parmas ********************/ | /****************智算类型 ModelartsType parmas ********************/ | ||||
| ModelArtsType string `json:"modelArtsType,optional"` | |||||
| Platform string `json:"platform,optional"` | |||||
| } | } | ||||
| ListNotebookResp { | ListNotebookResp { | ||||
| Current int32 `json:"current,omitempty" copier:"Current"` | Current int32 `json:"current,omitempty" copier:"Current"` | ||||
| @@ -1205,7 +1205,7 @@ type ( | |||||
| ProjectId string `json:"projectId" copier:"ProjectId"` | ProjectId string `json:"projectId" copier:"ProjectId"` | ||||
| Param StartNotebookParam `json:"param" copier:"Param"` | Param StartNotebookParam `json:"param" copier:"Param"` | ||||
| /****************智算类型 ModelartsType parmas ********************/ | /****************智算类型 ModelartsType parmas ********************/ | ||||
| ModelArtsType string `json:"modelArtsType,optional"` | |||||
| Platform string `json:"platform,optional"` | |||||
| } | } | ||||
| StartNotebookResp { | StartNotebookResp { | ||||
| NotebookResp NotebookResp `json:"notebookResp" copier:"NotebookResp"` | NotebookResp NotebookResp `json:"notebookResp" copier:"NotebookResp"` | ||||
| @@ -32,16 +32,17 @@ THRpcConf: | |||||
| #rpc | #rpc | ||||
| ModelArtsRpcConf: | ModelArtsRpcConf: | ||||
| target: nacos://10.206.0.12:8848/pcm.modelarts.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api | |||||
| # Endpoints: | |||||
| # - 127.0.0.1:8888 | |||||
| # target: nacos://10.206.0.12:8848/pcm.modelarts.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api | |||||
| Endpoints: | |||||
| - 127.0.0.1:2002 | |||||
| NonBlock: true | NonBlock: true | ||||
| Timeout: 20000 | |||||
| #rpc | #rpc | ||||
| ModelArtsImgRpcConf: | ModelArtsImgRpcConf: | ||||
| target: nacos://10.206.0.12:8848/pcm.modelarts.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api | target: nacos://10.206.0.12:8848/pcm.modelarts.rpc?timeout=30s&namespaceid=test&groupname=DEFAULT_GROUP&appName=pcm.core.api | ||||
| # Endpoints: | # Endpoints: | ||||
| # - 127.0.0.1:8888 | |||||
| # - 127.0.0.1:2002 | |||||
| NonBlock: true | NonBlock: true | ||||
| #rpc | #rpc | ||||
| @@ -52,11 +52,6 @@ func (l *CommitVmTaskLogic) CommitVmTask(req *types.CommitVmTaskReq) (resp *type | |||||
| }() | }() | ||||
| //TODO adapter | //TODO adapter | ||||
| adapterId, _ := strconv.ParseUint(req.AdapterIds[0], 10, 64) | adapterId, _ := strconv.ParseUint(req.AdapterIds[0], 10, 64) | ||||
| /*var clusters []*models.VmModel | |||||
| err2 := l.svcCtx.DbEngin.Raw("SELECT * FROM `t_cluster` where adapter_id in ? and id in ?", adapterId, req.ClusterIds).Scan(&clusters).Error | |||||
| if err2 != nil { | |||||
| logx.Errorf("CommitGeneralTask() => sql execution error: %v", err) | |||||
| }*/ | |||||
| taskVm := models.TaskVm{} | taskVm := models.TaskVm{} | ||||
| //TODO 执行策略返回集群跟 Replica | //TODO 执行策略返回集群跟 Replica | ||||
| opt := &option.VmOption{} | opt := &option.VmOption{} | ||||
| @@ -91,7 +86,7 @@ func (l *CommitVmTaskLogic) CommitVmTask(req *types.CommitVmTaskReq) (resp *type | |||||
| Name: req.Name, | Name: req.Name, | ||||
| CommitTime: time.Now(), | CommitTime: time.Now(), | ||||
| Description: "vm task", | Description: "vm task", | ||||
| AdapterTypeDict: 3, | |||||
| AdapterTypeDict: 0, | |||||
| SynergyStatus: synergyStatus, | SynergyStatus: synergyStatus, | ||||
| Strategy: strategy, | Strategy: strategy, | ||||
| } | } | ||||
| @@ -59,8 +59,8 @@ func (l *PushTaskInfoLogic) PushTaskInfo(req *clientCore.PushTaskInfoReq) (*clie | |||||
| } | } | ||||
| case 02: | case 02: | ||||
| for _, vmInfo := range req.VmInfoList { | for _, vmInfo := range req.VmInfoList { | ||||
| l.svcCtx.DbEngin.Exec("update task_vm set status = ?,start_time = ? where participant_id = ? and task_id = ? and name = ?", | |||||
| vmInfo.Status, vmInfo.StartTime, req.AdapterId, vmInfo.TaskId, vmInfo.Name) | |||||
| l.svcCtx.DbEngin.Exec("update task_vm set status = ?,start_time = ? where cluster_id = ? and task_id = ? and name = ?", | |||||
| vmInfo.Status, vmInfo.StartTime, vmInfo.ClusterId, vmInfo.TaskId, vmInfo.Name) | |||||
| noticeInfo := clientCore.NoticeInfo{ | noticeInfo := clientCore.NoticeInfo{ | ||||
| TaskId: vmInfo.TaskId, | TaskId: vmInfo.TaskId, | ||||
| AdapterId: vmInfo.AdapterId, | AdapterId: vmInfo.AdapterId, | ||||
| @@ -2319,9 +2319,9 @@ type DeleteDataSetResp struct { | |||||
| } | } | ||||
| type ListNotebookReq struct { | type ListNotebookReq struct { | ||||
| ProjectId string `json:"projectId" copier:"ProjectId"` | |||||
| Param ListNotebookParam `json:"param,optional" copier:"Param"` | |||||
| ModelArtsType string `json:"modelArtsType,optional"` | |||||
| ProjectId string `json:"projectId" copier:"ProjectId"` | |||||
| Param ListNotebookParam `json:"param,optional" copier:"Param"` | |||||
| Platform string `json:"platform,optional"` | |||||
| } | } | ||||
| type ListNotebookResp struct { | type ListNotebookResp struct { | ||||
| @@ -2377,10 +2377,10 @@ type CreateNotebookParam struct { | |||||
| } | } | ||||
| type StartNotebookReq struct { | type StartNotebookReq struct { | ||||
| Id string `json:"id" copier:"Id"` | |||||
| ProjectId string `json:"projectId" copier:"ProjectId"` | |||||
| Param StartNotebookParam `json:"param" copier:"Param"` | |||||
| ModelArtsType string `json:"modelArtsType,optional"` | |||||
| Id string `json:"id" copier:"Id"` | |||||
| ProjectId string `json:"projectId" copier:"ProjectId"` | |||||
| Param StartNotebookParam `json:"param" copier:"Param"` | |||||
| Platform string `json:"platform,optional"` | |||||
| } | } | ||||
| type StartNotebookResp struct { | type StartNotebookResp struct { | ||||