Browse Source

Merge branch 'fix-2643' of https://git.openi.org.cn/OpenI/aiforge into fix-2643

tags/v1.22.8.2^2
liuzx 3 years ago
parent
commit
e62810552e
25 changed files with 171 additions and 111 deletions
  1. +2
    -0
      go.sum
  2. +17
    -7
      models/dataset.go
  3. +22
    -24
      modules/cloudbrain/resty.go
  4. +2
    -0
      modules/setting/cloudbrain.go
  5. +10
    -5
      options/locale/locale_en-US.ini
  6. +7
    -3
      options/locale/locale_zh-CN.ini
  7. +2
    -1
      routers/api/v1/repo/cloudbrain.go
  8. +10
    -1
      routers/api/v1/repo/modelarts.go
  9. +13
    -1
      routers/repo/modelarts.go
  10. +10
    -0
      routers/repo/setting.go
  11. +2
    -2
      templates/custom/wait_count.tmpl
  12. +2
    -2
      templates/custom/wait_count_train.tmpl
  13. +3
    -3
      templates/home.tmpl
  14. +1
    -1
      templates/repo/cloudbrain/inference/show.tmpl
  15. +1
    -1
      templates/repo/cloudbrain/show.tmpl
  16. +2
    -2
      templates/repo/cloudbrain/trainjob/show.tmpl
  17. +1
    -1
      templates/repo/modelarts/inferencejob/new.tmpl
  18. +1
    -1
      templates/repo/modelarts/inferencejob/show.tmpl
  19. +4
    -4
      templates/repo/modelarts/notebook/show.tmpl
  20. +1
    -1
      templates/repo/modelarts/trainjob/new.tmpl
  21. +8
    -32
      templates/repo/modelarts/trainjob/show.tmpl
  22. +6
    -17
      templates/repo/modelarts/trainjob/version_new.tmpl
  23. +30
    -1
      web_src/js/features/cloudbrainShow.js
  24. +13
    -0
      web_src/js/features/cloudrbanin.js
  25. +1
    -1
      web_src/js/index.js

+ 2
- 0
go.sum View File

@@ -713,12 +713,14 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1
github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w= github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w=
github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
github.com/smartystreets/assertions v1.1.0 h1:MkTeG1DMwsrdH7QtLXy5W+fUxWq+vmb6cLmyJ7aRtF0=
github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM=
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8= github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8=
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE=


+ 17
- 7
models/dataset.go View File

@@ -88,7 +88,7 @@ func (datasets DatasetList) loadAttributes(e Engine) error {
if err := e. if err := e.
Where("id > 0"). Where("id > 0").
In("id", keysInt64(set)). In("id", keysInt64(set)).
Cols("id", "owner_id", "owner_name", "lower_name", "name", "description", "alias", "lower_alias","is_private").
Cols("id", "owner_id", "owner_name", "lower_name", "name", "description", "alias", "lower_alias", "is_private").
Find(&repos); err != nil { Find(&repos); err != nil {
return fmt.Errorf("find repos: %v", err) return fmt.Errorf("find repos: %v", err)
} }
@@ -121,12 +121,12 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions)
if attachment.DatasetID == datasets[i].ID { if attachment.DatasetID == datasets[i].ID {
if opts.StarByMe { if opts.StarByMe {


permission,ok := permissionMap[datasets[i].ID];
permission, ok := permissionMap[datasets[i].ID]
if !ok { if !ok {


permission = false permission = false
datasets[i].Repo.GetOwner() datasets[i].Repo.GetOwner()
if datasets[i].Repo.Owner.IsOrganization() {
if datasets[i].Repo.Owner.IsOrganization() {
if datasets[i].Repo.Owner.IsUserPartOfOrg(opts.User.ID) { if datasets[i].Repo.Owner.IsUserPartOfOrg(opts.User.ID) {
log.Info("user is member of org.") log.Info("user is member of org.")
permission = true permission = true
@@ -140,10 +140,10 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions)
} }
} }


permissionMap[datasets[i].ID]=permission
permissionMap[datasets[i].ID] = permission
} }


if permission{
if permission {
datasets[i].Attachments = append(datasets[i].Attachments, attachment) datasets[i].Attachments = append(datasets[i].Attachments, attachment)
} else if !attachment.IsPrivate { } else if !attachment.IsPrivate {
datasets[i].Attachments = append(datasets[i].Attachments, attachment) datasets[i].Attachments = append(datasets[i].Attachments, attachment)
@@ -159,8 +159,8 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions)
} }


for i := range datasets { for i := range datasets {
if datasets[i].Attachments==nil{
datasets[i].Attachments=[]*Attachment{}
if datasets[i].Attachments == nil {
datasets[i].Attachments = []*Attachment{}
} }
datasets[i].Repo.Owner = nil datasets[i].Repo.Owner = nil
} }
@@ -585,3 +585,13 @@ func GetTeamDatasetIdsByUserID(userID int64) []int64 {
Cols("dataset.id").Find(&datasets) Cols("dataset.id").Find(&datasets)
return datasets return datasets
} }

func UpdateDatasetCreateUser(ID int64, user *User) error {
_, err := x.Where("id = ?", ID).Cols("user_id").Update(&Dataset{
UserID: user.ID,
})
if err != nil {
return err
}
return nil
}

+ 22
- 24
modules/cloudbrain/resty.go View File

@@ -24,10 +24,11 @@ var (
) )


