#798 章鱼调试任务优化

Merged
linfj merged 4 commits from openioctopus/octopus:master into master 1 month ago
  1. +2
    -2
      deploy/charts/octopus/values.yaml
  2. +3
    -0
      server/base-server/api/v1/develop.proto
  3. +18
    -3
      server/base-server/internal/service/develop/develop.go
  4. +3
    -0
      server/openai-server/api/v1/develop.proto
  5. +7
    -1
      server/openai-server/internal/service/develop.go

+ 2
- 2
deploy/charts/octopus/values.yaml View File

@@ -519,8 +519,8 @@ metax-gpu-extensions:

enflame:
enabled: false
gcuDevicePluginImage: 192.168.202.110:5000/octopus/enflame-gcu-k8s-device-plugin:v1.0.0-dev
gcuExporterImage: 192.168.202.110:5000/octopus/enflame-gcu-exporter:v1.0.1-dev
gcuDevicePluginImage: swr.cn-south-1.myhuaweicloud.com/openioctopus/enflame-gcu-k8s-device-plugin:1.3.20231214
gcuExporterImage: swr.cn-south-1.myhuaweicloud.com/openioctopus/enflame-gcu-exporter:1.3.20231214

cambricon:
enabled: false


+ 3
- 0
server/base-server/api/v1/develop.proto View File

@@ -61,6 +61,7 @@ message CreateNotebookReply {

message StartNotebookRequest {
string id = 1[(validate.rules).string = {min_len: 1}];
int64 autoStopDuration = 2;
}

message StartNotebookReply {
@@ -131,6 +132,8 @@ message Notebook {
string command = 27;
int64 autoStopDuration = 28;
string operation = 29;
int64 startedAt = 30;
int64 stoppedAt = 31;
}

message ListNotebookReply {


+ 18
- 3
server/base-server/internal/service/develop/develop.go View File

@@ -512,10 +512,15 @@ func (s *developService) StartNotebook(ctx context.Context, req *api.StartNotebo
return err
}

if req.AutoStopDuration != 0 {
nb.AutoStopDuration = req.AutoStopDuration
}

err = s.data.DevelopDao.UpdateNotebookSelective(ctx, &model.Notebook{
Id: nb.Id,
NotebookJobId: jobId,
Status: constant.PREPARING,
Id: nb.Id,
NotebookJobId: jobId,
Status: constant.PREPARING,
AutoStopDuration: nb.AutoStopDuration,
})
if err != nil {
return err
@@ -952,6 +957,16 @@ func (s *developService) convertNotebook(ctx context.Context, notebooksTbl []*mo
}
notebook.ExitMsg = s.getExitMsg(ctx, jobMap[n.NotebookJobId])
notebook.Operation = jobMap[n.NotebookJobId].Operation
if jobMap[n.NotebookJobId].StartedAt != nil {
notebook.StartedAt = jobMap[n.NotebookJobId].StartedAt.Unix()
} else {
notebook.StartedAt = 0
}
if jobMap[n.NotebookJobId].StoppedAt != nil {
notebook.StoppedAt = jobMap[n.NotebookJobId].StoppedAt.Unix()
} else {
notebook.StoppedAt = 0
}
notebooks = append(notebooks, notebook)
}
return notebooks, nil


+ 3
- 0
server/openai-server/api/v1/develop.proto View File

@@ -101,6 +101,7 @@ message CreateNotebookReply {

message StartNotebookRequest {
string id = 1[(validate.rules).string = {min_len: 1}];
int64 autoStopDuration = 2;
}

message StartNotebookReply {
@@ -173,6 +174,8 @@ message Notebook {
string exitMsg = 25;
string command = 26;
int64 autoStopDuration = 27;
int64 startedAt = 28;
int64 stoppedAt = 29;
}

message ListNotebookReply {


+ 7
- 1
server/openai-server/internal/service/develop.go View File

@@ -67,7 +67,13 @@ func (s *DevelopService) StartNotebook(ctx context.Context, req *api.StartNotebo
return nil, err
}

reply, err := s.data.DevelopClient.StartNotebook(ctx, &innerapi.StartNotebookRequest{Id: req.Id})
innerReq := &innerapi.StartNotebookRequest{}
err = copier.Copy(innerReq, req)
if err != nil {
return nil, err
}

reply, err := s.data.DevelopClient.StartNotebook(ctx, innerReq)
if err != nil {
return nil, err
}


Loading…
Cancel
Save