Browse Source

debug modelarts

tags/v1.21.12.1
yuyuanshifu 4 years ago
parent
commit
a8318daafe
1 changed files with 13 additions and 2 deletions
  1. +13
    -2
      routers/repo/modelarts.go

+ 13
- 2
routers/repo/modelarts.go View File

@@ -5,6 +5,7 @@ import (
"errors"
"github.com/unknwon/com"
"strconv"
"strings"
"time"

"code.gitea.io/gitea/models"
@@ -146,7 +147,7 @@ func ModelArtsShow(ctx *context.Context) {

func ModelArtsDebug(ctx *context.Context) {
var jobID = ctx.Params(":jobid")
task, err := models.GetCloudbrainByJobID(jobID)
_, err := models.GetCloudbrainByJobID(jobID)
if err != nil {
ctx.ServerError("GetCloudbrainByJobID failed", err)
return
@@ -164,7 +165,17 @@ func ModelArtsDebug(ctx *context.Context) {
return
}

urlPrefix := result.Spec.Annotations.TargetDomain + "/modelarts/internal/hub/notebook/user/" + task.JobID

urls := strings.Split(result.Spec.Annotations.Url, "/")
urlPrefix := result.Spec.Annotations.TargetDomain
for i, url := range urls {
if i > 2 {
urlPrefix += "/" + url
}
}

//urlPrefix := result.Spec.Annotations.TargetDomain + "/modelarts/internal/hub/notebook/user/" + task.JobID
log.Info(urlPrefix)
debugUrl := urlPrefix + "?token=" + res.Token
ctx.Redirect(debugUrl)
}


Loading…
Cancel
Save