Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d1a9ef8
feat(di-trainer/di-jobmonitor/di-lcm/di-cli):
renzhe-li Apr 6, 2022
7ef0b56
feat(appconns/dss-mlflow-appconn): Add MLFlow Appconn
James23Wang Apr 6, 2022
5898faf
"feat(appconns/dss-mlss-appconn): Add MLSS Appconn
hexudong111 Apr 6, 2022
cc5aa2a
feat(mf): Add Model Factory Module
bleachzk Apr 6, 2022
4ebbe3d
feat(isntall): Update install file
alexzyWu Apr 6, 2022
3e9746c
feat(isntall): Update install file
alexzyWu Apr 6, 2022
bd8b620
Merge pull request #46 from alexzyWu/master
alexzyWu Apr 6, 2022
c0b7652
docs(docs): Update docs module
alexzyWu Apr 6, 2022
444d2ce
feat(mllabis): Add resource modification and release
alexzyWu Apr 6, 2022
d691742
1.add
uuarttt Apr 6, 2022
e07d105
Merge pull request #48 from hanwutian/master
alexzyWu Apr 6, 2022
33b87f6
Merge pull request #47 from alexzyWu/mllabis-resource-control-feature
alexzyWu Apr 6, 2022
268f286
Merge pull request #45 from bleachzk/master
alexzyWu Apr 6, 2022
3119e8c
Merge pull request #44 from hexudong111/master
alexzyWu Apr 6, 2022
d42fd7e
Merge pull request #42 from James23Wang/dev
alexzyWu Apr 6, 2022
d0f5db6
Merge pull request #43 from renzhe-li/dev
alexzyWu Apr 6, 2022
f8ef67e
Merge branch 'WeBankFinTech:dev-0.3.0' into dev-0.3.0
alexzyWu Apr 7, 2022
a218e8c
fix(mllabis): Remove parameter limit in notebook creation
alexzyWu Apr 7, 2022
191b003
Merge pull request #50 from alexzyWu/mllabis-parameter-limit
alexzyWu Apr 7, 2022
f61b3e8
fix(ui): update ui
alexzyWu Apr 7, 2022
9263079
fix(ui): Remove output in UI
alexzyWu Apr 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(mllabis): Remove parameter limit in notebook creation
1、Remove cluster parameter limit in notebook creation.
  • Loading branch information
