From 0c10cd634d7b4195145fd8066f585bbe386dc22c Mon Sep 17 00:00:00 2001 From: yanchao Date: Mon, 26 Dec 2022 14:16:27 +0800 Subject: [PATCH] mlops --- routers/api/v1/user/repo.go | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/routers/api/v1/user/repo.go b/routers/api/v1/user/repo.go index 01f643992..e9b8c6675 100644 --- a/routers/api/v1/user/repo.go +++ b/routers/api/v1/user/repo.go @@ -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}) + }