|
|
@@ -9,6 +9,7 @@ import ( |
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
"code.gitea.io/gitea/modules/context" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/notification" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
"code.gitea.io/gitea/modules/storage" |
|
|
|
) |
|
|
@@ -259,7 +260,7 @@ func GenerateTask(ctx *context.Context, jobName, uuid, description, flavor strin |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, jobResult.ID, jobName, models.ActionCreateDebugNPUTask) |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
@@ -335,12 +336,12 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error |
|
|
|
log.Error("GetAttachmentByUUID(%s) failed:%v", strconv.FormatInt(jobResult.JobID, 10), err.Error()) |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
jobId := strconv.FormatInt(jobResult.JobID, 10) |
|
|
|
err = models.CreateCloudbrain(&models.Cloudbrain{ |
|
|
|
Status: TransTrainJobStatus(jobResult.Status), |
|
|
|
UserID: ctx.User.ID, |
|
|
|
RepoID: ctx.Repo.Repository.ID, |
|
|
|
JobID: strconv.FormatInt(jobResult.JobID, 10), |
|
|
|
JobID: jobId, |
|
|
|
JobName: req.JobName, |
|
|
|
JobType: string(models.JobTypeTrain), |
|
|
|
Type: models.TypeCloudBrainTwo, |
|
|
@@ -371,7 +372,7 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error |
|
|
|
log.Error("CreateCloudbrain(%s) failed:%v", req.JobName, err.Error()) |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, jobId, req.JobName, models.ActionCreateTrainTask) |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
@@ -555,12 +556,12 @@ func GenerateInferenceJob(ctx *context.Context, req *GenerateInferenceJobReq) (e |
|
|
|
log.Error("GetAttachmentByUUID(%s) failed:%v", strconv.FormatInt(jobResult.JobID, 10), err.Error()) |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
jobID := strconv.FormatInt(jobResult.JobID, 10) |
|
|
|
err = models.CreateCloudbrain(&models.Cloudbrain{ |
|
|
|
Status: TransTrainJobStatus(jobResult.Status), |
|
|
|
UserID: ctx.User.ID, |
|
|
|
RepoID: ctx.Repo.Repository.ID, |
|
|
|
JobID: strconv.FormatInt(jobResult.JobID, 10), |
|
|
|
JobID: jobID, |
|
|
|
JobName: req.JobName, |
|
|
|
JobType: string(models.JobTypeInference), |
|
|
|
Type: models.TypeCloudBrainTwo, |
|
|
@@ -595,6 +596,6 @@ func GenerateInferenceJob(ctx *context.Context, req *GenerateInferenceJobReq) (e |
|
|
|
log.Error("CreateCloudbrain(%s) failed:%v", req.JobName, err.Error()) |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, jobID, req.JobName, models.ActionCreateInferenceTask) |
|
|
|
return nil |
|
|
|
} |