const ( const (
JobHasBeenStopped = "S410"
Public = "public"
Custom = "custom"
LogPageSize = 500
JobHasBeenStopped = "S410"
errInvalidToken = "S401"
Public = "public"
Custom = "custom"
LogPageSize = 500
LogPageTokenExpired = "5m" LogPageTokenExpired = "5m"
pageSize = 15 pageSize = 15
QueuesDetailUrl = "/rest-server/api/v2/queuesdetail" QueuesDetailUrl = "/rest-server/api/v2/queuesdetail"
@@ -59,7 +60,7 @@ func loginCloudbrain() error {


res, err := client.R(). res, err := client.R().
SetHeader("Content-Type", "application/json"). SetHeader("Content-Type", "application/json").
SetBody(map[string]interface{}{"username": username, "password": password, "expiration": "604800"}).
SetBody(map[string]interface{}{"username": username, "password": password, "expiration": conf.Expiration}).
SetResult(&loginResult). SetResult(&loginResult).
Post(HOST + "/rest-server/api/v1/token") Post(HOST + "/rest-server/api/v1/token")
if err != nil { if err != nil {
@@ -122,16 +123,12 @@ sendjob:
Post(HOST + "/rest-server/api/v1/jobs/") Post(HOST + "/rest-server/api/v1/jobs/")


if err != nil { if err != nil {
if res != nil {
var response models.CloudBrainResult
json.Unmarshal(res.Body(), &response)
log.Error("code(%s), msg(%s)", response.Code, response.Msg)
return nil, fmt.Errorf(response.Msg)
}
return nil, fmt.Errorf("resty create job: %s", err) return nil, fmt.Errorf("resty create job: %s", err)
} }


if jobResult.Code == "S401" && retry < 1 {
var response models.CloudBrainResult
json.Unmarshal(res.Body(), &response)
if response.Code == errInvalidToken && retry < 1 {
retry++ retry++
_ = loginCloudbrain() _ = loginCloudbrain()
goto sendjob goto sendjob
@@ -163,7 +160,9 @@ sendjob:
return nil, fmt.Errorf("resty GetJob: %v", err) return nil, fmt.Errorf("resty GetJob: %v", err)
} }


if getJobResult.Code == "S401" && retry < 1 {
var response models.CloudBrainResult
json.Unmarshal(res.Body(), &response)
if response.Code == errInvalidToken && retry < 1 {
retry++ retry++
_ = loginCloudbrain() _ = loginCloudbrain()
goto sendjob goto sendjob
@@ -196,13 +195,8 @@ sendjob:
} }


var response models.CloudBrainResult var response models.CloudBrainResult
err = json.Unmarshal(res.Body(), &response)
if err != nil {
log.Error("json.Unmarshal failed: %s", err.Error())
return &getImagesResult, fmt.Errorf("json.Unmarshal failed: %s", err.Error())
}

if response.Code == "S401" && retry < 1 {
json.Unmarshal(res.Body(), &response)
if response.Code == errInvalidToken && retry < 1 {
retry++ retry++
_ = loginCloudbrain() _ = loginCloudbrain()
goto sendjob goto sendjob
@@ -290,7 +284,9 @@ sendjob:
return fmt.Errorf("resty CommitImage: %v", err) return fmt.Errorf("resty CommitImage: %v", err)
} }


if result.Code == "S401" && retry < 1 {
var response models.CloudBrainResult
json.Unmarshal(res.Body(), &response)
if response.Code == errInvalidToken && retry < 1 {
retry++ retry++
_ = loginCloudbrain() _ = loginCloudbrain()
goto sendjob goto sendjob
@@ -442,7 +438,9 @@ sendjob:
return fmt.Errorf("resty StopJob: %v", err) return fmt.Errorf("resty StopJob: %v", err)
} }


if result.Code == "S401" && retry < 1 {
var response models.CloudBrainResult
json.Unmarshal(res.Body(), &response)
if response.Code == errInvalidToken && retry < 1 {
retry++ retry++
_ = loginCloudbrain() _ = loginCloudbrain()
goto sendjob goto sendjob
@@ -498,7 +496,7 @@ func GetJobAllLog(scrollID string) (*models.GetJobLogResult, error) {
client := getRestyClient() client := getRestyClient()
var result models.GetJobLogResult var result models.GetJobLogResult
req := models.GetAllJobLogParams{ req := models.GetAllJobLogParams{
Scroll: LogPageTokenExpired,
Scroll: LogPageTokenExpired,
ScrollID: scrollID, ScrollID: scrollID,
} }


@@ -522,7 +520,7 @@ func GetJobAllLog(scrollID string) (*models.GetJobLogResult, error) {
return &result, nil return &result, nil
} }


func DeleteJobLogToken(scrollID string) (error) {
func DeleteJobLogToken(scrollID string) error {
checkSetting() checkSetting()
client := getRestyClient() client := getRestyClient()
var result models.DeleteJobLogTokenResult var result models.DeleteJobLogTokenResult


+ 2
- 0
modules/setting/cloudbrain.go View File

@@ -5,6 +5,7 @@ type CloudbrainLoginConfig struct {
Password string Password string
Host string Host string
ImageURLPrefix string ImageURLPrefix string
Expiration string
} }


var ( var (
@@ -17,5 +18,6 @@ func GetCloudbrainConfig() CloudbrainLoginConfig {
Cloudbrain.Password = cloudbrainSec.Key("PASSWORD").MustString("") Cloudbrain.Password = cloudbrainSec.Key("PASSWORD").MustString("")
Cloudbrain.Host = cloudbrainSec.Key("REST_SERVER_HOST").MustString("") Cloudbrain.Host = cloudbrainSec.Key("REST_SERVER_HOST").MustString("")
Cloudbrain.ImageURLPrefix = cloudbrainSec.Key("IMAGE_URL_PREFIX").MustString("") Cloudbrain.ImageURLPrefix = cloudbrainSec.Key("IMAGE_URL_PREFIX").MustString("")
Cloudbrain.Expiration = cloudbrainSec.Key("EXPIRATION").MustString("604800")
return Cloudbrain return Cloudbrain
} }

+ 10
- 5
options/locale/locale_en-US.ini View File

@@ -253,13 +253,15 @@ page_dev_env_desc2_desc=Associate the model with the code version, you can adjus
page_dev_env_desc3_title=Once Configuration, Multiple Reuse page_dev_env_desc3_title=Once Configuration, Multiple Reuse
page_dev_env_desc3_desc=Provide execution environment sharing, Once Configuration, Multiple Reuse. Lower the threshold of model development, and avoid spending repetitive time configuring complex environments. page_dev_env_desc3_desc=Provide execution environment sharing, Once Configuration, Multiple Reuse. Lower the threshold of model development, and avoid spending repetitive time configuring complex environments.
page_dev_yunlao=OpenI AI Collaboration Platform page_dev_yunlao=OpenI AI Collaboration Platform
page_dev_yunlao_desc1=OpenI AI collaboration platform has cooperated with Pengcheng cloud brain and China computing power network (c ² Net) can be used to complete AI development tasks by using the rich computing resources of Pengcheng cloud brain and China computing network.
page_dev_yunlao_desc1=OpenI AI collaboration platform has cooperated with Pengcheng cloud brain and China computing power network (C²NET) can be used to complete AI development tasks by using the rich computing resources of Pengcheng cloud brain and China computing network.
page_dev_yunlao_desc2=Pengcheng CloudBrain's existing AI computing power is 100p FLOPS@FP16 (billions of half precision floating-point calculations per second), the main hardware infrastructure consists of GPU servers equipped with NVIDIA Tesla V100 and A100, and Atlas 900 AI clusters equipped with Kunpeng and shengteng processors. page_dev_yunlao_desc2=Pengcheng CloudBrain's existing AI computing power is 100p FLOPS@FP16 (billions of half precision floating-point calculations per second), the main hardware infrastructure consists of GPU servers equipped with NVIDIA Tesla V100 and A100, and Atlas 900 AI clusters equipped with Kunpeng and shengteng processors.
page_dev_yunlao_desc3=China computing power network (c ² Net) phase I can realize high-speed network interconnection between different artificial intelligence computing centers, and realize reasonable scheduling of computing power and flexible allocation of resources. At present, 11 intelligent computing centers have been connected, and the total scale of computing power is 1924p OPS@FP16 。 Qizhi AI collaboration platform has been connected to Pengcheng Cloud Computing Institute, Chengdu Intelligent Computing Center, Zhongyuan Intelligent Computing Center, Hefei brain and other nodes.
page_dev_yunlao_desc3=China computing power network (C²NET) phase I can realize high-speed network interconnection between different artificial intelligence computing centers, and realize reasonable scheduling of computing power and flexible allocation of resources. At present, 11 intelligent computing centers have been connected, and the total scale of computing power is 1924p OPS@FP16. OpenI AI collaboration platform has been connected to Pengcheng Cloud Computing Institute, Chengdu Intelligent Computing Center, Zhongyuan Intelligent Computing Center, Hefei brain and other nodes.
page_dev_yunlao_desc4=Developers can freely select the corresponding computing resources according to the use needs, and can test the adaptability, performance, stability, etc. of the model in different hardware environments. page_dev_yunlao_desc4=Developers can freely select the corresponding computing resources according to the use needs, and can test the adaptability, performance, stability, etc. of the model in different hardware environments.
page_dev_yunlao_desc5=If your model requires more computing resources, you can also apply for it separately. page_dev_yunlao_desc5=If your model requires more computing resources, you can also apply for it separately.
page_dev_yunlao_apply=Apply Separately page_dev_yunlao_apply=Apply Separately

c2net_title=China Computing Network
c2net_desc=The artificial intelligence computing power network promotion alliance has access to 11 intelligent computing centers, with a total scale of 1924p.
c2net_center=Center
search=Search search=Search
search_repo=Repository search_repo=Repository
search_dataset=DataSet search_dataset=DataSet
@@ -822,6 +824,8 @@ title_format_err=Name can only contain number,letter,'-','_' or '.', and can be
description = Description description = Description
description_format_err=Description's length can be up to %s characters long. description_format_err=Description's length can be up to %s characters long.
create_dataset = Create Dataset create_dataset = Create Dataset
download_url=Download Url
download_oper=Operation
create_dataset_fail=Failed to create dataset. create_dataset_fail=Failed to create dataset.
query_dataset_fail=Failed to query dataset. query_dataset_fail=Failed to query dataset.
edit_attachment_fail=Failed to update description. edit_attachment_fail=Failed to update description.
@@ -3094,7 +3098,7 @@ resource_cluster = Resource Cluster
resource_cluster_openi = OpenI Resource Cluster resource_cluster_openi = OpenI Resource Cluster
resource_cluster_c2net = China Computing NET resource_cluster_c2net = China Computing NET
resource_cluster_openi_simple = OpenI resource_cluster_openi_simple = OpenI
resource_cluster_c2net_simple = Computing NET
resource_cluster_c2net_simple = C²NET
compute_resource = Computing resources compute_resource = Computing resources
task_name = Task name task_name = Task name
task_type = Task type task_type = Task type
@@ -3119,7 +3123,8 @@ wrong_specification=You cannot use this specification, please choose another ite




job_name_rule = Please enter letters, numbers, _ and - up to 64 characters and cannot end with a dash (-). job_name_rule = Please enter letters, numbers, _ and - up to 64 characters and cannot end with a dash (-).
dataset_path_rule = The dataset location is stored in the environment variable <strong style="color:#010101">data_url</strong>, and the output path is stored in the environment variable <strong style="color:#010101">train_url</strong>.
train_dataset_path_rule = The dataset location is stored in the environment variable <strong style="color:#010101">data_url</strong>, and the output path is stored in the environment variable <strong style="color:#010101">train_url</strong>.
infer_dataset_path_rule = The dataset location is stored in the environment variable <strong style="color:#010101">data_url</strong>, and the output path is stored in the environment variable <strong style="color:#010101">train_url</strong>.
view_sample = View sample view_sample = View sample
inference_output_path_rule = The inference output path is stored in the environment variable result_url. inference_output_path_rule = The inference output path is stored in the environment variable result_url.
model_file_path_rule=The model file location is stored in the environment variable ckpt_url model_file_path_rule=The model file location is stored in the environment variable ckpt_url


+ 7
- 3
options/locale/locale_zh-CN.ini View File

@@ -261,7 +261,9 @@ page_dev_yunlao_desc3=中国算力网(C²NET)一期可实现不同人工智
page_dev_yunlao_desc4=开发者可以根据使用需求,自由选择相应计算资源,可以测试模型在不同硬件环境下的适配能力、性能、稳定性等。 page_dev_yunlao_desc4=开发者可以根据使用需求,自由选择相应计算资源,可以测试模型在不同硬件环境下的适配能力、性能、稳定性等。
page_dev_yunlao_desc5=如果您的模型需要更多的计算资源,也可以单独申请。 page_dev_yunlao_desc5=如果您的模型需要更多的计算资源,也可以单独申请。
page_dev_yunlao_apply=单独申请 page_dev_yunlao_apply=单独申请

c2net_title=智算网络
c2net_desc=人工智能算力网络推进联盟已接入11家智算中心,算力总规模1924P
c2net_center=中心
search=搜索 search=搜索
search_repo=项目 search_repo=项目
search_dataset=数据集 search_dataset=数据集
@@ -830,7 +832,8 @@ create_dataset=创建数据集
create_dataset_fail=创建数据集失败。 create_dataset_fail=创建数据集失败。
query_dataset_fail=查询数据集失败。 query_dataset_fail=查询数据集失败。
edit_attachment_fail=修改描述失败。 edit_attachment_fail=修改描述失败。

download_url=数据集下载地址
download_oper=操作
show_dataset=数据集 show_dataset=数据集
edit_dataset=编辑数据集 edit_dataset=编辑数据集
update_dataset=更新数据集 update_dataset=更新数据集
@@ -3134,7 +3137,8 @@ card_type = 卡类型
wrong_specification=您目前不能使用这个资源规格,请选择其他资源规格。 wrong_specification=您目前不能使用这个资源规格,请选择其他资源规格。


job_name_rule = 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。 job_name_rule = 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。
dataset_path_rule = 数据集位置存储在环境变量<strong style="color:#010101">data_url</strong>中,输出路径存储在环境变量<strong style="color:#010101">train_url</strong>中。
train_dataset_path_rule = 数据集位置存储在环境变量<strong style="color:#010101">data_url</strong>中,训练输出路径存储在环境变量<strong style="color:#010101">train_url</strong>中。
infer_dataset_path_rule = 数据集位置存储在环境变量<strong style="color:#010101">data_url</strong>中,推理输出路径存储在环境变量<strong style="color:#010101">train_url</strong>中。
view_sample = 查看样例 view_sample = 查看样例
inference_output_path_rule = 推理输出路径存储在环境变量result_url中。 inference_output_path_rule = 推理输出路径存储在环境变量result_url中。
model_file_path_rule = 模型文件位置存储在环境变量ckpt_url中。 model_file_path_rule = 模型文件位置存储在环境变量ckpt_url中。


+ 2
- 1
routers/api/v1/repo/cloudbrain.go View File

@@ -378,6 +378,7 @@ func CloudbrainDownloadLogFile(ctx *context.Context) {
ctx.ServerError(err.Error(), err) ctx.ServerError(err.Error(), err)
return return
} }

prefix := "/" + setting.CBCodePathPrefix + job.JobName + "/model" prefix := "/" + setting.CBCodePathPrefix + job.JobName + "/model"
files, err := storage.GetOneLevelAllObjectUnderDirMinio(setting.Attachment.Minio.Bucket, prefix, "") files, err := storage.GetOneLevelAllObjectUnderDirMinio(setting.Attachment.Minio.Bucket, prefix, "")
if err != nil { if err != nil {
@@ -398,7 +399,7 @@ func CloudbrainDownloadLogFile(ctx *context.Context) {
ctx.ServerError("Get minio get SignedUrl failed", err) ctx.ServerError("Get minio get SignedUrl failed", err)
return return
} }
http.Redirect(ctx.Resp, ctx.Req.Request, url, http.StatusMovedPermanently)
http.Redirect(ctx.Resp, ctx.Req.Request, url, http.StatusTemporaryRedirect)
} }
} }




+ 10
- 1
routers/api/v1/repo/modelarts.go View File

@@ -6,13 +6,14 @@
package repo package repo


import ( import (
"code.gitea.io/gitea/modules/notification"
"encoding/json" "encoding/json"
"net/http" "net/http"
"path" "path"
"strconv" "strconv"
"strings" "strings"


"code.gitea.io/gitea/modules/notification"

"code.gitea.io/gitea/modules/grampus" "code.gitea.io/gitea/modules/grampus"
"code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/setting"


@@ -352,6 +353,14 @@ func DelTrainJobVersion(ctx *context.APIContext) {
return return
} }


if task.Status != string(models.ModelArtsTrainJobImageFailed) && task.Status != string(models.ModelArtsTrainJobSubmitFailed) && task.Status != string(models.ModelArtsTrainJobDeleteFailed) &&
task.Status != string(models.ModelArtsTrainJobCompleted) && task.Status != string(models.ModelArtsTrainJobFailed) &&
task.Status != string(models.ModelArtsTrainJobKilled) && task.Status != string(models.ModelArtsTrainJobCanceled) && task.Status != string(models.ModelArtsTrainJobLost) {
log.Error("the job(%s) version has not been stopped", task.JobName)
ctx.NotFound(err)
return
}

//删除modelarts上的记录 //删除modelarts上的记录
_, err = modelarts.DelTrainJobVersion(jobID, strconv.FormatInt(task.VersionID, 10)) _, err = modelarts.DelTrainJobVersion(jobID, strconv.FormatInt(task.VersionID, 10))
if err != nil { if err != nil {


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

@@ -502,9 +502,11 @@ func NotebookRestart(ctx *context.Context) {
break break
} }


id = strconv.FormatInt(newTask.ID, 10)

status = res.Status status = res.Status
resultCode = "0" resultCode = "0"
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, strconv.FormatInt(newTask.ID, 10), newTask.DisplayJobName, models.ActionCreateDebugNPUTask)
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, id, newTask.DisplayJobName, models.ActionCreateDebugNPUTask)


break break
} }
@@ -1843,6 +1845,16 @@ func TrainJobDel(ctx *context.Context) {
return return
} }


for _, task := range VersionListTasks {
if task.Status != string(models.ModelArtsTrainJobImageFailed) && task.Status != string(models.ModelArtsTrainJobSubmitFailed) && task.Status != string(models.ModelArtsTrainJobDeleteFailed) &&
task.Status != string(models.ModelArtsTrainJobCompleted) && task.Status != string(models.ModelArtsTrainJobFailed) &&
task.Status != string(models.ModelArtsTrainJobKilled) && task.Status != string(models.ModelArtsTrainJobCanceled) && task.Status != string(models.ModelArtsTrainJobLost) {
log.Error("the job(%s) version has not been stopped", task.JobName)
ctx.RenderWithErr("the job version has not been stopped", tplModelArtsTrainJobIndex, nil)
return
}
}

//删除modelarts上的任务记录 //删除modelarts上的任务记录
_, err = modelarts.DelTrainJob(jobID) _, err = modelarts.DelTrainJob(jobID)
if err != nil { if err != nil {


+ 10
- 0
routers/repo/setting.go View File

@@ -464,6 +464,16 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
} }
return return
} }
dataset, err := models.GetDatasetByRepo(repo)
if err == nil {
if dataset != nil {
models.UpdateDatasetCreateUser(dataset.ID, newOwner)
} else {
log.Info("not found the dataset")
}
} else {
log.Info("error=" + err.Error())
}


