Signed-off-by: devad <cossjie@foxmail.com>
This commit is contained in:
devad 2023-11-01 17:57:51 +08:00
parent 0b06b3b508
commit a25b621bf5
1 changed files with 9 additions and 3 deletions

View File

@ -44,8 +44,9 @@ func (o *ModelArtsLink) DeleteImage(imageId string) (interface{}, error) {
func (o *ModelArtsLink) QueryImageList() (interface{}, error) {
// modelArts获取镜像列表
req := &modelarts.ListRepoReq{
Offset: "0",
Limit: strconv.Itoa(int(o.pageSize)),
Offset: "0",
Limit: strconv.Itoa(int(o.pageSize)),
Platform: o.platform,
}
resp, err := o.svcCtx.ModelArtsImgRpc.ListReposDetails(o.ctx, req)
if err != nil {
@ -89,6 +90,7 @@ func (o *ModelArtsLink) SubmitTask(imageId string, cmd string, params []string,
NodeCount: 1,
},
},
Platform: o.platform,
}
resp, err := o.svcCtx.ModelArtsRpc.CreateTrainingJob(o.ctx, req)
if err != nil {
@ -108,6 +110,7 @@ func (o *ModelArtsLink) QueryTask(taskId string) (interface{}, error) {
// 获取任务
req := &modelarts.DetailTrainingJobsReq{
TrainingJobId: taskId,
Platform: o.platform,
}
resp, err := o.svcCtx.ModelArtsRpc.GetTrainingJobs(o.ctx, req)
if err != nil {
@ -127,6 +130,7 @@ func (o *ModelArtsLink) DeleteTask(taskId string) (interface{}, error) {
// 删除任务
req := &modelarts.DeleteTrainingJobReq{
TrainingJobId: taskId,
Platform: o.platform,
}
resp, err := o.svcCtx.ModelArtsRpc.DeleteTrainingJob(o.ctx, req)
if err != nil {
@ -144,7 +148,9 @@ func (o *ModelArtsLink) DeleteTask(taskId string) (interface{}, error) {
func (o *ModelArtsLink) QuerySpecs() (interface{}, error) {
// octopus查询资源规格
req := &modelarts.TrainingJobFlavorsReq{}
req := &modelarts.TrainingJobFlavorsReq{
Platform: o.platform,
}
resp, err := o.svcCtx.ModelArtsRpc.GetTrainingJobFlavors(o.ctx, req)
if err != nil {
return nil, err