#4937 推理日志强行返回所有

Merged
chenyifan01 merged 4 commits from zouap_dev into V20231120 5 months ago
  1. +3
    -11
      services/ai_task_service/cluster/c2net.go

+ 3
- 11
services/ai_task_service/cluster/c2net.go View File

@@ -738,9 +738,7 @@ func (c C2NetClusterAdapter) GetLog(opts entity.ClusterLogOpts) (*entity.Cluster
}

func getOnlineInferenceLog(opts entity.ClusterLogOpts) string {

helper := storage_helper.SelectUploaderFromStorageType(entity.MINIO)

//查找日志文件
files := getLogFilesInStorage(helper, helper.GetJobDefaultObjectKeyPrefix(opts.JobName)+"/model", ".txt")
if len(files) == 0 {
@@ -750,16 +748,11 @@ func getOnlineInferenceLog(opts entity.ClusterLogOpts) string {
}
//默认选择第一个文件
file := files[0]
if opts.Direction == "" {
opts.Direction = entity.UP
}
opts.Direction = entity.UP
//计算开始行和结束行
startLine, endLine := findStartAndEnd(opts, file.RelativePath, helper)
if opts.Lines == -1 {
startLine = 1
}
_, endLine := findStartAndEnd(opts, file.RelativePath, helper)
//获取日志内容
result, _, _ := getLogInStorage(startLine, endLine, helper, file.RelativePath)
result, _, _ := getLogInStorage(1, endLine, helper, file.RelativePath)

return result
}
@@ -783,7 +776,6 @@ func (c C2NetClusterAdapter) GetLogDownloadInfo(opts entity.ClusterLogDownloadIn
JobId: opts.JobId,
NodeId: opts.NodeId,
WorkServerNum: opts.WorkServerNum,
Lines: -1,
})
if err != nil {
log.Error("error occurs when attempting to get log content.opts=%+v err=%v", opts, err)


Loading…
Cancel
Save