log.Trace("Repository transferred: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newOwner) log.Trace("Repository transferred: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newOwner)
ctx.Flash.Success(ctx.Tr("repo.settings.transfer_succeed")) ctx.Flash.Success(ctx.Tr("repo.settings.transfer_succeed"))


+ 2
- 2
templates/custom/wait_count.tmpl View File

@@ -13,9 +13,9 @@
{{ end }} {{ end }}
<i <i
class="ri-error-warning-line" class="ri-error-warning-line"
style="margin-right: 0.5rem; font-size: 16px"
style="margin-right: 0.5rem; font-size: 14px"
></i> ></i>
<span id="gpu-nums"
<span id="gpu-nums" style="font-size: 12px"
>{{.i18n.Tr "repo.wait_count_start"}} >{{.i18n.Tr "repo.wait_count_start"}}
{{if .QueuesDetail}} {{if .QueuesDetail}}
{{ $gpuQueue }} {{ $gpuQueue }}


+ 2
- 2
templates/custom/wait_count_train.tmpl View File

@@ -14,9 +14,9 @@
{{ end }} {{ end }}
<i <i
class="ri-error-warning-line" class="ri-error-warning-line"
style="margin-right: 0.5rem; font-size: 16px"
style="margin-right: 0.5rem; font-size: 14px"
></i> ></i>
<span id="gpu-nums"
<span id="gpu-nums" style="font-size: 12px"
>{{.ctx.i18n.Tr "repo.wait_count_start"}} >{{.ctx.i18n.Tr "repo.wait_count_start"}}
{{if .type}} {{if .type}}
{{ $gpuQueue }} {{ $gpuQueue }}


