Browse Source

debug

tags/v1.22.6.2
lewis 3 years ago
parent
commit
e46202f0ac
2 changed files with 8 additions and 5 deletions
  1. +1
    -1
      modules/grampus/grampus.go
  2. +7
    -4
      routers/repo/grampus.go

+ 1
- 1
modules/grampus/grampus.go View File

@@ -40,7 +40,7 @@ const (
ProcessorTypeNPU = "npu.huawei.com/NPU"
ProcessorTypeGPU = "nvidia.com/gpu"

CommandPrepareScript = "pwd;cd /tmp;mkdir output;mkdir code;mkdir dataset;wget https://git.openi.org.cn/lewis/script_for_grampus/archive/master.zip;unzip master.zip;cd script_for_grampus;chmod 777 sync_for_arm uploader_for_grampus;"
CommandPrepareScript = "pwd;cd /tmp;mkdir output;mkdir code;mkdir dataset;wget -q https://git.openi.org.cn/lewis/script_for_grampus/archive/master.zip;unzip -q master.zip;cd script_for_grampus;chmod 777 sync_for_arm uploader_for_grampus;"
CodeArchiveName = "master.zip"
)



+ 7
- 4
routers/repo/grampus.go View File

@@ -312,9 +312,7 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
}

//prepare command
//todo: download code, download dataset, unzip dataset, exec code, upload model
command, err := generateCommand(repo.Name, grampus.ProcessorTypeNPU, codeObsPath+cloudbrain.DefaultBranchName+".zip", dataObsPath+attachment.Name, bootFile, params, setting.CodePathPrefix+jobName+modelarts.OutputPath, attachment.Name)
log.Info(command)

commitID, _ := ctx.Repo.GitRepo.GetBranchCommitID(branchName)

@@ -550,7 +548,12 @@ func generateCommand(repoName, processorType, codeObsPath, dataObsPath, bootFile
}

//unzip code & dataset
commandUnzip := "cd /tmp/dataset;unzip " + datasetName + ";cd /tmp/code;unzip master.zip;"
toolUnzip := "unzip -q "
if strings.HasSuffix(datasetName, ".tar.gz") {
toolUnzip = "tar -zxvf "
}
commandUnzip := "cd /tmp/dataset;" + toolUnzip + datasetName + ";cd /tmp/code;unzip -q master.zip;"
commandUnzip += "cd /tmp/dataset/" + strings.TrimSuffix(datasetName, ".zip") + ";ls;"
command += commandUnzip

//exec code
@@ -573,7 +576,7 @@ func generateCommand(repoName, processorType, codeObsPath, dataObsPath, bootFile
}
}

commandCode := "cd " + repoName + ";python " + bootFile + paramCode + ";"
commandCode := "cd /tmp/code/" + repoName + ";python " + bootFile + paramCode + ";"
command += commandCode

//upload models


Loading…
Cancel
Save