You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

getdeployinstancelogic.go 1.1 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package inference
  2. import (
  3. "context"
  4. "strconv"
  5. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
  6. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type GetDeployInstanceLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewGetDeployInstanceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDeployInstanceLogic {
  15. return &GetDeployInstanceLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *GetDeployInstanceLogic) GetDeployInstance(req *types.GetDeployInstanceReq) (resp *types.GetDeployInstanceResp, err error) {
  22. resp = &types.GetDeployInstanceResp{}
  23. id, err := strconv.ParseInt(req.Id, 10, 64)
  24. ins, err := l.svcCtx.Scheduler.AiStorages.GetInferDeployInstanceById(id)
  25. if err != nil {
  26. return nil, err
  27. }
  28. in, err := l.svcCtx.Scheduler.AiService.InferenceAdapterMap[strconv.FormatInt(ins.AdapterId, 10)][strconv.FormatInt(ins.ClusterId, 10)].GetInferDeployInstance(l.ctx, ins.InstanceId)
  29. if err != nil {
  30. return nil, err
  31. }
  32. resp.Instance = in
  33. return
  34. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.