+ 3
- 3
templates/home.tmpl View File

@@ -89,8 +89,8 @@
<div class="ui vertical masthead secondary c2net segment"> <div class="ui vertical masthead secondary c2net segment">
<div class="ui container"> <div class="ui container">
<div class="ui center am-pt-30 am-pb-30"> <div class="ui center am-pt-30 am-pb-30">
<h2>智算网络</h2>
<p><span class="ui text grey">人工智能算力网络推进联盟已接入11家智算中心,算力总规模1924P</p>
<h2>{{.i18n.Tr "home.c2net_title"}}</h2>
<p><span class="ui text grey">{{.i18n.Tr "home.c2net_desc"}}</p>
</div> </div>


<div id="app" v-cloak> <div id="app" v-cloak>
@@ -98,7 +98,7 @@
<div class="rotation3D-baseMap"></div> <div class="rotation3D-baseMap"></div>
<!--旋转3D--> <!--旋转3D-->
<div id="rotation3D" class="rotation3D"> <div id="rotation3D" class="rotation3D">
<button class="center">中心</button>
<button class="center">{{.i18n.Tr "home.c2net_center"}}</button>
<div class="itemList"> <div class="itemList">
<div class="rotation3D__item" :class="item.type" v-for="item in itemList"> <div class="rotation3D__item" :class="item.type" v-for="item in itemList">


