| @@ -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 v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w= | |||
| 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/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-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/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/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= | |||
| github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= | |||
| @@ -88,7 +88,7 @@ func (datasets DatasetList) loadAttributes(e Engine) error { | |||
| if err := e. | |||
| Where("id > 0"). | |||
| 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 { | |||
| return fmt.Errorf("find repos: %v", err) | |||
| } | |||
| @@ -121,12 +121,12 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions) | |||
| if attachment.DatasetID == datasets[i].ID { | |||
| if opts.StarByMe { | |||
| permission,ok := permissionMap[datasets[i].ID]; | |||
| permission, ok := permissionMap[datasets[i].ID] | |||
| if !ok { | |||
| permission = false | |||
| 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) { | |||
| log.Info("user is member of org.") | |||
| 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) | |||
| } else if !attachment.IsPrivate { | |||
| datasets[i].Attachments = append(datasets[i].Attachments, attachment) | |||
| @@ -159,8 +159,8 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions) | |||
| } | |||
| 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 | |||
| } | |||
| @@ -585,3 +585,13 @@ func GetTeamDatasetIdsByUserID(userID int64) []int64 { | |||
| Cols("dataset.id").Find(&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 | |||
| } | |||
| @@ -24,10 +24,11 @@ var ( | |||
| ) | |||
| const ( | |||
| JobHasBeenStopped = "S410" | |||
| Public = "public" | |||
| Custom = "custom" | |||
| LogPageSize = 500 | |||
| JobHasBeenStopped = "S410" | |||
| errInvalidToken = "S401" | |||
| Public = "public" | |||
| Custom = "custom" | |||
| LogPageSize = 500 | |||
| LogPageTokenExpired = "5m" | |||
| pageSize = 15 | |||
| QueuesDetailUrl = "/rest-server/api/v2/queuesdetail" | |||
| @@ -59,7 +60,7 @@ func loginCloudbrain() error { | |||
| res, err := client.R(). | |||
| 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). | |||
| Post(HOST + "/rest-server/api/v1/token") | |||
| if err != nil { | |||
| @@ -122,16 +123,12 @@ sendjob: | |||
| Post(HOST + "/rest-server/api/v1/jobs/") | |||
| 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) | |||
| } | |||
| if jobResult.Code == "S401" && retry < 1 { | |||
| var response models.CloudBrainResult | |||
| json.Unmarshal(res.Body(), &response) | |||
| if response.Code == errInvalidToken && retry < 1 { | |||
| retry++ | |||
| _ = loginCloudbrain() | |||
| goto sendjob | |||
| @@ -163,7 +160,9 @@ sendjob: | |||
| 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++ | |||
| _ = loginCloudbrain() | |||
| goto sendjob | |||
| @@ -196,13 +195,8 @@ sendjob: | |||
| } | |||
| 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++ | |||
| _ = loginCloudbrain() | |||
| goto sendjob | |||
| @@ -290,7 +284,9 @@ sendjob: | |||
| 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++ | |||
| _ = loginCloudbrain() | |||
| goto sendjob | |||
| @@ -442,7 +438,9 @@ sendjob: | |||
| 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++ | |||
| _ = loginCloudbrain() | |||
| goto sendjob | |||
| @@ -498,7 +496,7 @@ func GetJobAllLog(scrollID string) (*models.GetJobLogResult, error) { | |||
| client := getRestyClient() | |||
| var result models.GetJobLogResult | |||
| req := models.GetAllJobLogParams{ | |||
| Scroll: LogPageTokenExpired, | |||
| Scroll: LogPageTokenExpired, | |||
| ScrollID: scrollID, | |||
| } | |||
| @@ -522,7 +520,7 @@ func GetJobAllLog(scrollID string) (*models.GetJobLogResult, error) { | |||
| return &result, nil | |||
| } | |||
| func DeleteJobLogToken(scrollID string) (error) { | |||
| func DeleteJobLogToken(scrollID string) error { | |||
| checkSetting() | |||
| client := getRestyClient() | |||
| var result models.DeleteJobLogTokenResult | |||
| @@ -5,6 +5,7 @@ type CloudbrainLoginConfig struct { | |||
| Password string | |||
| Host string | |||
| ImageURLPrefix string | |||
| Expiration string | |||
| } | |||
| var ( | |||
| @@ -17,5 +18,6 @@ func GetCloudbrainConfig() CloudbrainLoginConfig { | |||
| Cloudbrain.Password = cloudbrainSec.Key("PASSWORD").MustString("") | |||
| Cloudbrain.Host = cloudbrainSec.Key("REST_SERVER_HOST").MustString("") | |||
| Cloudbrain.ImageURLPrefix = cloudbrainSec.Key("IMAGE_URL_PREFIX").MustString("") | |||
| Cloudbrain.Expiration = cloudbrainSec.Key("EXPIRATION").MustString("604800") | |||
| return Cloudbrain | |||
| } | |||
| @@ -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_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_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_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_desc5=If your model requires more computing resources, you can also apply for it 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_repo=Repository | |||
| search_dataset=DataSet | |||
| @@ -822,6 +824,8 @@ title_format_err=Name can only contain number,letter,'-','_' or '.', and can be | |||
| description = Description | |||
| description_format_err=Description's length can be up to %s characters long. | |||
| create_dataset = Create Dataset | |||
| download_url=Download Url | |||
| download_oper=Operation | |||
| create_dataset_fail=Failed to create dataset. | |||
| query_dataset_fail=Failed to query dataset. | |||
| edit_attachment_fail=Failed to update description. | |||
| @@ -3094,7 +3098,7 @@ resource_cluster = Resource Cluster | |||
| resource_cluster_openi = OpenI Resource Cluster | |||
| resource_cluster_c2net = China Computing NET | |||
| resource_cluster_openi_simple = OpenI | |||
| resource_cluster_c2net_simple = Computing NET | |||
| resource_cluster_c2net_simple = C²NET | |||
| compute_resource = Computing resources | |||
| task_name = Task name | |||
| 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 (-). | |||
| 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 | |||
| 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 | |||
| @@ -261,7 +261,9 @@ page_dev_yunlao_desc3=中国算力网(C²NET)一期可实现不同人工智 | |||
| page_dev_yunlao_desc4=开发者可以根据使用需求,自由选择相应计算资源,可以测试模型在不同硬件环境下的适配能力、性能、稳定性等。 | |||
| page_dev_yunlao_desc5=如果您的模型需要更多的计算资源,也可以单独申请。 | |||
| page_dev_yunlao_apply=单独申请 | |||
| c2net_title=智算网络 | |||
| c2net_desc=人工智能算力网络推进联盟已接入11家智算中心,算力总规模1924P | |||
| c2net_center=中心 | |||
| search=搜索 | |||
| search_repo=项目 | |||
| search_dataset=数据集 | |||
| @@ -830,7 +832,8 @@ create_dataset=创建数据集 | |||
| create_dataset_fail=创建数据集失败。 | |||
| query_dataset_fail=查询数据集失败。 | |||
| edit_attachment_fail=修改描述失败。 | |||
| download_url=数据集下载地址 | |||
| download_oper=操作 | |||
| show_dataset=数据集 | |||
| edit_dataset=编辑数据集 | |||
| update_dataset=更新数据集 | |||
| @@ -3134,7 +3137,8 @@ card_type = 卡类型 | |||
| wrong_specification=您目前不能使用这个资源规格,请选择其他资源规格。 | |||
| 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 = 查看样例 | |||
| inference_output_path_rule = 推理输出路径存储在环境变量result_url中。 | |||
| model_file_path_rule = 模型文件位置存储在环境变量ckpt_url中。 | |||
| @@ -378,6 +378,7 @@ func CloudbrainDownloadLogFile(ctx *context.Context) { | |||
| ctx.ServerError(err.Error(), err) | |||
| return | |||
| } | |||
| prefix := "/" + setting.CBCodePathPrefix + job.JobName + "/model" | |||
| files, err := storage.GetOneLevelAllObjectUnderDirMinio(setting.Attachment.Minio.Bucket, prefix, "") | |||
| if err != nil { | |||
| @@ -398,7 +399,7 @@ func CloudbrainDownloadLogFile(ctx *context.Context) { | |||
| ctx.ServerError("Get minio get SignedUrl failed", err) | |||
| return | |||
| } | |||
| http.Redirect(ctx.Resp, ctx.Req.Request, url, http.StatusMovedPermanently) | |||
| http.Redirect(ctx.Resp, ctx.Req.Request, url, http.StatusTemporaryRedirect) | |||
| } | |||
| } | |||
| @@ -6,13 +6,14 @@ | |||
| package repo | |||
| import ( | |||
| "code.gitea.io/gitea/modules/notification" | |||
| "encoding/json" | |||
| "net/http" | |||
| "path" | |||
| "strconv" | |||
| "strings" | |||
| "code.gitea.io/gitea/modules/notification" | |||
| "code.gitea.io/gitea/modules/grampus" | |||
| "code.gitea.io/gitea/modules/setting" | |||
| @@ -352,6 +353,14 @@ func DelTrainJobVersion(ctx *context.APIContext) { | |||
| 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上的记录 | |||
| _, err = modelarts.DelTrainJobVersion(jobID, strconv.FormatInt(task.VersionID, 10)) | |||
| if err != nil { | |||
| @@ -502,9 +502,11 @@ func NotebookRestart(ctx *context.Context) { | |||
| break | |||
| } | |||
| id = strconv.FormatInt(newTask.ID, 10) | |||
| status = res.Status | |||
| 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 | |||
| } | |||
| @@ -1843,6 +1845,16 @@ func TrainJobDel(ctx *context.Context) { | |||
| 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上的任务记录 | |||
| _, err = modelarts.DelTrainJob(jobID) | |||
| if err != nil { | |||
| @@ -464,6 +464,16 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { | |||
| } | |||
| 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) | |||
| ctx.Flash.Success(ctx.Tr("repo.settings.transfer_succeed")) | |||
| @@ -13,9 +13,9 @@ | |||
| {{ end }} | |||
| <i | |||
| class="ri-error-warning-line" | |||
| style="margin-right: 0.5rem; font-size: 16px" | |||
| style="margin-right: 0.5rem; font-size: 14px" | |||
| ></i> | |||
| <span id="gpu-nums" | |||
| <span id="gpu-nums" style="font-size: 12px" | |||
| >{{.i18n.Tr "repo.wait_count_start"}} | |||
| {{if .QueuesDetail}} | |||
| {{ $gpuQueue }} | |||
| @@ -14,9 +14,9 @@ | |||
| {{ end }} | |||
| <i | |||
| class="ri-error-warning-line" | |||
| style="margin-right: 0.5rem; font-size: 16px" | |||
| style="margin-right: 0.5rem; font-size: 14px" | |||
| ></i> | |||
| <span id="gpu-nums" | |||
| <span id="gpu-nums" style="font-size: 12px" | |||
| >{{.ctx.i18n.Tr "repo.wait_count_start"}} | |||
| {{if .type}} | |||
| {{ $gpuQueue }} | |||
| @@ -89,8 +89,8 @@ | |||
| <div class="ui vertical masthead secondary c2net segment"> | |||
| <div class="ui container"> | |||
| <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 id="app" v-cloak> | |||
| @@ -98,7 +98,7 @@ | |||
| <div class="rotation3D-baseMap"></div> | |||
| <!--旋转3D--> | |||
| <div id="rotation3D" class="rotation3D"> | |||
| <button class="center">中心</button> | |||
| <button class="center">{{.i18n.Tr "home.c2net_center"}}</button> | |||
| <div class="itemList"> | |||
| <div class="rotation3D__item" :class="item.type" v-for="item in itemList"> | |||
| @@ -495,7 +495,7 @@ | |||
| <div style="clear:both"> | |||
| <table style="border:none" class="ui fixed small stackable table"> | |||
| <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> | |||
| <tbody> | |||
| {{range $m ,$n := $.datasetDownload}} | |||
| @@ -493,7 +493,7 @@ | |||
| <div style="clear:both"> | |||
| <table style="border:none" class="ui fixed small stackable table"> | |||
| <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> | |||
| <tbody> | |||
| {{range $m ,$n := $.datasetDownload}} | |||
| @@ -459,7 +459,7 @@ | |||
| <div style="clear:both"> | |||
| <table style="border:none" class="ui fixed small stackable table"> | |||
| <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> | |||
| <tbody> | |||
| {{range $m ,$n := $.datasetDownload}} | |||
| @@ -499,7 +499,7 @@ | |||
| <div> | |||
| <a id="{{.VersionName}}-log-down" | |||
| 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> | |||
| <span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span> | |||
| </a> | |||
| @@ -86,7 +86,7 @@ | |||
| {{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.dataset_path_rule" | Safe}}</span> | |||
| <span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.infer_dataset_path_rule" | Safe}}</span> | |||
| </div> | |||
| </div> | |||
| <div class="required min_title inline field"> | |||
| @@ -436,7 +436,7 @@ td, th { | |||
| <div style="clear:both"> | |||
| <table style="border:none" class="ui fixed small stackable table"> | |||
| <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> | |||
| <tbody> | |||
| {{range $m ,$n := $.datasetDownload}} | |||
| @@ -432,16 +432,16 @@ | |||
| <div style="clear:both"> | |||
| <table style="border:none" class="ui fixed small stackable table"> | |||
| <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> | |||
| <tbody> | |||
| {{range $.datasetDownload}} | |||
| <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;">{{.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> | |||
| {{end}} | |||
| </tbody> | |||
| @@ -113,7 +113,7 @@ | |||
| {{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.dataset_path_rule" | Safe}}</span> | |||
| <span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.train_dataset_path_rule" | Safe}}</span> | |||
| </div> | |||
| </div> | |||
| <div class="required inline min_title field"> | |||
| @@ -274,10 +274,14 @@ | |||
| {{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> | |||
| {{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> | |||
| {{end}} | |||
| </div> | |||
| @@ -478,7 +482,7 @@ | |||
| <div style="clear:both"> | |||
| <table style="border:none" class="ui fixed small stackable table"> | |||
| <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> | |||
| <tbody> | |||
| {{range $m ,$n := $.datasetList}} | |||
| @@ -899,35 +903,7 @@ | |||
| $('#name').val(modelName) | |||
| $('#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') | |||
| } | |||
| @@ -73,6 +73,11 @@ | |||
| <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="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> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> | |||
| @@ -152,26 +157,10 @@ | |||
| </span> | |||
| <a href="https://git.openi.org.cn/OpenIOSSG/MINIST_Example" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a> | |||
| </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> | |||
| <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"> | |||
| <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> | |||
| @@ -213,6 +213,35 @@ export default async function initCloudrainSow() { | |||
| }); | |||
| 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) { | |||
| $.get( | |||
| `/api/v1/repos/${repoPath}/${ID}?version_name=${version_name}`, | |||
| @@ -390,7 +419,7 @@ export default async function initCloudrainSow() { | |||
| html += "</a>"; | |||
| html += "</span>"; | |||
| html += "</td>"; | |||
| html += "<td class='message seven wide'>"; | |||
| html += "<td class='message1 seven wide'>"; | |||
| if (data.Dirs[i].IsDir) { | |||
| html += "<span class='truncate has-emoji'></span>"; | |||
| } else { | |||
| @@ -182,6 +182,15 @@ export default async function initCloudrain() { | |||
| "CREATE_FAILED", | |||
| "STOPPED", | |||
| ]; | |||
| let deleteArray = [ | |||
| "KILLED", | |||
| "FAILED", | |||
| "START_FAILED", | |||
| "COMPLETED", | |||
| "SUCCEEDED", | |||
| "CREATE_FAILED", | |||
| "STOPPED", | |||
| ]; | |||
| $.get( | |||
| `/api/v1/repos/${repoPath}/${jobID}?version_name=${versionname}`, | |||
| (data) => { | |||
| @@ -194,6 +203,10 @@ export default async function initCloudrain() { | |||
| if (stopArray.includes(data.JobStatus)) { | |||
| $("#" + versionname + "-stop").addClass("disabled"); | |||
| } | |||
| if (deleteArray.includes(data.JobStatus)) { | |||
| $(`#${versionname}-delete`).removeClass("disabled"); | |||
| $(`#${versionname}-delete`).addClass("blue"); | |||
| } | |||
| if (data.JobStatus === "COMPLETED") { | |||
| $("#" + versionname + "-create-model") | |||
| .removeClass("disabled") | |||
| @@ -3520,7 +3520,7 @@ function initVueComponents() { | |||
| `${self.reposFilter}:${self.archivedFilter}:${self.privateFilter}`, | |||
| count | |||
| ); | |||
| self.finalPage = Math.floor(count / self.searchLimit) + 1; | |||
| self.finalPage = Math.ceil(count / self.searchLimit); | |||
| self.updateHistory(); | |||
| } | |||
| }).always(() => { | |||