Merge pull request 'update modelarts' (#223) from master-wq into master

Former-commit-id: 8ec84383c3ecb14a6325fb4a568981334c27fc0c
This commit is contained in:
qiwang 2024-06-14 17:34:02 +08:00
commit 7cae5b03ae
6 changed files with 23 additions and 27 deletions

View File

@ -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 {

View File

@ -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"`

View File

@ -24,16 +24,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

View File

@ -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,
}

View File

@ -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,

View File

@ -2329,9 +2329,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 {
@ -2387,10 +2387,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 {