+ 1
- 1
templates/repo/cloudbrain/inference/show.tmpl View File

@@ -495,7 +495,7 @@
<div style="clear:both"> <div style="clear:both">
<table style="border:none" class="ui fixed small stackable table"> <table style="border:none" class="ui fixed small stackable table">
<thead> <thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">数据集文件</th>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">{{$.i18n.Tr "dataset.file"}}</th>
</tr></thead> </tr></thead>
<tbody> <tbody>
{{range $m ,$n := $.datasetDownload}} {{range $m ,$n := $.datasetDownload}}


+ 1
- 1
templates/repo/cloudbrain/show.tmpl View File

@@ -493,7 +493,7 @@
<div style="clear:both"> <div style="clear:both">
<table style="border:none" class="ui fixed small stackable table"> <table style="border:none" class="ui fixed small stackable table">
<thead> <thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">数据集文件</th>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">{{$.i18n.Tr "dataset.file"}}</th>
</tr></thead> </tr></thead>
<tbody> <tbody>
{{range $m ,$n := $.datasetDownload}} {{range $m ,$n := $.datasetDownload}}


+ 2
- 2
templates/repo/cloudbrain/trainjob/show.tmpl View File

@@ -459,7 +459,7 @@
<div style="clear:both"> <div style="clear:both">
<table style="border:none" class="ui fixed small stackable table"> <table style="border:none" class="ui fixed small stackable table">
<thead> <thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">数据集文件</th>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">{{$.i18n.Tr "dataset.file"}}</th>
</tr></thead> </tr></thead>
<tbody> <tbody>
{{range $m ,$n := $.datasetDownload}} {{range $m ,$n := $.datasetDownload}}
@@ -499,7 +499,7 @@
<div> <div>
<a id="{{.VersionName}}-log-down" <a id="{{.VersionName}}-log-down"
class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}}' class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}}'
href="/api/v1/repos/{{$.RepoRelPath}}/cloudbrain/train-job/{{.JobID}}/download_log_file">
href="/api/v1/repos/{{$.RepoRelPath}}/cloudbrain/{{.ID}}/download_log_file">
<i class="ri-download-cloud-2-line"></i> <i class="ri-download-cloud-2-line"></i>
<span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span> <span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span>
</a> </a>


