Browse Source

优化工作流绑定模型代码

pull/52/head
JeshuaRen 6 months ago
parent
commit
3b89aef0a8
3 changed files with 17 additions and 15 deletions
  1. +3
    -3
      sdks/pcmscheduler/jobset.go
  2. +5
    -3
      sdks/pcmscheduler/models.go
  3. +9
    -9
      sdks/scheduler/models.go

+ 3
- 3
sdks/pcmscheduler/jobset.go View File

@@ -61,7 +61,7 @@ type CreateInferenceJobResp struct {
TaskId string `json:"taskId"`
}

type CreatePCMJobReq struct {
type CreateAIJobReq struct {
Name string `json:"name"`
Description string `json:"description"`
JobResources schsdk.JobResources `json:"jobResources"`
@@ -126,7 +126,7 @@ type ScheduleData struct {
ClusterIDs []schsdk.ClusterID `json:"clusterIDs"`
}

func (c *Client) CreateInferenceJob(req CreatePCMJobReq, token string) (*CreateInferenceJobResp, error) {
func (c *Client) CreateInferenceJob(req CreateAIJobReq, token string) (*CreateInferenceJobResp, error) {
targetUrl, err := url.JoinPath(c.baseURL, "inference/createTask")
if err != nil {
return nil, err
@@ -160,7 +160,7 @@ func (c *Client) CreateInferenceJob(req CreatePCMJobReq, token string) (*CreateI

}

func (c *Client) CreateJob(req CreatePCMJobReq, token string) (*CreateJobResp, error) {
func (c *Client) CreateJob(req CreateAIJobReq, token string) (*CreateJobResp, error) {
targetUrl, err := url.JoinPath(c.baseURL, "schedule/createTask")
if err != nil {
return nil, err


+ 5
- 3
sdks/pcmscheduler/models.go View File

@@ -282,8 +282,8 @@ func (d *JobSubmitInfoBase) Noop() {}
type PCMJobSubmitInfo struct {
serder.Metadata `union:"pcm"`
JobSubmitInfoBase
Type string `json:"type"`
Info CreatePCMJobReq `json:"info"`
Type string `json:"type"`
Info CreateAIJobReq `json:"info"`
}

type HPCJobSubmitInfo struct {
@@ -441,7 +441,9 @@ var DataBindingTypeUnion = types.NewTypeUnion[DataBinding](

var _ = serder.UseTypeUnionInternallyTagged(&DataBindingTypeUnion, "type")

type DataBindingBase struct{}
type DataBindingBase struct {
RootPath string `json:"rootPath"`
}

func (d *DataBindingBase) Noop() {}



+ 9
- 9
sdks/scheduler/models.go View File

@@ -178,15 +178,15 @@ func (d *DataBindingBase) Noop() {}
type ModelBinding struct {
serder.Metadata `union:"model"`
DataBindingBase
Type string `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
ClusterIDs []string `json:"clusterIDs"`
Category string `json:"category"`
ModelType string `json:"modelType"`
Env string `json:"env"`
Version string `json:"version"`
RepositoryName string `json:"repositoryName"`
Type string `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
ClusterIDs []ClusterID `json:"clusterIDs"`
Category string `json:"category"`
ModelType string `json:"modelType"`
Env string `json:"env"`
Version string `json:"version"`
RepositoryName string `json:"repositoryName"`
}

type HPCJobInfo struct {


Loading…
Cancel
Save