|
|
|
@@ -80,6 +80,7 @@ func CloudBrainIndex(ctx *context.Context) { |
|
|
|
} |
|
|
|
|
|
|
|
ciTasks[i].CanDel = cloudbrain.CanDeleteDebugJob(ctx, &task.Cloudbrain) |
|
|
|
ciTasks[i].Cloudbrain.ComputeResource = modelarts.GPUResource |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@@ -340,7 +341,7 @@ func CloudBrainDebug(ctx *context.Context) { |
|
|
|
var jobID = ctx.Params(":jobid") |
|
|
|
if !ctx.IsSigned { |
|
|
|
log.Error("the user has not signed in") |
|
|
|
ctx.Error(http.StatusForbidden, "","the user has not signed in") |
|
|
|
ctx.Error(http.StatusForbidden, "", "the user has not signed in") |
|
|
|
return |
|
|
|
} |
|
|
|
task, err := models.GetCloudbrainByJobID(jobID) |
|
|
|
@@ -357,7 +358,7 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain |
|
|
|
var jobID = ctx.Params(":jobid") |
|
|
|
if !ctx.IsSigned { |
|
|
|
log.Error("the user has not signed in") |
|
|
|
ctx.Error(http.StatusForbidden, "","the user has not signed in") |
|
|
|
ctx.Error(http.StatusForbidden, "", "the user has not signed in") |
|
|
|
return |
|
|
|
} |
|
|
|
task, err := models.GetCloudbrainByJobID(jobID) |
|
|
|
@@ -392,6 +393,7 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain |
|
|
|
|
|
|
|
func CloudBrainStop(ctx *context.Context) { |
|
|
|
var jobID = ctx.Params(":jobid") |
|
|
|
debugListType := ctx.Query("debugListType") |
|
|
|
task, err := models.GetCloudbrainByJobID(jobID) |
|
|
|
if err != nil { |
|
|
|
ctx.ServerError("GetCloudbrainByJobID failed", err) |
|
|
|
@@ -417,8 +419,12 @@ func CloudBrainStop(ctx *context.Context) { |
|
|
|
ctx.ServerError("UpdateJob failed", err) |
|
|
|
return |
|
|
|
} |
|
|
|
if debugListType == modelarts.AllResource { |
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob") |
|
|
|
} else { |
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain") |
|
|
|
} |
|
|
|
|
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain") |
|
|
|
} |
|
|
|
|
|
|
|
func StopJobsByUserID(userID int64) { |
|
|
|
@@ -503,6 +509,7 @@ func logErrorAndUpdateJobStatus(err error, taskInfo *models.Cloudbrain) { |
|
|
|
|
|
|
|
func CloudBrainDel(ctx *context.Context) { |
|
|
|
var jobID = ctx.Params(":jobid") |
|
|
|
debugListType := ctx.Query("debugListType") |
|
|
|
task, err := models.GetCloudbrainByJobID(jobID) |
|
|
|
if err != nil { |
|
|
|
ctx.ServerError("GetCloudbrainByJobID failed", err) |
|
|
|
@@ -520,8 +527,11 @@ func CloudBrainDel(ctx *context.Context) { |
|
|
|
ctx.ServerError("DeleteJob failed", err) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain") |
|
|
|
if debugListType == modelarts.AllResource { |
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob") |
|
|
|
} else { |
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func CloudBrainShowModels(ctx *context.Context) { |
|
|
|
|