|
|
|
@@ -740,7 +740,10 @@ func generateCommand(repoName, processorType, codeRemotePath, dataRemotePath, bo |
|
|
|
workDir = grampus.GpuWorkDir |
|
|
|
} |
|
|
|
|
|
|
|
command += "pwd;cd " + workDir + grampus.CommandPrepareScript |
|
|
|
commandPrepareScript := ";mkdir -p output;mkdir -p code;mkdir -p dataset;mkdir -p model;chmod -R 777 output code dataset model;echo \"start loading script\";wget -q https://git.openi.org.cn/OpenIOSSG/" + setting.Grampus.ScriptName + "/archive/master.zip" + |
|
|
|
";echo \"finish loading script\";unzip -q master.zip;cd " + setting.Grampus.ScriptName + ";chmod 777 downloader_for_obs uploader_for_obs downloader_for_minio uploader_for_minio;" |
|
|
|
|
|
|
|
command += "pwd;cd " + workDir + commandPrepareScript |
|
|
|
//download code & dataset |
|
|
|
if processorType == grampus.ProcessorTypeNPU { |
|
|
|
commandDownload := "./downloader_for_obs " + setting.Bucket + " " + codeRemotePath + " " + grampus.CodeArchiveName + " " + dataRemotePath + " '" + datasetName + "';" |
|
|
|
@@ -750,10 +753,6 @@ func generateCommand(repoName, processorType, codeRemotePath, dataRemotePath, bo |
|
|
|
command += commandDownload |
|
|
|
} |
|
|
|
|
|
|
|
//check download result |
|
|
|
commandCheckRes := "bash -c \"[[ $? -eq 0 ]] && exit 0 || exit -1;\";" |
|
|
|
command += commandCheckRes |
|
|
|
|
|
|
|
//unzip code & dataset |
|
|
|
toolUnzip := "unzip -q '" |
|
|
|
if strings.HasSuffix(datasetName, ".tar.gz") { |
|
|
|
@@ -762,10 +761,6 @@ func generateCommand(repoName, processorType, codeRemotePath, dataRemotePath, bo |
|
|
|
commandUnzip := "cd " + workDir + "code;unzip -q master.zip;echo \"start to unzip dataset\";cd " + workDir + "dataset;" + toolUnzip + datasetName + "';" |
|
|
|
command += commandUnzip |
|
|
|
|
|
|
|
//check unzip result |
|
|
|
commandCheckRes = "bash -c \"[[ $? -eq 0 ]] && exit 0 || exit -1;\";" |
|
|
|
command += commandCheckRes |
|
|
|
|
|
|
|
command += "echo \"unzip finished;start to exec code;\";" |
|
|
|
|
|
|
|
//exec code |
|
|
|
@@ -800,12 +795,12 @@ func generateCommand(repoName, processorType, codeRemotePath, dataRemotePath, bo |
|
|
|
commandUpload := "cd " + workDir + "script_for_grampus/;./uploader_for_obs " + setting.Bucket + " " + outputRemotePath + " " + workDir + "output/;" |
|
|
|
command += commandUpload |
|
|
|
} else if processorType == grampus.ProcessorTypeGPU { |
|
|
|
commandUpload := "cd " + workDir + "script_for_grampus/;./uploader_for_minio " + setting.Grampus.Env + " " + outputRemotePath + " " + workDir + "output/;" |
|
|
|
commandUpload := "cd " + workDir + "script_for_grampus/;./uploader_for_minio " + setting.Grampus.Env + " " + outputRemotePath + " " + workDir + "model/;" |
|
|
|
command += commandUpload |
|
|
|
} |
|
|
|
|
|
|
|
//check exec result |
|
|
|
commandCheckRes = "bash -c \"[[ $result -eq 0 ]] && exit 0 || exit -1\"" |
|
|
|
commandCheckRes := "bash -c \"[[ $result -eq 0 ]] && exit 0 || exit -1\"" |
|
|
|
command += commandCheckRes |
|
|
|
|
|
|
|
return command, nil |
|
|
|
|