| @@ -62,6 +62,7 @@ type Cloudbrain struct { | |||||
| Type int `xorm:"INDEX DEFAULT 0"` | Type int `xorm:"INDEX DEFAULT 0"` | ||||
| VersionID int64 `xorm:"INDEX DEFAULT 0"` | VersionID int64 `xorm:"INDEX DEFAULT 0"` | ||||
| VersionName string | VersionName string | ||||
| Uuid string | |||||
| User *User `xorm:"-"` | User *User `xorm:"-"` | ||||
| Repo *Repository `xorm:"-"` | Repo *Repository `xorm:"-"` | ||||
| @@ -636,18 +637,20 @@ type GetTrainJobResult struct { | |||||
| //DataSource []DataSource `json:"data_source"` | //DataSource []DataSource `json:"data_source"` | ||||
| //SpecID int64 `json:"spec_id"` | //SpecID int64 `json:"spec_id"` | ||||
| EngineID int64 `json:"engine_id"` | EngineID int64 `json:"engine_id"` | ||||
| EngineName string `json:"engine_name"` | |||||
| EngineVersion string `json:"engine_version"` | |||||
| //ModelID int64 `json:"model_id"` | //ModelID int64 `json:"model_id"` | ||||
| TrainUrl string `json:"train_url"` //训练作业的输出文件OBS路径URL | TrainUrl string `json:"train_url"` //训练作业的输出文件OBS路径URL | ||||
| LogUrl string `json:"log_url"` | LogUrl string `json:"log_url"` | ||||
| //UserImageUrl string `json:"user_image_url"` | //UserImageUrl string `json:"user_image_url"` | ||||
| //UserCommand string `json:"user_command"` | //UserCommand string `json:"user_command"` | ||||
| CreateVersion bool `json:"create_version"` | |||||
| //Volumes []Volumes `json:"volumes"` | //Volumes []Volumes `json:"volumes"` | ||||
| Flavor Flavor `json:"flavor"` | Flavor Flavor `json:"flavor"` | ||||
| PoolID string `json:"pool_id"` | PoolID string `json:"pool_id"` | ||||
| PoolName string `json:"pool_name"` | PoolName string `json:"pool_name"` | ||||
| NasMountPath string `json:"nas_mount_path"` | NasMountPath string `json:"nas_mount_path"` | ||||
| NasShareAddr string `json:"nas_share_addr"` | NasShareAddr string `json:"nas_share_addr"` | ||||
| DatasetName string | |||||
| } | } | ||||
| type GetTrainJobLogResult struct { | type GetTrainJobLogResult struct { | ||||
| @@ -107,6 +107,7 @@ func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath, | |||||
| SubTaskName: SubTaskName, | SubTaskName: SubTaskName, | ||||
| JobType: jobType, | JobType: jobType, | ||||
| Type: models.TypeCloudBrainOne, | Type: models.TypeCloudBrainOne, | ||||
| Uuid: uuid, | |||||
| }) | }) | ||||
| if err != nil { | if err != nil { | ||||
| @@ -129,6 +129,7 @@ func GenerateTask(ctx *context.Context, jobName, uuid, description string) error | |||||
| JobName: jobName, | JobName: jobName, | ||||
| JobType: string(models.JobTypeDebug), | JobType: string(models.JobTypeDebug), | ||||
| Type: models.TypeCloudBrainNotebook, | Type: models.TypeCloudBrainNotebook, | ||||
| Uuid: uuid, | |||||
| }) | }) | ||||
| if err != nil { | if err != nil { | ||||
| @@ -173,6 +174,7 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) error { | |||||
| Type: models.TypeCloudBrainTrainJob, | Type: models.TypeCloudBrainTrainJob, | ||||
| VersionID: jobResult.VersionID, | VersionID: jobResult.VersionID, | ||||
| VersionName: jobResult.VersionName, | VersionName: jobResult.VersionName, | ||||
| Uuid: req.Uuid, | |||||
| }) | }) | ||||
| if err != nil { | if err != nil { | ||||
| @@ -427,6 +427,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||||
| EngineID: int64(engineID), | EngineID: int64(engineID), | ||||
| LogUrl: logObsPath, | LogUrl: logObsPath, | ||||
| PoolID: poolID, | PoolID: poolID, | ||||
| Uuid: uuid, | |||||
| } | } | ||||
| err := modelarts.GenerateTrainJob(ctx, req) | err := modelarts.GenerateTrainJob(ctx, req) | ||||
| @@ -537,6 +538,13 @@ func TrainJobShow(ctx *context.Context) { | |||||
| return | return | ||||
| } | } | ||||
| attach, err := models.GetAttachmentByUUID(task.Uuid) | |||||
| if err != nil { | |||||
| log.Error("GetAttachmentByUUID(%s) failed:%v", jobID, err.Error()) | |||||
| ctx.RenderWithErr(err.Error(), tplModelArtsTrainJobIndex, nil) | |||||
| return | |||||
| } | |||||
| result, err := modelarts.GetTrainJob(jobID, strconv.FormatInt(task.VersionID, 10)) | result, err := modelarts.GetTrainJob(jobID, strconv.FormatInt(task.VersionID, 10)) | ||||
| if err != nil { | if err != nil { | ||||
| log.Error("GetJob(%s) failed:%v", jobID, err.Error()) | log.Error("GetJob(%s) failed:%v", jobID, err.Error()) | ||||
| @@ -547,6 +555,7 @@ func TrainJobShow(ctx *context.Context) { | |||||
| if result != nil { | if result != nil { | ||||
| result.CreateTime = time.Unix(int64(result.LongCreateTime/1000), 0).Format("2006-01-02 15:04:05") | result.CreateTime = time.Unix(int64(result.LongCreateTime/1000), 0).Format("2006-01-02 15:04:05") | ||||
| result.Status = modelarts.TransTrainJobStatus(result.IntStatus) | result.Status = modelarts.TransTrainJobStatus(result.IntStatus) | ||||
| result.DatasetName = attach.Name | |||||
| } | } | ||||
| ctx.Data["task"] = task | ctx.Data["task"] = task | ||||
| @@ -125,6 +125,27 @@ | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <!-- 确认模态框 --> | |||||
| <div id="deletemodel"> | |||||
| <div class="ui basic modal"> | |||||
| <div class="ui icon header"> | |||||
| <i class="trash icon"></i> 删除任务 | |||||
| </div> | |||||
| <div class="content"> | |||||
| <p>你确认删除该任务么?此任务一旦删除不可恢复。</p> | |||||
| </div> | |||||
| <div class="actions"> | |||||
| <div class="ui red basic inverted cancel button"> | |||||
| <i class="remove icon"></i> 取消操作 | |||||
| </div> | |||||
| <div class="ui green basic inverted ok button"> | |||||
| <i class="checkmark icon"></i> 确定操作 | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| </div> | </div> | ||||
| {{template "base/footer" .}} | {{template "base/footer" .}} | ||||
| @@ -66,7 +66,7 @@ | |||||
| <tbody> | <tbody> | ||||
| <tr> | <tr> | ||||
| <td class="four wide"> {{.i18n.Tr "repo.modelarts.train_job.AI_driver"}} </td> | <td class="four wide"> {{.i18n.Tr "repo.modelarts.train_job.AI_driver"}} </td> | ||||
| <td>{{.result.BootFileUrl}}</td> | |||||
| <td>{{.result.EngineName}} | {{.result.EngineVersion}}</td> | |||||
| </tr> | </tr> | ||||
| <tr> | <tr> | ||||
| <td class="four wide"> {{.i18n.Tr "repo.modelarts.train_job.start_file"}}</td> | <td class="four wide"> {{.i18n.Tr "repo.modelarts.train_job.start_file"}}</td> | ||||
| @@ -74,7 +74,7 @@ | |||||
| </tr> | </tr> | ||||
| <tr> | <tr> | ||||
| <td class="four wide"> {{.i18n.Tr "repo.modelarts.train_job.dataset"}} </td> | <td class="four wide"> {{.i18n.Tr "repo.modelarts.train_job.dataset"}} </td> | ||||
| <td>{{.result.BootFileUrl}}</td> | |||||
| <td>{{.result.DatasetName}}</td> | |||||
| </tr> | </tr> | ||||
| <tr> | <tr> | ||||
| <td class="four wide"> {{.i18n.Tr "repo.modelarts.train_job.run_parameter"}} </td> | <td class="four wide"> {{.i18n.Tr "repo.modelarts.train_job.run_parameter"}} </td> | ||||