+ 1
- 1
templates/repo/modelarts/inferencejob/new.tmpl View File

@@ -86,7 +86,7 @@
{{template "custom/wait_count_train" Dict "ctx" $}} {{template "custom/wait_count_train" Dict "ctx" $}}
<div style="display: flex;align-items: center;margin-left: 155px;margin-top: 0.5rem;"> <div style="display: flex;align-items: center;margin-left: 155px;margin-top: 0.5rem;">
<i class="ri-error-warning-line" style="color: #f2711c;margin-right: 0.5rem;"></i> <i class="ri-error-warning-line" style="color: #f2711c;margin-right: 0.5rem;"></i>
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.dataset_path_rule" | Safe}}</span>
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.infer_dataset_path_rule" | Safe}}</span>
</div> </div>
</div> </div>
<div class="required min_title inline field"> <div class="required min_title inline field">


+ 1
- 1
templates/repo/modelarts/inferencejob/show.tmpl View File

@@ -436,7 +436,7 @@ td, th {
<div style="clear:both"> <div style="clear:both">
<table style="border:none" class="ui fixed small stackable table"> <table style="border:none" class="ui fixed small stackable table">
<thead> <thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">数据集文件</th>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">{{$.i18n.Tr "dataset.file"}}</th>
</tr></thead> </tr></thead>
<tbody> <tbody>
{{range $m ,$n := $.datasetDownload}} {{range $m ,$n := $.datasetDownload}}


+ 4
- 4
templates/repo/modelarts/notebook/show.tmpl View File

@@ -432,16 +432,16 @@
<div style="clear:both"> <div style="clear:both">
<table style="border:none" class="ui fixed small stackable table"> <table style="border:none" class="ui fixed small stackable table">
<thead> <thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide center aligned">数据集文件</th>
<th style="color: #8a8e99;font-size:12px"class="eleven wide">数据集下载地址</th>
<th style="color: #8a8e99;font-size:12px" class="two wide center aligned">操作</th>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide center aligned">{{$.i18n.Tr "dataset.file"}}</th>
<th style="color: #8a8e99;font-size:12px"class="eleven wide">{{$.i18n.Tr "dataset.download_url"}}</th>
<th style="color: #8a8e99;font-size:12px" class="two wide center aligned">{{$.i18n.Tr "dataset.download_oper"}}</th>
</tr></thead> </tr></thead>
<tbody> <tbody>
{{range $.datasetDownload}} {{range $.datasetDownload}}
<tr> <tr>
<td style="word-wrap: break-word;word-break: break-all;"><a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a></td> <td style="word-wrap: break-word;word-break: break-all;"><a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a></td>
<td style="word-wrap: break-word;word-break: break-all;">{{.DatasetDownloadLink}}</td> <td style="word-wrap: break-word;word-break: break-all;">{{.DatasetDownloadLink}}</td>
<td class="center aligned"><a class="ui poping up clipboard" id="clipboard-btn" data-original="{{$.i18n.Tr "repo.copy_link"}}" data-success="{{$.i18n.Tr "repo.copy_link_success"}}" data-error="{{$.i18n.Tr "repo.copy_link_error"}}" data-content="{{$.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-text="{{.DatasetDownloadLink}}">复制链接</a></td>
<td class="center aligned"><a class="ui poping up clipboard" id="clipboard-btn1" data-original="{{$.i18n.Tr "repo.copy_link"}}" data-success="{{$.i18n.Tr "repo.copy_link_success"}}" data-error="{{$.i18n.Tr "repo.copy_link_error"}}" data-content="{{$.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-text="{{.DatasetDownloadLink}}">复制链接</a></td>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>


+ 1
- 1
templates/repo/modelarts/trainjob/new.tmpl View File

@@ -113,7 +113,7 @@
{{template "custom/wait_count_train" Dict "ctx" $}} {{template "custom/wait_count_train" Dict "ctx" $}}
<div style="display: flex;align-items: center;margin-left: 155px;margin-top: 0.5rem;"> <div style="display: flex;align-items: center;margin-left: 155px;margin-top: 0.5rem;">
<i class="ri-error-warning-line" style="color: #f2711c;margin-right: 0.5rem;"></i> <i class="ri-error-warning-line" style="color: #f2711c;margin-right: 0.5rem;"></i>
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.dataset_path_rule" | Safe}}</span>
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.train_dataset_path_rule" | Safe}}</span>
</div> </div>
</div> </div>
<div class="required inline min_title field"> <div class="required inline min_title field">


+ 8
- 32
templates/repo/modelarts/trainjob/show.tmpl View File

@@ -274,10 +274,14 @@




{{if .CanDel}} {{if .CanDel}}
<a class="ti-action-menu-item" onclick="deleteVersion({{.VersionName}})"
<a class='ti-action-menu-item delete-show-version {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING" "RUNNING" "KILLING" "INIT"}}disabled {{end}}'
id="{{.VersionName}}-delete"
data-jobid="{{.JobID}}"
data-repopath="{{$.RepoRelPath}}/modelarts/train-job"
data-version = "{{.VersionName}}"
style="color: #FF4D4F;">{{$.i18n.Tr "repo.delete"}}</a> style="color: #FF4D4F;">{{$.i18n.Tr "repo.delete"}}</a>
{{else}} {{else}}
<a class="ti-action-menu-item disabled" onclick="deleteVersion({{.VersionName}})"
<a class="ti-action-menu-item disabled"
style="color: #FF4D4F;">{{$.i18n.Tr "repo.delete"}}</a> style="color: #FF4D4F;">{{$.i18n.Tr "repo.delete"}}</a>
{{end}} {{end}}
</div> </div>
@@ -478,7 +482,7 @@
<div style="clear:both"> <div style="clear:both">
<table style="border:none" class="ui fixed small stackable table"> <table style="border:none" class="ui fixed small stackable table">
<thead> <thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">数据集文件</th>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">{{$.i18n.Tr "dataset.file"}}</th>
</tr></thead> </tr></thead>
<tbody> <tbody>
{{range $m ,$n := $.datasetList}} {{range $m ,$n := $.datasetList}}
@@ -899,35 +903,7 @@
$('#name').val(modelName) $('#name').val(modelName)
$('#version').val("0.0.1") $('#version').val("0.0.1")
} }
function deleteVersion(version_name) {
stopBubbling(arguments.callee.caller.arguments[0])
let flag = 1;
$('.ui.basic.modal').modal({
onDeny: function () {
flag = false
},
onApprove: function () {
$.post(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/del_version`, { version_name: version_name }, (data) => {
if (data.VersionListCount === 0) {
location.href = `/${userName}/${repoPath}/modelarts/train-job`
} else {
$('#accordion' + version_name).remove()
}

}).fail(function (err) {
console.log(err);
});
flag = true
},
onHidden: function () {
if (flag == false) {
$('.alert').html('您已取消操作').removeClass('alert-success').addClass('alert-danger').show().delay(1500).fadeOut();
}
}
})
.modal('show')

}






+ 6
- 17
templates/repo/modelarts/trainjob/version_new.tmpl View File

@@ -73,6 +73,11 @@
<input type="hidden" id="ai_engine_name" name="engine_names" value=""> <input type="hidden" id="ai_engine_name" name="engine_names" value="">
<input type="hidden" id="ai_flaver_name" name="flaver_names" value=""> <input type="hidden" id="ai_flaver_name" name="flaver_names" value="">
<input type="hidden" id="display_job_name" name="display_job_name" value="{{.display_job_name}}"> <input type="hidden" id="display_job_name" name="display_job_name" value="{{.display_job_name}}">
{{template "custom/wait_count_train" Dict "ctx" $}}
<div style="display: flex;align-items: center;margin-left: 155px;margin-top: 0.5rem;">
<i class="ri-error-warning-line" style="color: #f2711c;margin-right: 0.5rem;"></i>
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.train_dataset_path_rule" | Safe}}</span>
</div>
<h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4> <h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4>
<div class="required unite min_title inline field"> <div class="required unite min_title inline field">
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
@@ -152,26 +157,10 @@
</span> </span>
<a href="https://git.openi.org.cn/OpenIOSSG/MINIST_Example" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a> <a href="https://git.openi.org.cn/OpenIOSSG/MINIST_Example" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
</div> </div>
<!-- <div class="required unite min_title inline field">
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.dataset"}}</label>
<select class="ui dropdown width80" id="trainjob_datasets" name="attachment" placeholder="{{.i18n.Tr "cloudbrain.select_dataset"}}">
{{if .dataset_name}}
<option name="attachment" value="{{.uuid}}">{{.dataset_name}}</option>
{{end}}
{{range .attachments}}
<option value="">{{$.i18n.Tr "cloudbrain.select_dataset"}}</option>
{{if ne $.uuid .UUID}}
<option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option>
{{end}}
{{end}}
</select>
<span class="tooltips">{{.i18n.Tr "cloudbrain.dataset_path_rule"}}</span>
</div> -->
<div id="select-multi-dataset"> <div id="select-multi-dataset">


</div> </div>
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 1rem;">{{.i18n.Tr "cloudbrain.dataset_path_rule"}}</span>
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 1rem;"></span>
<div class="inline unite min_title field"> <div class="inline unite min_title field">
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label> <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label>
<span id="add_run_para" style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span> <span id="add_run_para" style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span>


+ 30
- 1
web_src/js/features/cloudbrainShow.js View File

@@ -213,6 +213,35 @@ export default async function initCloudrainSow() {
}); });
e.stopPropagation(); e.stopPropagation();
}); });
$(".delete-show-version").click(function (e) {
const ID = this.dataset.jobid;
const repoPath = this.dataset.repopath;
const version_name = this.dataset.version;
const url = `/api/v1/repos/${repoPath}/${ID}/del_version`;
$(".ui.basic.modal")
.modal({
onApprove: function () {
$.post(url, { version_name: version_name }, (data) => {
console.log(data);
if (data.StatusOK === 0) {
if (data.VersionListCount === 0) {
location.href = `/${repoPath}`;
} else {
$("#accordion" + version_name).remove();
}
refreshStatusShow(version_name, ID, repoPath);
} else {
return;
}
}).fail(function (err) {
console.log(err);
});
},
})
.modal("show");

e.stopPropagation();
});
function refreshStatusShow(version_name, ID, repoPath) { function refreshStatusShow(version_name, ID, repoPath) {
$.get( $.get(
`/api/v1/repos/${repoPath}/${ID}?version_name=${version_name}`, `/api/v1/repos/${repoPath}/${ID}?version_name=${version_name}`,
@@ -390,7 +419,7 @@ export default async function initCloudrainSow() {
html += "</a>"; html += "</a>";
html += "</span>"; html += "</span>";
html += "</td>"; html += "</td>";
html += "<td class='message seven wide'>";
html += "<td class='message1 seven wide'>";
if (data.Dirs[i].IsDir) { if (data.Dirs[i].IsDir) {
html += "<span class='truncate has-emoji'></span>"; html += "<span class='truncate has-emoji'></span>";
} else { } else {


+ 13
- 0
web_src/js/features/cloudrbanin.js View File

@@ -182,6 +182,15 @@ export default async function initCloudrain() {
"CREATE_FAILED", "CREATE_FAILED",
"STOPPED", "STOPPED",
]; ];
let deleteArray = [
"KILLED",
"FAILED",
"START_FAILED",
"COMPLETED",
"SUCCEEDED",
"CREATE_FAILED",
"STOPPED",
];
$.get( $.get(
`/api/v1/repos/${repoPath}/${jobID}?version_name=${versionname}`, `/api/v1/repos/${repoPath}/${jobID}?version_name=${versionname}`,
(data) => { (data) => {
@@ -194,6 +203,10 @@ export default async function initCloudrain() {
if (stopArray.includes(data.JobStatus)) { if (stopArray.includes(data.JobStatus)) {
$("#" + versionname + "-stop").addClass("disabled"); $("#" + versionname + "-stop").addClass("disabled");
} }
if (deleteArray.includes(data.JobStatus)) {
$(`#${versionname}-delete`).removeClass("disabled");
$(`#${versionname}-delete`).addClass("blue");
}
if (data.JobStatus === "COMPLETED") { if (data.JobStatus === "COMPLETED") {
$("#" + versionname + "-create-model") $("#" + versionname + "-create-model")
.removeClass("disabled") .removeClass("disabled")


+ 1
- 1
web_src/js/index.js View File

@@ -3520,7 +3520,7 @@ function initVueComponents() {
`${self.reposFilter}:${self.archivedFilter}:${self.privateFilter}`, `${self.reposFilter}:${self.archivedFilter}:${self.privateFilter}`,
count count
); );
self.finalPage = Math.floor(count / self.searchLimit) + 1;
self.finalPage = Math.ceil(count / self.searchLimit);
self.updateHistory(); self.updateHistory();
} }
}).always(() => { }).always(() => {


Loading…
Cancel
Save