Browse Source

mlops

pull/3435/head
yanchao 2 years ago
parent
commit
0c10cd634d
1 changed files with 13 additions and 7 deletions
  1. +13
    -7
      routers/api/v1/user/repo.go

+ 13
- 7
routers/api/v1/user/repo.go View File

@@ -149,14 +149,20 @@ func ListOrgRepos(ctx *context.APIContext) {
}

func GetComputeNodes(ctx *context.APIContext) {
modelarts.InitMultiNode()
if modelarts.MultiNodeConfig != nil {
for _, info := range modelarts.MultiNodeConfig.Info {
if isInOrg, _ := models.IsOrganizationMemberByOrgName(info.Org, ctx.User.ID); isInOrg {
ctx.JSON(http.StatusOK, info.Node)
return
taskeType := ctx.QueryInt("type")
if taskeType == 2 {
ctx.JSON(http.StatusOK, []int{1})
} else {
modelarts.InitMultiNode()
if modelarts.MultiNodeConfig != nil {
for _, info := range modelarts.MultiNodeConfig.Info {
if isInOrg, _ := models.IsOrganizationMemberByOrgName(info.Org, ctx.User.ID); isInOrg {
ctx.JSON(http.StatusOK, info.Node)
return
}
}
}
ctx.JSON(http.StatusOK, []int{1})
}
ctx.JSON(http.StatusOK, []int{1})
}

Loading…
Cancel
Save