alexzyWu committed Apr 7, 2022
commit a218e8ce1b34f933e1d68029a758fd71d9845cbf
22 changes: 11 additions & 11 deletions mllabis/notebook-server/pkg/commons/utils/notebook_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ const (
LimitsCpu = "limits.cpu"
LimitsMemory = "limits.memory"
RequestsNvidiaComGpu = "requests.nvidia.com/gpu"
BDAP = "bdap"
BDAPSAFE = "bdapsafe"
BDP = "bdp"
//BDAP = "bdap"
//BDAPSAFE = "bdapsafe"
//BDP = "bdp"
Standard = "Standard"
Custom = "Custom"
New = "New"
Expand Down Expand Up @@ -177,10 +177,10 @@ func CheckPatchNotebook(notebook *models.PatchNotebookRequest, namespace string,
return errors.New("memory can not greater than the limit")
}

split := strings.Split(namespace, "-")
if BDAP != split[2] && BDP != split[2] {
return errors.New("cluster name must be BDAP or BDP")
}
//split := strings.Split(namespace, "-")
//if BDAP != split[2] && BDP != split[2] {
// return errors.New("cluster name must be BDAP or BDP")
//}
//// 9.addNotebook时,imageType != null,可选Standard或Custom;
logger.Logger().Infof("notebook.Image: %v, %v", notebook.ImageName, notebook.ImageType)
if notebook.ImageName == "" || (notebook.ImageType != Custom && notebook.ImageType != Standard) {
Expand Down Expand Up @@ -327,10 +327,10 @@ func CheckNotebook(params operations.PostNamespacedNotebookParams) error {
//String[] split = namespace.split("-");
//if (!BDPConstants.ClusterName.BDAP.equals(split[2]))
//throw new BDPException("cluster name must be BDAP");
split := strings.Split(*namespace, "-")
if BDAP != split[2] && BDP != split[2] {
return errors.New("cluster name must be BDAP or BDP")
}
//split := strings.Split(*namespace, "-")
//if BDAP != split[2] && BDP != split[2] {
// return errors.New("cluster name must be BDAP or BDP")
//}
//// 9.addNotebook时,imageType != null,可选Standard或Custom;
//if (notebook.getImage() == null || !EnumUtils.isValidEnum(BDPConstants.imageType.class, notebook.getImage().getImageType()))
//throw new BDPException("imageType must be Standard or Custom");
Expand Down
48 changes: 23 additions & 25 deletions mllabis/notebook-server/pkg/mongo/notebook_mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ package mongo

import (
"gopkg.in/mgo.v2/bson"
stringsUtil "strings"
"webank/AIDE/notebook-server/pkg/commons/logger"
"webank/AIDE/notebook-server/pkg/commons/utils"
"webank/AIDE/notebook-server/pkg/models"
)

func SearchNoteBook(query interface{}) ([]utils.NotebookInMongo, error) {
Expand Down Expand Up @@ -153,26 +151,26 @@ func UpdateNotebookById(id string, m bson.M) error {
return err
}

func getNoteBookByClusterName(clusterName string, res []*models.Notebook) []*models.Notebook {
clusterResult := make([]*models.Notebook, 0)
if len(res) > 0 {
if clusterName != "" {
for _, v := range res {
if clusterName == utils.BDP || clusterName == utils.BDAP {
if stringsUtil.Split(v.Namespace, "-")[2] == clusterName && !stringsUtil.Contains(stringsUtil.Split(v.Namespace, "-")[6], "safe") {
clusterResult = append(clusterResult, v)
}
}
if clusterName == utils.BDAPSAFE {
if stringsUtil.Split(v.Namespace, "-")[2] == utils.BDAP && stringsUtil.Contains(stringsUtil.Split(v.Namespace, "-")[6], "safe") {
clusterResult = append(clusterResult, v)
}
}
}
//res = clusterResult
} else {
clusterResult = res
}
}
return clusterResult
}
//func getNoteBookByClusterName(clusterName string, res []*models.Notebook) []*models.Notebook {
// clusterResult := make([]*models.Notebook, 0)
// if len(res) > 0 {
// if clusterName != "" {
// for _, v := range res {
// if clusterName == utils.BDP || clusterName == utils.BDAP {
// if stringsUtil.Split(v.Namespace, "-")[2] == clusterName && !stringsUtil.Contains(stringsUtil.Split(v.Namespace, "-")[6], "safe") {
// clusterResult = append(clusterResult, v)
// }
// }
// if clusterName == utils.BDAPSAFE {
// if stringsUtil.Split(v.Namespace, "-")[2] == utils.BDAP && stringsUtil.Contains(stringsUtil.Split(v.Namespace, "-")[6], "safe") {
// clusterResult = append(clusterResult, v)
// }
// }
// }
// //res = clusterResult
// } else {
// clusterResult = res
// }
// }
// return clusterResult
//}
47 changes: 4 additions & 43 deletions mllabis/notebook-server/pkg/restapi/models_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1110,52 +1110,13 @@ func getDashboards(params operations.GetDashboardsParams) middleware.Responder {

//FIXME MLSS Change: v_1.5.1 add logic for path when create notebook
func getNoteBookByClusterName(clusterName string, res []*models.Notebook) []*models.Notebook {
clusterResult := make([]*models.Notebook, 0)
if len(res) > 0 {
if clusterName != "" {
for _, v := range res {
if clusterName == utils.BDP || clusterName == utils.BDAP {
if stringsUtil.Split(v.Namespace, "-")[2] == clusterName && !stringsUtil.Contains(stringsUtil.Split(v.Namespace, "-")[6], "safe") {
clusterResult = append(clusterResult, v)
}
}
if clusterName == utils.BDAPSAFE {
if stringsUtil.Split(v.Namespace, "-")[2] == utils.BDAP && stringsUtil.Contains(stringsUtil.Split(v.Namespace, "-")[6], "safe") {
clusterResult = append(clusterResult, v)
}
}
}
//res = clusterResult
} else {
clusterResult = res
}
}
return clusterResult
return res
}

func getNoteBookInMongoByClusterName(clusterName string, res []utils.NotebookInMongo) []utils.NotebookInMongo {
clusterResult := make([]utils.NotebookInMongo, 0)
if len(res) > 0 {
if clusterName != "" {
for _, v := range res {
if clusterName == utils.BDP || clusterName == utils.BDAP {
if stringsUtil.Split(v.Namespace, "-")[2] == clusterName &&
!stringsUtil.Contains(stringsUtil.Split(v.Namespace, "-")[6], "safe") {
clusterResult = append(clusterResult, v)
}
}
if clusterName == utils.BDAPSAFE {
if stringsUtil.Split(v.Namespace, "-")[2] == utils.BDAP &&
stringsUtil.Contains(stringsUtil.Split(v.Namespace, "-")[6], "safe") {
clusterResult = append(clusterResult, v)
}
}
}
} else {
clusterResult = res
}
}
return clusterResult
//clusterResult := make([]utils.NotebookInMongo, 0)
//clusterResult = res
return res
}

//FIXME MLSS Change: v_1.5.1 add logic for path when create notebook
Expand Down
Loading