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.

downloadalgothmcodelogic.go 998 B

123456789101112131415161718192021222324252627282930313233343536
  1. package schedule
  2. import (
  3. "context"
  4. "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc"
  5. "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types"
  6. "github.com/zeromicro/go-zero/core/logx"
  7. )
  8. type DownloadAlgothmCodeLogic struct {
  9. logx.Logger
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. }
  13. func NewDownloadAlgothmCodeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DownloadAlgothmCodeLogic {
  14. return &DownloadAlgothmCodeLogic{
  15. Logger: logx.WithContext(ctx),
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. }
  19. }
  20. func (l *DownloadAlgothmCodeLogic) DownloadAlgorithmCode(req *types.DownloadAlgorithmCodeReq) (resp *types.DownloadAlgorithmCodeResp, err error) {
  21. resp = &types.DownloadAlgorithmCodeResp{}
  22. code, err := l.svcCtx.Scheduler.AiService.AiCollectorAdapterMap[req.AdapterId][req.ClusterId].DownloadAlgorithmCode(l.ctx,
  23. req.ResourceType, req.Card, req.TaskType, req.Dataset, req.Algorithm)
  24. if err != nil {
  25. return nil, err
  26. }
  27. resp.Code = code
  28. return resp, nil
  29. }

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.