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.

hpcScheduler.go 1.8 kB

11 months ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. Copyright (c) [2023] [pcm]
  3. [pcm-coordinator] is licensed under Mulan PSL v2.
  4. You can use this software according to the terms and conditions of the Mulan PSL v2.
  5. You may obtain a copy of Mulan PSL v2 at:
  6. http://license.coscl.org.cn/MulanPSL2
  7. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  8. EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  9. MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  10. See the Mulan PSL v2 for more details.
  11. */
  12. package schedulers
  13. import (
  14. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/algorithm/providerPricing"
  15. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/strategy"
  16. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/constants"
  17. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models"
  18. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/response"
  19. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils"
  20. )
  21. type HpcScheduler struct {
  22. yamlString string
  23. }
  24. func NewHpcScheduler(val string) *HpcScheduler {
  25. return &HpcScheduler{yamlString: val}
  26. }
  27. func (h *HpcScheduler) GetNewStructForDb(task *response.TaskInfo, resource string, participantId int64) (interface{}, error) {
  28. hpc := models.Hpc{}
  29. utils.Convert(task.Metadata, &hpc)
  30. hpc.Id = utils.GenSnowflakeID()
  31. hpc.TaskId = task.TaskId
  32. hpc.Status = constants.Saved
  33. hpc.ParticipantId = participantId
  34. hpc.YamlString = h.yamlString
  35. return hpc, nil
  36. }
  37. func (h *HpcScheduler) PickOptimalStrategy() (strategy.Strategy, error) {
  38. return nil, nil
  39. }
  40. func (h *HpcScheduler) genTaskAndProviders(task *response.TaskInfo) (*providerPricing.Task, []*providerPricing.Provider) {
  41. return nil, nil
  42. }
  43. func (h *HpcScheduler) AssignTask(clusters []*strategy.AssignedCluster, mode int) (interface{}, error) {
  44. return nil, nil
  45. }

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.