From b350f9546f31f94e9f451011ca6ee92c975cd940 Mon Sep 17 00:00:00 2001 From: tzwang Date: Thu, 5 Dec 2024 18:27:56 +0800 Subject: [PATCH] updated openi --- go.mod | 1 + go.sum | 2 ++ internal/storeLink/openi.go | 62 +++++++++++++++++++++++++++++++++++-- 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index f833c6b3..c3e2dd54 100644 --- a/go.mod +++ b/go.mod @@ -22,6 +22,7 @@ require ( gitlink.org.cn/JointCloud/pcm-hpc v0.0.0-20241125115811-72f3568255a4 gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20240918011543-482dcd609877 gitlink.org.cn/JointCloud/pcm-octopus v0.0.0-20240817071412-44397870b110 + gitlink.org.cn/JointCloud/pcm-openi v0.0.0-20241205101654-eeb26c591155 gitlink.org.cn/JointCloud/pcm-openstack v0.0.0-20240403033338-e7edabad4203 gitlink.org.cn/JointCloud/pcm-slurm v0.0.0-20240301080743-8b94bbaf57f5 go.opentelemetry.io/otel/trace v1.31.0 diff --git a/go.sum b/go.sum index 2dc2c864..552586af 100644 --- a/go.sum +++ b/go.sum @@ -532,6 +532,8 @@ gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20240918011543-482dcd609877 h1:a+ gitlink.org.cn/JointCloud/pcm-modelarts v0.0.0-20240918011543-482dcd609877/go.mod h1:/eOmBFZKWGoabG3sRVkVvIbLwsd2631k4jkUBR6x1AA= gitlink.org.cn/JointCloud/pcm-octopus v0.0.0-20240817071412-44397870b110 h1:GaXwr5sgDh0raHjUf9IewTvnRvajYea7zbLsaerYyXo= gitlink.org.cn/JointCloud/pcm-octopus v0.0.0-20240817071412-44397870b110/go.mod h1:QOD5+/l2D+AYBjF2h5T0mdJyfGAmF78QmeKdbBXbjLQ= +gitlink.org.cn/JointCloud/pcm-openi v0.0.0-20241205101654-eeb26c591155 h1:Vcm7KZH6EnsEYAtUTuDRJX2gXf7OhMZmzgnqc56mbtY= +gitlink.org.cn/JointCloud/pcm-openi v0.0.0-20241205101654-eeb26c591155/go.mod h1:oDJrr/TNbUCaVjI+RaOrUtGawD7UPAvp7U/oVgT2Dhc= gitlink.org.cn/JointCloud/pcm-openstack v0.0.0-20240403033338-e7edabad4203 h1:s6PsZ1+bev294IWdZRlV7mnOwI1+UzFcldVW/BqhQzI= gitlink.org.cn/JointCloud/pcm-openstack v0.0.0-20240403033338-e7edabad4203/go.mod h1:i2rrbMQ+Fve345BY9Heh4MUqVTAimZQElQhzzRee5B8= gitlink.org.cn/JointCloud/pcm-slurm v0.0.0-20240301080743-8b94bbaf57f5 h1:+/5vnzkJBfMRnya1NrhOzlroUtRa5ePiYbPKlHLoLV0= diff --git a/internal/storeLink/openi.go b/internal/storeLink/openi.go index d9fb5f6d..648d7b14 100644 --- a/internal/storeLink/openi.go +++ b/internal/storeLink/openi.go @@ -1,8 +1,66 @@ package storeLink +import ( + "context" + "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/service/collector" +) + type OpenI struct { + Host string +} + +func NewOpenI(host string) *OpenI { + return &OpenI{ + Host: host, + } +} + +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) { + //TODO implement me + panic("implement me") +} + +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 NewOpenI() *OpenI { - return &OpenI{} +func (o OpenI) GetResourceSpecs(ctx context.Context) (*collector.ResourceSpec, error) { + //TODO implement me + panic("implement me") }