|
|
|
@@ -16,12 +16,13 @@ package storeLink |
|
|
|
|
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"github.com/pkg/errors" |
|
|
|
"gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/scheduler/schedulers/option" |
|
|
|
"gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/scheduler/service/collector" |
|
|
|
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" |
|
|
|
"gitlink.org.cn/jcce-pcm/pcm-participant-modelarts/client/imagesservice" |
|
|
|
"gitlink.org.cn/jcce-pcm/pcm-participant-modelarts/client/modelartsservice" |
|
|
|
"gitlink.org.cn/jcce-pcm/pcm-participant-modelarts/modelarts" |
|
|
|
"gitlink.org.cn/JointCloud/pcm-modelarts/client/imagesservice" |
|
|
|
"gitlink.org.cn/JointCloud/pcm-modelarts/client/modelartsservice" |
|
|
|
"gitlink.org.cn/JointCloud/pcm-modelarts/modelarts" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
) |
|
|
|
@@ -159,7 +160,27 @@ func (m *ModelArtsLink) GetDatasetsSpecs(ctx context.Context) ([]*collector.Data |
|
|
|
} |
|
|
|
|
|
|
|
func (m *ModelArtsLink) GetAlgorithms(ctx context.Context) ([]*collector.Algorithm, error) { |
|
|
|
return nil, nil |
|
|
|
var algorithms []*collector.Algorithm |
|
|
|
|
|
|
|
req := &modelarts.ListAlgorithmsReq{ |
|
|
|
Platform: m.platform, |
|
|
|
Offset: m.pageIndex, |
|
|
|
Limit: m.pageSize, |
|
|
|
} |
|
|
|
resp, err := m.modelArtsRpc.ListAlgorithms(ctx, req) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
if resp.ErrorMsg != "" { |
|
|
|
return nil, errors.New("failed to get algorithms") |
|
|
|
} |
|
|
|
|
|
|
|
for _, a := range resp.Items { |
|
|
|
//TODO The value of taskType is temporarily fixed to "pytorch" |
|
|
|
algorithm := &collector.Algorithm{Name: a.Metadata.Name, Platform: MODELARTS, TaskType: "pytorch"} |
|
|
|
algorithms = append(algorithms, algorithm) |
|
|
|
} |
|
|
|
return algorithms, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (m *ModelArtsLink) GetComputeCards(ctx context.Context) ([]string, error) { |
|
|
|
|