@@ -1690,8 +1690,28 @@ func GrampusMetrics(ctx *context.Context) {
return
}
func GrampusDebugJobEvents(ctx *context.Context) {
ID := ctx.Params(":id")
job, err := models.GetCloudbrainByID(ID)
if err != nil {
log.Error("GetCloudbrainByID failed: %v", err, ctx.Data["MsgID"])
ctx.ServerError(err.Error(), err)
return
}
result, err := grampus.GetDebugJobEvents(job.JobID)
if err != nil {
log.Error("GetDebugJobEvents failed: %v", err, ctx.Data["MsgID"])
}
ctx.JSON(http.StatusOK, map[string]interface{}{
"JobID": ID,
"JobEvents": result.NotebookEvents,
})
return
}
func GrampusJobEvents(ctx *context.Context) {
func GrampusTrain JobEvents(ctx *context.Context) {
jobID := ctx.Params(":jobid")
job, err := models.GetCloudbrainByJobID(jobID)
if err != nil {
@@ -1700,7 +1720,7 @@ func GrampusJobEvents(ctx *context.Context) {
return
}
result, err := grampus.GetJobEvents(job.JobID)
result, err := grampus.GetTrain JobEvents(job.JobID)
if err != nil {
log.Error("GetJobEvents failed: %v", err, ctx.Data["MsgID"])
}
@@ -1775,12 +1795,12 @@ func generateCommand(repoName, processorType, bootFile, paramSrc, outputRemotePa
commandCode = "source /home/ma-user/.bashrc;python /home/ma-user/davinci/train/davincirun.py python /home/ma-user/openi.py " + paramCode + ";"
} else if processorType == grampus.ProcessorTypeGPU {
if pretrainModelFileName != "" {
paramCode += " --ckpt_url" + "='" + workDir + "pretrainmodel/" + pretrainModelFileName+"'"
paramCode += " --ckpt_url" + "='" + workDir + "pretrainmodel/" + pretrainModelFileName + "'"
}
commandCode = "cd " + workDir + "code/" + strings.ToLower(repoName) + ";python " + bootFile + paramCode + ";"
} else if processorType == grampus.ProcessorTypeGCU {
if pretrainModelFileName != "" {
paramCode += " --ckpt_url" + "='" + workDir + "pretrainmodel/" + pretrainModelFileName+"'"
paramCode += " --ckpt_url" + "='" + workDir + "pretrainmodel/" + pretrainModelFileName + "'"
}
commandCode = "cd " + workDir + "code/" + strings.ToLower(repoName) + ";python3 " + bootFile + paramCode + ";"
}