|
|
@@ -2763,18 +2763,25 @@ func InferenceCloudBrainJobShow(ctx *context.Context) { |
|
|
|
cloudBrainShow(ctx, tplCloudBrainInferenceJobShow, models.JobTypeInference) |
|
|
|
} |
|
|
|
|
|
|
|
func DownloadInferenceResultFile(ctx *context.Context) { |
|
|
|
func DownloadGPUInferenceResultFile(ctx *context.Context) { |
|
|
|
var jobID = ctx.Params(":jobid") |
|
|
|
var versionName = ctx.Query("version_name") |
|
|
|
task, err := models.GetCloudbrainByJobIDAndVersionName(jobID, versionName) |
|
|
|
task, err := models.GetCloudbrainByJobID(jobID) |
|
|
|
if err != nil { |
|
|
|
log.Error("GetCloudbrainByJobID(%s) failed:%v", task.JobName, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
allFile, err := storage.GetAllObjectByBucketAndPrefixMinio(setting.Attachment.Minio.Bucket, task.ResultUrl) |
|
|
|
returnFileName := task.DisplayJobName + ".zip" |
|
|
|
MinioDownloadManyFile(task.ResultUrl, ctx, returnFileName, allFile) |
|
|
|
parentDir := ctx.Query("parentDir") |
|
|
|
jobName := ctx.Query("jobName") |
|
|
|
filePath := "jobs/" + jobName + "/result/" + parentDir |
|
|
|
log.Info("prefix=" + filePath) |
|
|
|
allFile, err := storage.GetAllObjectByBucketAndPrefixMinio(setting.Attachment.Minio.Bucket, filePath) |
|
|
|
if err == nil { |
|
|
|
returnFileName := task.DisplayJobName + ".zip" |
|
|
|
MinioDownloadManyFile(filePath, ctx, returnFileName, allFile) |
|
|
|
} else { |
|
|
|
log.Info("error,msg=" + err.Error()) |
|
|
|
ctx.ServerError("no file to download.", err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func getInferenceJobCommand(form auth.CreateCloudBrainInferencForm) (string, error) { |
|
|
|