|
|
|
@@ -99,45 +99,6 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { |
|
|
|
var displayJobName = jobNamePrefixValid(cutString(ctx.User.Name, 5)) + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:] |
|
|
|
ctx.Data["display_job_name"] = displayJobName |
|
|
|
|
|
|
|
result, err := cloudbrain.GetImages() |
|
|
|
if err != nil { |
|
|
|
ctx.Data["error"] = err.Error() |
|
|
|
log.Error("cloudbrain.GetImages failed:", err.Error(), ctx.Data["MsgID"]) |
|
|
|
} |
|
|
|
|
|
|
|
for i, payload := range result.Payload.ImageInfo { |
|
|
|
if strings.HasPrefix(result.Payload.ImageInfo[i].Place, "192.168") { |
|
|
|
result.Payload.ImageInfo[i].PlaceView = payload.Place[strings.Index(payload.Place, "/"):len(payload.Place)] |
|
|
|
} else { |
|
|
|
result.Payload.ImageInfo[i].PlaceView = payload.Place |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ctx.Data["images"] = result.Payload.ImageInfo |
|
|
|
|
|
|
|
resultPublic, err := cloudbrain.GetPublicImages() |
|
|
|
if err != nil { |
|
|
|
ctx.Data["error"] = err.Error() |
|
|
|
log.Error("cloudbrain.GetPublicImages failed:", err.Error(), ctx.Data["MsgID"]) |
|
|
|
} |
|
|
|
|
|
|
|
for i, payload := range resultPublic.Payload.ImageInfo { |
|
|
|
if strings.HasPrefix(resultPublic.Payload.ImageInfo[i].Place, "192.168") { |
|
|
|
resultPublic.Payload.ImageInfo[i].PlaceView = payload.Place[strings.Index(payload.Place, "/"):len(payload.Place)] |
|
|
|
} else { |
|
|
|
resultPublic.Payload.ImageInfo[i].PlaceView = payload.Place |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ctx.Data["public_images"] = resultPublic.Payload.ImageInfo |
|
|
|
|
|
|
|
attachs, err := models.GetAllUserAttachments(ctx.User.ID) |
|
|
|
if err != nil { |
|
|
|
log.Error("GetAllUserAttachments failed: %v", err, ctx.Data["MsgID"]) |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
ctx.Data["attachments"] = attachs |
|
|
|
ctx.Data["command"] = cloudbrain.Command |
|
|
|
ctx.Data["code_path"] = cloudbrain.CodeMountPath |
|
|
|
ctx.Data["dataset_path"] = cloudbrain.DataSetMountPath |
|
|
|
@@ -353,7 +314,7 @@ func CloudBrainInferenceJobCreate(ctx *context.Context, form auth.CreateCloudBra |
|
|
|
branchName := form.BranchName |
|
|
|
repo := ctx.Repo.Repository |
|
|
|
|
|
|
|
ckptUrl := setting.Attachment.Minio.RealPath + setting.Attachment.Minio.Bucket + "/" + form.TrainUrl + form.CkptName |
|
|
|
ckptUrl := setting.Attachment.Minio.RealPath + "/" + form.TrainUrl + form.CkptName |
|
|
|
log.Info("ckpt url:" + ckptUrl) |
|
|
|
tpl := tplCloudBrainInferenceJobNew |
|
|
|
command, err := getInferenceJobCommand(form) |
|
|
|
|