forked from JointCloud/pcm-coordinator
fix: add stop task of ai modelarts
This commit is contained in:
parent
18e3aeb6ee
commit
51615227aa
2
go.mod
2
go.mod
|
@ -20,7 +20,7 @@ require (
|
|||
github.com/zeromicro/go-zero v1.7.4
|
||||
gitlink.org.cn/JointCloud/pcm-ac v0.0.0-20250107025835-8fc888b1d170
|
||||
gitlink.org.cn/JointCloud/pcm-hpc v0.0.0-20241125115811-72f3568255a4
|
||||
gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20241211021152-9771ba5670b7
|
||||
gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20250108072048-9adf0597b07c
|
||||
gitlink.org.cn/JointCloud/pcm-octopus v0.0.0-20240817071412-44397870b110
|
||||
gitlink.org.cn/JointCloud/pcm-openi v0.0.0-20250102093846-164b4884c9ec
|
||||
gitlink.org.cn/JointCloud/pcm-openstack v0.0.0-20240403033338-e7edabad4203
|
||||
|
|
6
go.sum
6
go.sum
|
@ -530,6 +530,12 @@ gitlink.org.cn/JointCloud/pcm-hpc v0.0.0-20241125115811-72f3568255a4 h1:WIs/189l
|
|||
gitlink.org.cn/JointCloud/pcm-hpc v0.0.0-20241125115811-72f3568255a4/go.mod h1:YbuoRgF9sEVvNJPQtGRjdocX7Du6NBOTLn+GVwqRVjo=
|
||||
gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20241211021152-9771ba5670b7 h1:sPyw2qIID5vY/eJBY9UiHBzIF/gk0GUhei9sRIADrE4=
|
||||
gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20241211021152-9771ba5670b7/go.mod h1:V19vFg8dWRAbaskASoSj70dgpacswOqZu/SaI02dxac=
|
||||
gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20250107100442-f1114f7b6231 h1:Svk5SjRiPInj6c8fn/SM/nXuGQ5wzKC1mLgE5jet0H8=
|
||||
gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20250107100442-f1114f7b6231/go.mod h1:V19vFg8dWRAbaskASoSj70dgpacswOqZu/SaI02dxac=
|
||||
gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20250108025929-5fb49198c385 h1:RxOh79LrAHSEFyexWVa5YG3NsNJaMwj/hnzK3Oio51M=
|
||||
gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20250108025929-5fb49198c385/go.mod h1:V19vFg8dWRAbaskASoSj70dgpacswOqZu/SaI02dxac=
|
||||
gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20250108072048-9adf0597b07c h1:9LphS29VNfoWT73eqhgwKV1nG8PcoDUNu7dRev845wA=
|
||||
gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20250108072048-9adf0597b07c/go.mod h1:V19vFg8dWRAbaskASoSj70dgpacswOqZu/SaI02dxac=
|
||||
gitlink.org.cn/JointCloud/pcm-octopus v0.0.0-20240817071412-44397870b110 h1:GaXwr5sgDh0raHjUf9IewTvnRvajYea7zbLsaerYyXo=
|
||||
gitlink.org.cn/JointCloud/pcm-octopus v0.0.0-20240817071412-44397870b110/go.mod h1:QOD5+/l2D+AYBjF2h5T0mdJyfGAmF78QmeKdbBXbjLQ=
|
||||
gitlink.org.cn/JointCloud/pcm-openi v0.0.0-20250102093846-164b4884c9ec h1:Yul2JOAIS94B+eIg0UvmBSe8JrtSrZ2OA47gAYLiBYI=
|
||||
|
|
|
@ -995,5 +995,16 @@ func (m *ModelArtsLink) GetResourceSpecs(ctx context.Context) (*collector.Resour
|
|||
}
|
||||
|
||||
func (m *ModelArtsLink) Stop(ctx context.Context, id string) error {
|
||||
return errors.New("failed to implement")
|
||||
req := &modelarts.StopTrainingJobReq{
|
||||
TrainingJobId: id,
|
||||
ActionType: "terminate",
|
||||
}
|
||||
resp, err := m.modelArtsRpc.StopTrainingJob(ctx, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if resp.Code != 0 {
|
||||
return errors.New(resp.ErrorMsg)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue