|
- package storeLink
-
- import (
- "context"
- "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/service/collector"
- "gitlink.org.cn/JointCloud/pcm-openi/common"
- "gitlink.org.cn/JointCloud/pcm-openi/model"
- )
-
- const (
- DEBUG = "DEBUG"
- TRAIN = "TRAIN"
- INFERENCE = "INFERENCE"
- C2NET = "C2Net"
- TESTREPO = "testrepo"
- )
-
- // compute source
- var (
- ComputeSource = []string{"GPU", "NPU", "GCU", "MLU", "DCU", "CPU", "ILUVATAR-GPGPU", "METAX-GPGPU"}
- )
-
- type OpenI struct {
- participantId int64
- host string
- userName string
- accessToken string
- }
-
- func NewOpenI(host string, id int64, name string, token string) *OpenI {
- return &OpenI{
- host: host,
- participantId: id,
- userName: name,
- accessToken: token,
- }
- }
-
- func (o OpenI) GetResourceStats(ctx context.Context) (*collector.ResourceStats, error) {
- //TODO implement me
- panic("implement me")
- }
-
- func (o OpenI) GetDatasetsSpecs(ctx context.Context) ([]*collector.DatasetsSpecs, error) {
- var specs []*collector.DatasetsSpecs
- var url string
-
- for _ = range ComputeSource {
- param := model.TaskCreationRequiredParam{}
- resp := model.TaskCreationRequired{}
- go func() {
- req := common.GetRestyRequest(common.TIMEOUT)
- _, err := req.
- SetBody(param).
- SetQueryParam(common.ACCESSTOKEN, o.accessToken).
- SetResult(&resp).
- Get(url)
-
- if err != nil {
- return
- }
-
- spec := &collector.DatasetsSpecs{}
- specs = append(specs, spec)
- }()
-
- }
-
- return specs, nil
- }
-
- func (o OpenI) GetAlgorithms(ctx context.Context) ([]*collector.Algorithm, error) {
- //TODO implement me
- panic("implement me")
- }
-
- func (o OpenI) GetTrainingTaskLog(ctx context.Context, taskId string, instanceNum string) (string, error) {
- //TODO implement me
- panic("implement me")
- }
-
- func (o OpenI) GetTrainingTask(ctx context.Context, taskId string) (*collector.Task, error) {
- //TODO implement me
- panic("implement me")
- }
-
- func (o OpenI) DownloadAlgorithmCode(ctx context.Context, resourceType string, card string, taskType string, dataset string, algorithm string) (string, error) {
- //TODO implement me
- panic("implement me")
- }
-
- func (o OpenI) UploadAlgorithmCode(ctx context.Context, resourceType string, card string, taskType string, dataset string, algorithm string, code string) error {
- //TODO implement me
- panic("implement me")
- }
-
- func (o OpenI) GetComputeCards(ctx context.Context) ([]string, error) {
- //TODO implement me
- panic("implement me")
- }
-
- func (o OpenI) GetUserBalance(ctx context.Context) (float64, error) {
- //TODO implement me
- panic("implement me")
- }
-
- func (o OpenI) GetResourceSpecs(ctx context.Context) (*collector.ResourceSpec, error) {
- //TODO implement me
- panic("implement me")
- }
|