From 9d57eee16b8efd5db7d032c7556eb9a8a7b48c67 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Mon, 1 Aug 2022 15:07:36 +0800 Subject: [PATCH 1/2] debug --- routers/repo/grampus.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/routers/repo/grampus.go b/routers/repo/grampus.go index 76f2bd98c5..c48950915d 100755 --- a/routers/repo/grampus.go +++ b/routers/repo/grampus.go @@ -787,8 +787,17 @@ func generateCommand(repoName, processorType, codeRemotePath, dataRemotePath, bo } } - commandCode := "cd " + workDir + "code/" + strings.ToLower(repoName) + ";python " + bootFile + paramCode + ";" - command += commandCode + if processorType == grampus.ProcessorTypeNPU { + commandCode := "cd " + workDir + "code/" + strings.ToLower(repoName) + ";python " + bootFile + paramCode + ";" + commandCode = "/bin/bash /home/work/run_train_for_openi.sh " + workDir + "code/" + strings.ToLower(repoName) + "/" + bootFile + " /tmp/log/train.log" + paramCode + ";" + command += commandCode + } else if processorType == grampus.ProcessorTypeGPU { + commandCode := "cd " + workDir + "code/" + strings.ToLower(repoName) + ";python " + bootFile + paramCode + ";" + command += commandCode + } + + //commandCode := "cd " + workDir + "code/" + strings.ToLower(repoName) + ";python " + bootFile + paramCode + ";" + //command += commandCode //get exec result commandGetRes := "result=$?;" -- 2.34.1 From 78cea11898fceab693c5fff11acab037a09071b3 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Mon, 8 Aug 2022 16:40:18 +0800 Subject: [PATCH 2/2] opt --- routers/repo/grampus.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/routers/repo/grampus.go b/routers/repo/grampus.go index c48950915d..9a1f9591c6 100755 --- a/routers/repo/grampus.go +++ b/routers/repo/grampus.go @@ -787,17 +787,14 @@ func generateCommand(repoName, processorType, codeRemotePath, dataRemotePath, bo } } + var commandCode string if processorType == grampus.ProcessorTypeNPU { - commandCode := "cd " + workDir + "code/" + strings.ToLower(repoName) + ";python " + bootFile + paramCode + ";" commandCode = "/bin/bash /home/work/run_train_for_openi.sh " + workDir + "code/" + strings.ToLower(repoName) + "/" + bootFile + " /tmp/log/train.log" + paramCode + ";" - command += commandCode } else if processorType == grampus.ProcessorTypeGPU { - commandCode := "cd " + workDir + "code/" + strings.ToLower(repoName) + ";python " + bootFile + paramCode + ";" - command += commandCode + commandCode = "cd " + workDir + "code/" + strings.ToLower(repoName) + ";python " + bootFile + paramCode + ";" } - //commandCode := "cd " + workDir + "code/" + strings.ToLower(repoName) + ";python " + bootFile + paramCode + ";" - //command += commandCode + command += commandCode //get exec result commandGetRes := "result=$?;" -- 2.34.1