| @@ -788,7 +788,7 @@ type LogFile struct { | |||||
| Name string | Name string | ||||
| } | } | ||||
| func Cloudbrains(opts *CloudbrainsOptions) ([]*Cloudbrain, int64, error) { | |||||
| func Cloudbrains(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) { | |||||
| sess := x.NewSession() | sess := x.NewSession() | ||||
| defer sess.Close() | defer sess.Close() | ||||
| @@ -23,14 +23,14 @@ const ( | |||||
| FlavorInfo = "Ascend: 1*Ascend 910 CPU: 24 核 96GiB (modelarts.kat1.xlarge)" | FlavorInfo = "Ascend: 1*Ascend 910 CPU: 24 核 96GiB (modelarts.kat1.xlarge)" | ||||
| //train-job | //train-job | ||||
| ResourcePools = "{\"resource_pool\":[{\"id\":\"pool1328035d\", \"value\":\"专属资源池\"}]}" | |||||
| Engines = "{\"engine\":[{\"id\":1, \"value\":\"Ascend-Powered-Engine\"}]}" | |||||
| EngineVersions = "{\"version\":[{\"id\":118,\"value\":\"MindSpore-1.0.0-c75-python3.7-euleros2.8-aarch64\"}," + | |||||
| "{\"id\":119,\"value\":\"MindSpore-1.1.1-c76-python3.7-euleros2.8-aarch64\"}," + | |||||
| "{\"id\":120,\"value\":\"MindSpore-1.1.1-c76-tr5-python3.7-euleros2.8-aarch64\"}," + | |||||
| "{\"id\":117,\"value\":\"TF-1.15-c75-python3.7-euleros2.8-aarch64\"}" + | |||||
| "]}" | |||||
| // FlavorInfos = "{\"flavor\":[{\"code\":\"modelarts.bm.910.arm.public.2\",\"value\":\"Ascend : 2 * Ascend 910 CPU:48 核 512GiB\"}," + | |||||
| // ResourcePools = "{\"resource_pool\":[{\"id\":\"pool1328035d\", \"value\":\"专属资源池\"}]}" | |||||
| // Engines = "{\"engine\":[{\"id\":1, \"value\":\"Ascend-Powered-Engine\"}]}" | |||||
| // EngineVersions = "{\"version\":[{\"id\":118,\"value\":\"MindSpore-1.0.0-c75-python3.7-euleros2.8-aarch64\"}," + | |||||
| // "{\"id\":119,\"value\":\"MindSpore-1.1.1-c76-python3.7-euleros2.8-aarch64\"}," + | |||||
| // "{\"id\":120,\"value\":\"MindSpore-1.1.1-c76-tr5-python3.7-euleros2.8-aarch64\"}," + | |||||
| // "{\"id\":117,\"value\":\"TF-1.15-c75-python3.7-euleros2.8-aarch64\"}" + | |||||
| // "]}" | |||||
| // TrainJobFlavorInfo = "{\"flavor\":[{\"code\":\"modelarts.bm.910.arm.public.2\",\"value\":\"Ascend : 2 * Ascend 910 CPU:48 核 512GiB\"}," + | |||||
| // "{\"code\":\"modelarts.bm.910.arm.public.8\",\"value\":\"Ascend : 8 * Ascend 910 CPU:192 核 2048GiB\"}," + | // "{\"code\":\"modelarts.bm.910.arm.public.8\",\"value\":\"Ascend : 8 * Ascend 910 CPU:192 核 2048GiB\"}," + | ||||
| // "{\"code\":\"modelarts.bm.910.arm.public.4\",\"value\":\"Ascend : 4 * Ascend 910 CPU:96 核 1024GiB\"}," + | // "{\"code\":\"modelarts.bm.910.arm.public.4\",\"value\":\"Ascend : 4 * Ascend 910 CPU:96 核 1024GiB\"}," + | ||||
| // "{\"code\":\"modelarts.bm.910.arm.public.1\",\"value\":\"Ascend : 1 * Ascend 910 CPU:24 核 256GiB\"}" + | // "{\"code\":\"modelarts.bm.910.arm.public.1\",\"value\":\"Ascend : 1 * Ascend 910 CPU:24 核 256GiB\"}" + | ||||
| @@ -483,7 +483,11 @@ var ( | |||||
| ProfileID string | ProfileID string | ||||
| PoolInfos string | PoolInfos string | ||||
| Flavor string | Flavor string | ||||
| FlavorInfos string | |||||
| //train-job | |||||
| ResourcePools string | |||||
| Engines string | |||||
| EngineVersions string | |||||
| FlavorInfos string | |||||
| //elk config | //elk config | ||||
| ElkUrl string | ElkUrl string | ||||
| @@ -1215,7 +1219,10 @@ func NewContext() { | |||||
| AllowedOrg = sec.Key("ORGANIZATION").MustString("") | AllowedOrg = sec.Key("ORGANIZATION").MustString("") | ||||
| ProfileID = sec.Key("PROFILE_ID").MustString("") | ProfileID = sec.Key("PROFILE_ID").MustString("") | ||||
| PoolInfos = sec.Key("POOL_INFOS").MustString("") | PoolInfos = sec.Key("POOL_INFOS").MustString("") | ||||
| Flavor = sec.Key("FLAVOR").MustString("") | |||||
| Flavor = sec.Key("FLAVOR").MustString("modelarts.bm.910.arm.public.2") | |||||
| ResourcePools = sec.Key("Resource_Pools").MustString("") | |||||
| Engines = sec.Key("Engines").MustString("") | |||||
| EngineVersions = sec.Key("Engine_Versions").MustString("") | |||||
| FlavorInfos = sec.Key("FLAVOR_INFOS").MustString("") | FlavorInfos = sec.Key("FLAVOR_INFOS").MustString("") | ||||
| sec = Cfg.Section("elk") | sec = Cfg.Section("elk") | ||||
| @@ -550,21 +550,21 @@ func TrainJobNew(ctx *context.Context) { | |||||
| ctx.Data["attachments"] = attachs | ctx.Data["attachments"] = attachs | ||||
| var resourcePools modelarts.ResourcePool | var resourcePools modelarts.ResourcePool | ||||
| if err = json.Unmarshal([]byte(modelarts.ResourcePools), &resourcePools); err != nil { | |||||
| if err = json.Unmarshal([]byte(setting.ResourcePools), &resourcePools); err != nil { | |||||
| ctx.ServerError("json.Unmarshal failed:", err) | ctx.ServerError("json.Unmarshal failed:", err) | ||||
| return | return | ||||
| } | } | ||||
| ctx.Data["resource_pools"] = resourcePools.Info | ctx.Data["resource_pools"] = resourcePools.Info | ||||
| var engines modelarts.Engine | var engines modelarts.Engine | ||||
| if err = json.Unmarshal([]byte(modelarts.Engines), &engines); err != nil { | |||||
| if err = json.Unmarshal([]byte(setting.Engines), &engines); err != nil { | |||||
| ctx.ServerError("json.Unmarshal failed:", err) | ctx.ServerError("json.Unmarshal failed:", err) | ||||
| return | return | ||||
| } | } | ||||
| ctx.Data["engines"] = engines.Info | ctx.Data["engines"] = engines.Info | ||||
| var versionInfos modelarts.VersionInfo | var versionInfos modelarts.VersionInfo | ||||
| if err = json.Unmarshal([]byte(modelarts.EngineVersions), &versionInfos); err != nil { | |||||
| if err = json.Unmarshal([]byte(setting.EngineVersions), &versionInfos); err != nil { | |||||
| ctx.ServerError("json.Unmarshal failed:", err) | ctx.ServerError("json.Unmarshal failed:", err) | ||||
| return | return | ||||
| } | } | ||||
| @@ -738,7 +738,8 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||||
| return | return | ||||
| } | } | ||||
| ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/train-job") | |||||
| // ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/train-job")\ | |||||
| ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts") | |||||
| } | } | ||||
| // readDir reads the directory named by dirname and returns | // readDir reads the directory named by dirname and returns | ||||