From a16f9fc13d691e034b7615657ef95e63b54f4f5c Mon Sep 17 00:00:00 2001 From: qiwang <1364512070@qq.com> Date: Fri, 14 Jun 2024 17:16:55 +0800 Subject: [PATCH] fix: update modelarts 0614 Former-commit-id: d7c0b75c051ed6ed44142ca3d109232f9f17f80c --- api/client/types.go | 12 ++++++------ api/desc/ai/pcm-ai.api | 4 ++-- api/etc/pcm.yaml | 9 +++++---- api/internal/logic/core/commitvmtasklogic.go | 7 +------ api/internal/logic/core/pushtaskinfologic.go | 4 ++-- api/internal/types/types.go | 14 +++++++------- 6 files changed, 23 insertions(+), 27 deletions(-) diff --git a/api/client/types.go b/api/client/types.go index 6e729cd5..b47f59b8 100644 --- a/api/client/types.go +++ b/api/client/types.go @@ -172,12 +172,12 @@ type VmInfo struct { MinCount int64 `json:"minCount,omitempty"` Uuid string `json:"uuid,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 { diff --git a/api/desc/ai/pcm-ai.api b/api/desc/ai/pcm-ai.api index 5e651a24..869693b8 100644 --- a/api/desc/ai/pcm-ai.api +++ b/api/desc/ai/pcm-ai.api @@ -1149,7 +1149,7 @@ type ( ProjectId string `json:"projectId" copier:"ProjectId"` Param ListNotebookParam `json:"param,optional" copier:"Param"` /****************智算类型 ModelartsType parmas ********************/ - ModelArtsType string `json:"modelArtsType,optional"` + Platform string `json:"platform,optional"` } ListNotebookResp { Current int32 `json:"current,omitempty" copier:"Current"` @@ -1205,7 +1205,7 @@ type ( ProjectId string `json:"projectId" copier:"ProjectId"` Param StartNotebookParam `json:"param" copier:"Param"` /****************智算类型 ModelartsType parmas ********************/ - ModelArtsType string `json:"modelArtsType,optional"` + Platform string `json:"platform,optional"` } StartNotebookResp { NotebookResp NotebookResp `json:"notebookResp" copier:"NotebookResp"` diff --git a/api/etc/pcm.yaml b/api/etc/pcm.yaml index ee51794e..a03e5147 100644 --- a/api/etc/pcm.yaml +++ b/api/etc/pcm.yaml @@ -32,16 +32,17 @@ THRpcConf: #rpc 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 + Timeout: 20000 #rpc ModelArtsImgRpcConf: 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 + # - 127.0.0.1:2002 NonBlock: true #rpc diff --git a/api/internal/logic/core/commitvmtasklogic.go b/api/internal/logic/core/commitvmtasklogic.go index dd0908ca..2c2424bf 100644 --- a/api/internal/logic/core/commitvmtasklogic.go +++ b/api/internal/logic/core/commitvmtasklogic.go @@ -52,11 +52,6 @@ func (l *CommitVmTaskLogic) CommitVmTask(req *types.CommitVmTaskReq) (resp *type }() //TODO adapter 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{} //TODO 执行策略返回集群跟 Replica opt := &option.VmOption{} @@ -91,7 +86,7 @@ func (l *CommitVmTaskLogic) CommitVmTask(req *types.CommitVmTaskReq) (resp *type Name: req.Name, CommitTime: time.Now(), Description: "vm task", - AdapterTypeDict: 3, + AdapterTypeDict: 0, SynergyStatus: synergyStatus, Strategy: strategy, } diff --git a/api/internal/logic/core/pushtaskinfologic.go b/api/internal/logic/core/pushtaskinfologic.go index 0d5e8bd4..442c60e0 100644 --- a/api/internal/logic/core/pushtaskinfologic.go +++ b/api/internal/logic/core/pushtaskinfologic.go @@ -59,8 +59,8 @@ func (l *PushTaskInfoLogic) PushTaskInfo(req *clientCore.PushTaskInfoReq) (*clie } case 02: 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{ TaskId: vmInfo.TaskId, AdapterId: vmInfo.AdapterId, diff --git a/api/internal/types/types.go b/api/internal/types/types.go index 29b50a13..9774d361 100644 --- a/api/internal/types/types.go +++ b/api/internal/types/types.go @@ -2319,9 +2319,9 @@ type DeleteDataSetResp 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 { @@ -2377,10 +2377,10 @@ type CreateNotebookParam 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 {