v1

package
v0.14.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ClusterApi         = Prefix + "/cluster"
	KeyMarker          = "marker"
	KeyMaxKeys         = "maxKeys"
	KeyClusterNameList = "clusterNames"
	KeyClusterStatus   = "clusterStatus"
)
View Source
const (
	FsApi       = Prefix + "/fs"
	FsCacheApi  = Prefix + "/fsCache"
	StsApi      = Prefix + "/fsSts"
	KeyUsername = "username"
	StsDuration = "duration"
)
View Source
const (
	JobApi          = Prefix + "/job"
	TypeSingle      = "single"
	TypeDistributed = "distributed"
	TypeWorkflow    = "workflow"
	KeyAction       = "action"
	KeyStatus       = "status"
	KeyTimestamp    = "timestamp"
	KeyStartTime    = "startTime"
	KeyQueue        = "queue"
	KeyLabels       = "labels"
)
View Source
const (
	QueueApi = Prefix + "/queue"
	KeyName  = "name"
)
View Source
const (
	Prefix   = util.PaddleflowRouterPrefix + util.PaddleflowRouterVersionV1
	LoginApi = Prefix + "/login"
)
View Source
const (
	FlavourAPI = Prefix + "/flavour"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIV1Client

type APIV1Client struct {
	// contains filtered or unexported fields
}

APIV1Client is used to interact with features provided by the group.

func NewForConfig

func NewForConfig(config *core.PaddleFlowClientConfiguration) (*APIV1Client, error)

func (*APIV1Client) Cluster

func (c *APIV1Client) Cluster() ClusterInterface

func (*APIV1Client) FileSystem

func (c *APIV1Client) FileSystem() FileSystemInterface

func (*APIV1Client) FileSystemCache added in v0.14.6

func (c *APIV1Client) FileSystemCache() FileSystemCacheInterface

func (*APIV1Client) Flavour added in v0.14.3

func (c *APIV1Client) Flavour() FlavourInterface

func (*APIV1Client) Job

func (c *APIV1Client) Job() JobInterface

func (*APIV1Client) Pipeline added in v0.14.4

func (c *APIV1Client) Pipeline() PipelineInterface

func (*APIV1Client) Queue

func (c *APIV1Client) Queue() QueueInterface

func (*APIV1Client) RESTClient

func (c *APIV1Client) RESTClient() *core.PaddleFlowClient

RESTClient returns a RESTClient that is used to communicate with API server by this client implementation.

func (*APIV1Client) Run added in v0.14.4

func (c *APIV1Client) Run() RunInterface

func (*APIV1Client) Schedule added in v0.14.4

func (c *APIV1Client) Schedule() ScheduleInterface

func (*APIV1Client) User

func (c *APIV1Client) User() UserInterface

type ArtifactEventBrief added in v0.14.4

type ArtifactEventBrief struct {
	RunID        string `json:"runID"`
	FsName       string `json:"fsname"`
	UserName     string `json:"username"`
	ArtifactPath string `json:"artifactPath"`
	Step         string `json:"step"`
	JobID        string `json:"jobID"`
	Type         string `json:"type"`
	ArtifactName string `json:"artifactName"`
	Meta         string `json:"meta"`
	CreateTime   string `json:"createTime"`
	UpdateTime   string `json:"updateTime"`
}

type ClusterCommonInfo added in v0.14.3

type ClusterCommonInfo struct {
	ID            string   `json:"clusterId"`     // 集群id
	Description   string   `json:"description"`   // 集群描述
	Endpoint      string   `json:"endpoint"`      // 集群endpoint, 比如 http://10.11.11.47:8080
	Source        string   `json:"source"`        // 来源, 比如 OnPremise (内部部署)、AWS、CCE
	ClusterType   string   `json:"clusterType"`   // 集群类型,比如kubernetes/local/yarn
	Version       string   `json:"version"`       // 集群版本v1.16
	Status        string   `json:"status"`        // 集群状态,可选值为online, offline
	Credential    string   `json:"credential"`    // 用于存储集群的凭证信息,比如k8s的kube_config配置
	Setting       string   `json:"setting"`       // 存储额外配置信息
	NamespaceList []string `json:"namespaceList"` // 命名空间列表,json类型,如["ns1", "ns2"]
}

type ClusterGetter

type ClusterGetter interface {
	Cluster() ClusterInterface
}

type ClusterInfo added in v0.14.3

type ClusterInfo struct {
	ID               string
	CreatedAt        time.Time
	UpdatedAt        time.Time
	Name             string   `json:"clusterName"`   // 集群名字
	Description      string   `json:"description"`   // 集群描述
	Endpoint         string   `json:"endpoint"`      // 集群endpoint, 比如 http://10.11.11.47:8080
	Source           string   `json:"source"`        // 来源, 比如 OnPremise (内部部署)、AWS、CCE
	ClusterType      string   `json:"clusterType"`   // 集群类型,比如Kubernetes/Local
	Version          string   `json:"version"`       // 集群版本,比如v1.16
	Status           string   `json:"status"`        // 集群状态,可选值为online, offline
	Credential       string   `json:"credential"`    // 用于存储集群的凭证信息,比如k8s的kube_config配置
	Setting          string   `json:"setting"`       // 存储额外配置信息
	RawNamespaceList string   `json:"-"`             // 命名空间列表,json类型,如["ns1", "ns2"]
	NamespaceList    []string `json:"namespaceList"` // 命名空间列表,json类型,如["ns1", "ns2"]
	DeletedAt        string   `json:"-"`             // 删除标识,非空表示软删除
}

type ClusterInterface

type ClusterInterface interface {
	Create(ctx context.Context, request *CreateClusterRequest, token string) (*CreateClusterResponse, error)
	Get(ctx context.Context, clusterName string, token string) (*GetClusterResponse, error)
	List(ctx context.Context, request *ListClusterRequest, token string) (*ListClusterResponse, error)
	Update(ctx context.Context, clusterName string, request *UpdateClusterRequest, token string) (*UpdateClusterResponse, error)
	Delete(ctx context.Context, clusterName string, token string) error
}

type CommonJobInfo added in v0.14.3

type CommonJobInfo struct {
	ID               string            `json:"id"`
	Name             string            `json:"name"`
	Labels           map[string]string `json:"labels"`
	Annotations      map[string]string `json:"annotations"`
	SchedulingPolicy SchedulingPolicy  `json:"schedulingPolicy"`
	UserName         string            `json:",omitempty"`
}

CommonJobInfo the common fields for jobs

type CreateClusterRequest added in v0.14.3

type CreateClusterRequest struct {
	ClusterCommonInfo
	Name string `json:"clusterName"` // 集群名字
}

type CreateClusterResponse added in v0.14.3

type CreateClusterResponse struct {
	ID               string
	CreatedAt        time.Time
	UpdatedAt        time.Time
	Name             string   // 集群名字
	Description      string   // 集群描述
	Endpoint         string   // 集群endpoint, 比如 http://10.11.11.47:8080
	Source           string   // 来源, 比如 OnPremise (内部部署)、AWS、CCE
	ClusterType      string   // 集群类型,比如Kubernetes/Local
	Version          string   // 集群版本,比如v1.16
	Status           string   // 集群状态,可选值为online, offline
	Credential       string   // 用于存储集群的凭证信息,比如k8s的kube_config配置
	Setting          string   // 存储额外配置信息
	RawNamespaceList string   // 命名空间列表,json类型,如["ns1", "ns2"]
	NamespaceList    []string // 命名空间列表,json类型,如["ns1", "ns2"]
	DeletedAt        string   // 删除标识,非空表示软删除
}

type CreateDisJobRequest added in v0.14.3

type CreateDisJobRequest struct {
	CommonJobInfo     `json:",inline"`
	Framework         schema.Framework       `json:"framework"`
	Members           []MemberSpec           `json:"members"`
	ExtensionTemplate map[string]interface{} `json:"extensionTemplate"`
}

CreateDisJobRequest convey request for create distributed job

type CreateFileSystemCacheRequest added in v0.14.6

type CreateFileSystemCacheRequest struct {
	Username            string                 `json:"username"`
	FsName              string                 `json:"fsName"`
	FsID                string                 `json:"-"`
	CacheDir            string                 `json:"cacheDir"`
	Quota               int                    `json:"quota"`
	MetaDriver          string                 `json:"metaDriver"`
	BlockSize           int                    `json:"blockSize"`
	Debug               bool                   `json:"debug"`
	CleanCache          bool                   `json:"cleanCache"`
	Resource            model.ResourceLimit    `json:"resource"`
	NodeTaintToleration map[string]interface{} `json:"nodeTaintToleration"`
	ExtraConfig         map[string]string      `json:"extraConfig"`
}

type CreateFileSystemRequest added in v0.14.3

type CreateFileSystemRequest struct {
	Name       string            `json:"name"`
	Url        string            `json:"url"`
	Properties map[string]string `json:"properties"`
	Username   string            `json:"username"`
}

type CreateFileSystemResponse added in v0.14.3

type CreateFileSystemResponse struct {
	FsName string `json:"fsName"`
	FsID   string `json:"fsID"`
}

type CreateFlavourRequest added in v0.14.3

type CreateFlavourRequest struct {
	Name            string                     `json:"name"`
	CPU             string                     `json:"cpu"`
	Mem             string                     `json:"mem"`
	ScalarResources schema.ScalarResourcesType `json:"scalarResources,omitempty"`
}

CreateFlavourRequest convey request for create flavour

type CreateFlavourResponse added in v0.14.3

type CreateFlavourResponse struct {
	FlavourName string `json:"name"`
}

CreateFlavourResponse convey response for create flavour

type CreateJobResponse added in v0.14.3

type CreateJobResponse struct {
	ID string `json:"id"`
}

CreateJobResponse convey response for create job

type CreatePipelineRequest added in v0.14.4

type CreatePipelineRequest struct {
	FsName   string `json:"fsName"`
	YamlRaw  string `json:"yamlRaw"`  // optional, one of 2 sources of run
	YamlPath string `json:"yamlPath"` // optional, use "./run.yaml" if not specified
	UserName string `json:"username"` // optional, only for root user
	Desc     string `json:"desc"`     // optional
}

Pilepline

type CreatePipelineResponse added in v0.14.4

type CreatePipelineResponse struct {
	PipelineID        string `json:"pipelineID"`
	PipelineVersionID string `json:"pipelineVersionID"`
	Name              string `json:"name"`
}

type CreateQueueRequest added in v0.14.3

type CreateQueueRequest struct {
	Name         string              `json:"name"`
	Namespace    string              `json:"namespace"`
	ClusterName  string              `json:"clusterName"`
	QuotaType    string              `json:"quotaType"`
	MaxResources schema.ResourceInfo `json:"maxResources"`
	MinResources schema.ResourceInfo `json:"minResources"`
	Location     map[string]string   `json:"location"`
	// 任务调度策略
	SchedulingPolicy []string `json:"schedulingPolicy,omitempty"`
	Status           string   `json:"-"`
}

type CreateQueueResponse added in v0.14.3

type CreateQueueResponse struct {
	QueueName string `json:"name"`
}

type CreateRunRequest added in v0.14.4

type CreateRunRequest struct {
	FsName         string                 `json:"fsName"`
	UserName       string                 `json:"username,omitempty"`       // optional, only for root user
	Name           string                 `json:"name,omitempty"`           // optional
	Description    string                 `json:"desc,omitempty"`           // optional
	Parameters     map[string]interface{} `json:"parameters,omitempty"`     // optional
	DockerEnv      string                 `json:"dockerEnv,omitempty"`      // optional
	Disabled       string                 `json:"disabled,omitempty"`       // optional
	FailureOptions *schema.FailureOptions `json:"failureOptions,omitempty"` // optional
	// run workflow source. priority: RunYamlRaw > PipelineID + PipelineVersionID > RunYamlPath
	// 为了防止字符串或者不同的http客户端对run.yaml
	// 格式中的特殊字符串做特殊过滤处理导致yaml文件不正确,因此采用runYamlRaw采用base64编码传输
	RunYamlRaw        string `json:"runYamlRaw,omitempty"`        // optional. one of 3 sources of run. high priority
	PipelineID        string `json:"pipelineID,omitempty"`        // optional. one of 3 sources of run. medium priority
	PipelineVersionID string `json:"pipelineVersionID,omitempty"` // optional. one of 3 sources of run. medium priority
	RunYamlPath       string `json:"runYamlPath,omitempty"`       // optional. one of 3 sources of run. low priority
}

type CreateRunResponse added in v0.14.4

type CreateRunResponse struct {
	RunID string `json:"runID"`
}

type CreateScheduleRequest added in v0.14.4

type CreateScheduleRequest struct {
	Name              string `json:"name"`
	Desc              string `json:"desc"` // optional
	PipelineID        string `json:"pipelineID"`
	PipelineVersionID string `json:"pipelineVersionID"`
	Crontab           string `json:"crontab"`
	StartTime         string `json:"startTime"`         // optional
	EndTime           string `json:"endTime"`           // optional
	Concurrency       int    `json:"concurrency"`       // optional, 默认 0, 表示不限制
	ConcurrencyPolicy string `json:"concurrencyPolicy"` // optional, 默认 suspend
	ExpireInterval    int    `json:"expireInterval"`    // optional, 默认 0, 表示不限制
	Catchup           bool   `json:"catchup"`           // optional, 默认 false
	UserName          string `json:"username"`          // optional, 只有root用户使用其他用户fsname时,需要指定对应username
}

type CreateScheduleResponse added in v0.14.4

type CreateScheduleResponse struct {
	ScheduleID string `json:"scheduleID"`
}

type CreateSingleJobRequest added in v0.14.3

type CreateSingleJobRequest struct {
	CommonJobInfo `json:",inline"`
	JobSpec       `json:",inline"`
}

CreateSingleJobRequest convey request for create job

type CreateWfJobRequest added in v0.14.3

type CreateWfJobRequest struct {
	CommonJobInfo     `json:",inline"`
	Framework         schema.Framework       `json:"framework"`
	Members           []MemberSpec           `json:"members"`
	ExtensionTemplate map[string]interface{} `json:"extensionTemplate"`
}

CreateWfJobRequest convey request for create workflow job

type DeleteFileSystemCacheRequest added in v0.14.6

type DeleteFileSystemCacheRequest struct {
	FsName   string `json:"fsName"`
	Username string `json:"username"`
}

type DeleteFileSystemRequest added in v0.14.3

type DeleteFileSystemRequest struct {
	FsName   string `json:"fsName"`
	Username string `json:"username"`
}

type DeleteRunRequest added in v0.14.4

type DeleteRunRequest struct {
	CheckCache bool `json:"checkCache"`
}

type DistributedJobSpec added in v0.14.3

type DistributedJobSpec struct {
	Framework schema.Framework `json:"framework,omitempty"`
	Members   []Member         `json:"members,omitempty"`
}

type DistributedRuntimeInfo added in v0.14.3

type DistributedRuntimeInfo struct {
	Name      string        `json:"name,omitempty"`
	Namespace string        `json:"namespace,omitempty"`
	ID        string        `json:"id,omitempty"`
	Status    string        `json:"status,omitempty"`
	Runtimes  []RuntimeInfo `json:"runtimes,omitempty"`
}

type FileSystemCacheGetter added in v0.14.6

type FileSystemCacheGetter interface {
	FileSystemCache() FileSystemCacheInterface
}

type FileSystemCacheInterface added in v0.14.6

type FileSystemCacheInterface interface {
	Create(ctx context.Context, request *CreateFileSystemCacheRequest, token string) error
	Get(ctx context.Context, request *GetFileSystemCacheRequest, token string) (*GetFileSystemCacheResponse, error)
	Delete(ctx context.Context, request *DeleteFileSystemCacheRequest, token string) error
}

type FileSystemGetter

type FileSystemGetter interface {
	FileSystem() FileSystemInterface
}

type FileSystemInterface

type FileSystemInterface interface {
	Create(ctx context.Context, request *CreateFileSystemRequest, token string) (*CreateFileSystemResponse, error)
	Get(ctx context.Context, request *GetFileSystemRequest, token string) (*GetFileSystemResponse, error)
	Delete(ctx context.Context, request *DeleteFileSystemRequest, token string) error
	Sts(ctx context.Context, request *GetStsRequest, token string) (*GetStsResponse, error)
}

type Flavour added in v0.14.3

type Flavour struct {
	ID                 string                     `json:"id"`
	CreatedAt          time.Time                  `json:"-"`
	UpdatedAt          time.Time                  `json:"-"`
	Pk                 int64                      `json:"-"           gorm:"primaryKey;autoIncrement"`
	Name               string                     `json:"name"        gorm:"uniqueIndex"`
	ClusterID          string                     `json:"-" gorm:"column:cluster_id;default:''"`
	ClusterName        string                     `json:"-" gorm:"column:cluster_name;->"`
	CPU                string                     `json:"cpu"         gorm:"column:cpu"`
	Mem                string                     `json:"mem"         gorm:"column:mem"`
	RawScalarResources string                     `json:"-"           gorm:"column:scalar_resources;type:text;default:'{}'"`
	ScalarResources    schema.ScalarResourcesType `json:"scalarResources" gorm:"-"`
	UserName           string                     `json:"-" gorm:"column:user_name"`
	DeletedAt          gorm.DeletedAt             `json:"-" gorm:"index"`
}

type FlavourGetter added in v0.14.3

type FlavourGetter interface {
	Flavour() FlavourInterface
}

type FlavourInterface added in v0.14.3

type FlavourInterface interface {
	Create(ctx context.Context, request *CreateFlavourRequest, token string) (*CreateFlavourResponse, error)
	Update(ctx context.Context, request *UpdateFlavourRequest, token string) (*UpdateFlavourResponse, error)
	Get(ctx context.Context, name string, token string) (*Flavour, error)
	List(ctx context.Context, request *ListFlavourRequest, token string) (*ListFlavourResponse, error)
	Delete(ctx context.Context, name string, token string) error
}

type FsConfig added in v0.14.4

type FsConfig struct {
	Username string `json:"username"`
}

type GetClusterResponse added in v0.14.3

type GetClusterResponse struct {
	ClusterInfo
}

type GetFileSystemCacheRequest added in v0.14.6

type GetFileSystemCacheRequest struct {
	FsName   string `json:"fsName"`
	Username string `json:"username"`
}

type GetFileSystemCacheResponse added in v0.14.6

type GetFileSystemCacheResponse struct {
	CacheDir            string                 `json:"cacheDir"`
	Quota               int                    `json:"quota"`
	MetaDriver          string                 `json:"metaDriver"`
	BlockSize           int                    `json:"blockSize"`
	CleanCache          bool                   `json:"cleanCache"`
	Resource            model.ResourceLimit    `json:"resource"`
	NodeTaintToleration map[string]interface{} `json:"nodeTaintToleration"`
	ExtraConfig         map[string]string      `json:"extraConfig"`
	FsName              string                 `json:"fsName"`
	Username            string                 `json:"username"`
	CreateTime          string                 `json:"createTime"`
	UpdateTime          string                 `json:"updateTime,omitempty"`
}

type GetFileSystemRequest added in v0.14.3

type GetFileSystemRequest struct {
	FsName   string `json:"fsName"`
	Username string `json:"username"`
}

type GetFileSystemResponse added in v0.14.3

type GetFileSystemResponse struct {
	Id            string            `json:"id"`
	Name          string            `json:"name"`
	ServerAddress string            `json:"serverAddress"`
	Type          string            `json:"type"`
	SubPath       string            `json:"subPath"`
	Username      string            `json:"username"`
	Properties    map[string]string `json:"properties"`
}

type GetJobResponse added in v0.14.3

type GetJobResponse struct {
	CreateSingleJobRequest `json:",inline"`
	DistributedJobSpec     `json:",inline"`
	Status                 string                  `json:"status"`
	Message                string                  `json:"message"`
	AcceptTime             string                  `json:"acceptTime"`
	StartTime              string                  `json:"startTime"`
	FinishTime             string                  `json:"finishTime"`
	Runtime                *RuntimeInfo            `json:"runtime,omitempty"`
	DistributedRuntime     *DistributedRuntimeInfo `json:"distributedRuntime,omitempty"`
	WorkflowRuntime        *WorkflowRuntimeInfo    `json:"workflowRuntime,omitempty"`
	UpdateTime             time.Time               `json:"-"`
}

type GetPipelineRequest added in v0.14.4

type GetPipelineRequest struct {
	PipelineID string
	FsFilter   []string
	Marker     string
	MaxKeys    int
}

type GetPipelineResponse added in v0.14.4

type GetPipelineResponse struct {
	Pipeline         PipelineBrief    `json:"pipeline"`
	PipelineVersions PipelineVersions `json:"pplVersions"`
}

type GetPipelineVersionResponse added in v0.14.4

type GetPipelineVersionResponse struct {
	Pipeline        PipelineBrief        `json:"pipeline"`
	PipelineVersion PipelineVersionBrief `json:"pipelineVersion"`
}

type GetQueueResponse added in v0.14.3

type GetQueueResponse struct {
	Queue
}

type GetRunCacheResponse added in v0.14.4

type GetRunCacheResponse struct {
	RunCacheBrief
}

type GetRunResponse added in v0.14.4

type GetRunResponse struct {
	ID             string                 `json:"runID"`
	Name           string                 `json:"name"`
	Source         string                 `json:"source"` // pipelineID or yamlPath
	UserName       string                 `json:"username"`
	FsName         string                 `json:"fsname"`
	FsOptions      schema.FsOptions       `json:"fsOptions"`
	Description    string                 `json:"description"`
	Parameters     map[string]interface{} `json:"parameters"`
	RunYaml        string                 `json:"runYaml"`
	Runtime        schema.RuntimeView     `json:"runtime"`
	PostProcess    schema.PostProcessView `json:"postProcess"`
	FailureOptions schema.FailureOptions  `json:"failureOptions"`
	DockerEnv      string                 `json:"dockerEnv"`
	Entry          string                 `json:"entry"`
	Disabled       string                 `json:"disabled"`
	ScheduleID     string                 `json:"scheduleID"`
	Message        string                 `json:"runMsg"`
	Status         string                 `json:"status"` // StatusRun%%%
	RunCachedIDs   string                 `json:"runCachedIDs"`
	CreateTime     string                 `json:"createTime"`
	ActivateTime   string                 `json:"activateTime"`
	UpdateTime     string                 `json:"updateTime,omitempty"`
}

func (*GetRunResponse) GetEndTime added in v0.14.5

func (r *GetRunResponse) GetEndTime() string

func (*GetRunResponse) GetStartTime added in v0.14.5

func (r *GetRunResponse) GetStartTime() string

type GetScheduleRequest added in v0.14.4

type GetScheduleRequest struct {
	ScheduleID   string
	RunFilter    []string
	StatusFilter []string
	Marker       string
	MaxKeys      int
}

type GetScheduleResponse added in v0.14.4

type GetScheduleResponse struct {
	ScheduleBrief
	ListRunResponse ListRunResponse `json:"runs"`
}

type GetStsRequest added in v0.14.6

type GetStsRequest struct {
	FsName   string `json:"fsName"`
	Username string `json:"username"`
}

type GetStsResponse added in v0.14.6

type GetStsResponse struct {
	AccessKeyId     string `json:"accessKey"`
	SecretAccessKey string `json:"secretKey"`
	SessionToken    string `json:"sessionToken"`
	Bucket          string `json:"bucket"`
	SubPath         string `json:"subPath"`
	Endpoint        string `json:"endpoint"`
	Region          string `json:"region"`
	CreateTime      string `json:"createTime"`
	Expiration      string `json:"expiration"`
	UserId          string `json:"userId"`
	Duration        int    `json:"duration"`
}

type JobGetter

type JobGetter interface {
	Job() JobInterface
}

type JobInterface

type JobInterface interface {
	Create(ctx context.Context, single *CreateSingleJobRequest, distributed *CreateDisJobRequest,
		wf *CreateWfJobRequest, token string) (*CreateJobResponse, error)
	Get(ctx context.Context, jobID string, token string) (*GetJobResponse, error)
	List(ctx context.Context, request *ListJobRequest, token string) (*ListJobResponse, error)
	Update(ctx context.Context, jobID string, request *UpdateJobRequest, token string) error
	Stop(ctx context.Context, jobID string, token string) error
	Delete(ctx context.Context, jobID string, token string) error
}

type JobSpec added in v0.14.3

type JobSpec struct {
	Flavour           schema.Flavour         `json:"flavour"`
	FS                schema.FileSystem      `json:"fs"`
	ExtraFS           []schema.FileSystem    `json:"extraFS"`
	Image             string                 `json:"image"`
	Env               map[string]string      `json:"env"`
	Command           string                 `json:"command"`
	Args              []string               `json:"args"`
	Port              int                    `json:"port"`
	ExtensionTemplate map[string]interface{} `json:"extensionTemplate"`
}

JobSpec the spec fields for jobs

type ListArtifactRequest added in v0.14.4

type ListArtifactRequest struct {
	UserFilter []string
	FSFilter   []string
	RunFilter  []string
	TypeFilter []string
	PathFilter []string
	MaxKeys    int
	Marker     string
}

type ListArtifactResponse added in v0.14.4

type ListArtifactResponse struct {
	common.MarkerInfo
	ArtifactEventList []ArtifactEventBrief `json:"artifactEventList"`
}

type ListClusterRequest added in v0.14.3

type ListClusterRequest struct {
	Marker          string   `json:"marker"`
	MaxKeys         int      `json:"maxKeys"`
	ClusterNameList []string `json:"clusterNameList"`
	ClusterStatus   string   `json:"clusterStatus"`
}

type ListClusterResponse added in v0.14.3

type ListClusterResponse struct {
	common.MarkerInfo
	ClusterList []ClusterInfo `json:"clusterList"`
}

type ListFlavourRequest added in v0.14.3

type ListFlavourRequest struct {
	ClusterName string `json:"clusterName,omitempty"`
	Name        string `json:"name"`
	Marker      string `json:"marker"`
	MaxKeys     int    `json:"maxKeys"`
}

type ListFlavourResponse added in v0.14.3

type ListFlavourResponse struct {
	common.MarkerInfo
	FlavourList []Flavour `json:"flavourList"`
}

ListFlavourResponse convey response for list flavour

type ListJobRequest added in v0.14.3

type ListJobRequest struct {
	Queue     string            `json:"queue,omitempty"`
	Status    string            `json:"status,omitempty"`
	Timestamp int64             `json:"timestamp,omitempty"`
	StartTime string            `json:"startTime,omitempty"`
	Labels    map[string]string `json:"labels,omitempty"`
	Marker    string            `json:"marker"`
	MaxKeys   int               `json:"maxKeys"`
}

type ListJobResponse added in v0.14.3

type ListJobResponse struct {
	common.MarkerInfo
	JobList []*GetJobResponse `json:"jobList"`
}

type ListPipelineRequest added in v0.14.4

type ListPipelineRequest struct {
	Marker     string
	MaxKeys    int
	UserFilter []string
	NameFilter []string
}

type ListPipelineResponse added in v0.14.4

type ListPipelineResponse struct {
	common.MarkerInfo
	PipelineList []PipelineBrief `json:"pipelineList"`
}

type ListQueueRequest added in v0.14.3

type ListQueueRequest struct {
	Marker    string
	MaxKeys   int
	QueueName string
}

type ListQueueResponse added in v0.14.3

type ListQueueResponse struct {
	common.MarkerInfo
	QueueList []Queue `json:"queueList"`
}

type ListRunCacheRequest added in v0.14.4

type ListRunCacheRequest struct {
	UserFilter []string
	FSFilter   []string
	RunFilter  []string
	MaxKeys    int
	Marker     string
}

type ListRunCacheResponse added in v0.14.4

type ListRunCacheResponse struct {
	common.MarkerInfo
	RunCacheList []RunCacheBrief `json:"runCacheList"`
}

type ListRunRequest added in v0.14.4

type ListRunRequest struct {
	Marker           string
	MaxKeys          int
	UserFilter       []string
	FsFilter         []string
	RunFilter        []string
	NameFilter       []string
	StatusFilter     []string
	ScheduleIDFilter []string
}

type ListRunResponse added in v0.14.4

type ListRunResponse struct {
	common.MarkerInfo
	RunList []RunBrief `json:"runList"`
}

type ListScheduleRequest added in v0.14.4

type ListScheduleRequest struct {
	UserFilter       []string
	PplFilter        []string
	PplVersionFilter []string
	ScheduleFilter   []string
	NameFilter       []string
	StatusFilter     []string
	Marker           string
	MaxKeys          int
}

type ListScheduleResponse added in v0.14.4

type ListScheduleResponse struct {
	common.MarkerInfo
	ScheduleList []ScheduleBrief `json:"scheduleList"`
}

type LoginInfo added in v0.14.3

type LoginInfo struct {
	UserName string `json:"username"`
	Password string `json:"password"`
}

type LoginResponse added in v0.14.3

type LoginResponse struct {
	Authorization string `json:"authorization"`
}

type Member added in v0.14.3

type Member struct {
	ID          string            `json:"id"`
	Replicas    int               `json:"replicas"`
	Role        schema.MemberRole `json:"role"`
	schema.Conf `json:",inline"`
}

type MemberSpec added in v0.14.3

type MemberSpec struct {
	CommonJobInfo `json:",inline"`
	JobSpec       `json:",inline"`
	Role          string `json:"role"`
	Replicas      int    `json:"replicas"`
}

type PipelineBrief added in v0.14.4

type PipelineBrief struct {
	ID         string `json:"pipelineID"`
	Name       string `json:"name"`
	Desc       string `json:"desc"`
	UserName   string `json:"username"`
	CreateTime string `json:"createTime"`
	UpdateTime string `json:"updateTime"`
}

type PipelineGetter added in v0.14.4

type PipelineGetter interface {
	Pipeline() PipelineInterface
}

type PipelineInterface added in v0.14.4

type PipelineInterface interface {
	Create(ctx context.Context, request *CreatePipelineRequest, token string) (result *CreatePipelineResponse, err error)
	Get(ctx context.Context, request *GetPipelineRequest, token string) (result *GetPipelineResponse, err error)
	List(ctx context.Context, request *ListPipelineRequest, token string) (result *ListPipelineResponse, err error)
	Delete(ctx context.Context, pipelineID, token string) (err error)
	Update(ctx context.Context, pipelineID string, request *UpdatePipelineRequest, token string) (result *UpdatePipelineResponse, err error)
	GetVersion(ctx context.Context, pipelineID, pipelineVersionID, token string) (result *GetPipelineVersionResponse, err error)
	DeleteVersion(ctx context.Context, pipelineID, pipelineVersionID, token string) (err error)
}

type PipelineVersionBrief added in v0.14.4

type PipelineVersionBrief struct {
	ID           string `json:"pipelineVersionID"`
	PipelineID   string `json:"pipelineID"`
	FsName       string `json:"fsName"`
	YamlPath     string `json:"yamlPath"`
	PipelineYaml string `json:"pipelineYaml"`
	UserName     string `json:"username"`
	CreateTime   string `json:"createTime"`
	UpdateTime   string `json:"updateTime"`
}

type PipelineVersions added in v0.14.4

type PipelineVersions struct {
	common.MarkerInfo
	PipelineVersionList []PipelineVersionBrief `json:"pplVersionList"`
}

type Queue added in v0.14.3

type Queue struct {
	ID              string              `json:"id"`
	CreatedAt       time.Time           `json:"-"`
	UpdatedAt       time.Time           `json:"-"`
	Name            string              `json:"name"`
	Namespace       string              `json:"namespace"`
	ClusterId       string              `json:"-"`
	ClusterName     string              `json:"clusterName"`
	QuotaType       string              `json:"quotaType"`
	RawMinResources string              `json:"-"`
	MinResources    schema.ResourceInfo `json:"minResources"`
	RawMaxResources string              `json:"-"`
	MaxResources    schema.ResourceInfo `json:"maxResources"`
	RawLocation     string              `json:"-"`
	Location        map[string]string   `json:"location"`
	// 任务调度策略
	RawSchedulingPolicy string   `json:"-"`
	SchedulingPolicy    []string `json:"schedulingPolicy,omitempty"`
	Status              string   `json:"status"`
}

type QueueGetter

type QueueGetter interface {
	Queue() QueueInterface
}

type QueueInterface

type QueueInterface interface {
	Create(ctx context.Context, request *CreateQueueRequest, token string) (*CreateQueueResponse, error)
	Get(ctx context.Context, queueName string, token string) (*GetQueueResponse, error)
	List(ctx context.Context, request *ListQueueRequest, token string) (*ListQueueResponse, error)
	Update(ctx context.Context, queueName string, request *UpdateQueueRequest, token string) (*UpdateQueueResponse, error)
	Delete(ctx context.Context, queueName string, token string) error
}

type RetryRunResponse added in v0.14.4

type RetryRunResponse struct {
	RunID string `json:"runID"`
}

type RunBrief added in v0.14.4

type RunBrief struct {
	ID            string `json:"runID"`
	Name          string `json:"name"`
	Source        string `json:"source"` // pipelineID or yamlPath
	UserName      string `json:"username"`
	FsName        string `json:"fsName"`
	Description   string `json:"description"`
	ScheduleID    string `json:"scheduleID"`
	Message       string `json:"runMsg"`
	Status        string `json:"status"`
	ScheduledTime string `json:"scheduledTime"`
	CreateTime    string `json:"createTime"`
	ActivateTime  string `json:"activateTime"`
	UpdateTime    string `json:"updateTime"`
}

type RunCacheBrief added in v0.14.4

type RunCacheBrief struct {
	ID          string `json:"cacheID"`
	FirstFp     string `json:"firstFp"`
	SecondFp    string `json:"secondFp"`
	RunID       string `json:"runID"`
	Source      string `json:"source"`
	JobID       string `json:"jobID"`
	FsName      string `json:"fsname"`
	UserName    string `json:"username"`
	ExpiredTime string `json:"expiredTime"`
	Strategy    string `json:"strategy"`
	Custom      string `json:"custom"`
	CreateTime  string `json:"createTime"`
	UpdateTime  string `json:"updateTime,omitempty"`
}

type RunGetter added in v0.14.4

type RunGetter interface {
	Run() RunInterface
}

type RunInterface added in v0.14.4

type RunInterface interface {
	Create(ctx context.Context, request *CreateRunRequest, token string) (result *CreateRunResponse, err error)
	Get(ctx context.Context, runID string, token string) (result *GetRunResponse, err error)
	List(ctx context.Context, request *ListRunRequest, token string) (result *ListRunResponse, err error)
	Stop(ctx context.Context, StopForce bool, runID, token string) (err error)
	Retry(ctx context.Context, runID string, token string) (result *RetryRunResponse, err error)
	Delete(ctx context.Context, runID string, token string) (err error)

	ListRunCache(ctx context.Context, request *ListRunCacheRequest, token string) (result *ListRunCacheResponse, err error)
	GetRunCache(ctx context.Context, runCacheID string, token string) (result *GetRunCacheResponse, err error)
	DeleteRunCache(ctx context.Context, runCacheID string, token string) (err error)

	ListArtifact(ctx context.Context, request *ListArtifactRequest, token string) (result *ListArtifactResponse, err error)
}

type RuntimeInfo added in v0.14.3

type RuntimeInfo struct {
	Name      string `json:"name,omitempty"`
	Namespace string `json:"namespace,omitempty"`
	ID        string `json:"id,omitempty"`
	Status    string `json:"status,omitempty"`
}

type ScheduleBrief added in v0.14.4

type ScheduleBrief struct {
	ID                string          `json:"scheduleID"`
	Name              string          `json:"name"`
	Desc              string          `json:"desc"`
	PipelineID        string          `json:"pipelineID"`
	PipelineVersionID string          `json:"pipelineVersionID"`
	UserName          string          `json:"username"`
	FsConfig          FsConfig        `json:"fsConfig"`
	Crontab           string          `json:"crontab"`
	Options           ScheduleOptions `json:"options"`
	StartTime         string          `json:"startTime"`
	EndTime           string          `json:"endTime"`
	CreateTime        string          `json:"createTime"`
	UpdateTime        string          `json:"updateTime"`
	NextRunTime       string          `json:"nextRunTime"`
	Message           string          `json:"scheduleMsg"`
	Status            string          `json:"status"`
}

type ScheduleGetter added in v0.14.4

type ScheduleGetter interface {
	Schedule() ScheduleInterface
}

type ScheduleInterface added in v0.14.4

type ScheduleInterface interface {
	Create(ctx context.Context, request *CreateScheduleRequest, token string) (result *CreateScheduleResponse, err error)
	Get(ctx context.Context, request *GetScheduleRequest, token string) (result *GetScheduleResponse, err error)
	List(ctx context.Context, request *ListScheduleRequest, token string) (result *ListScheduleResponse, err error)
	Stop(ctx context.Context, scheduleID string, token string) (err error)
	Delete(ctx context.Context, scheduleID string, token string) (err error)
}

type ScheduleOptions added in v0.14.4

type ScheduleOptions struct {
	Catchup           bool   `json:"catchup"`
	ExpireInterval    int    `json:"expireInterval"`
	Concurrency       int    `json:"concurrency"`
	ConcurrencyPolicy string `json:"concurrencyPolicy"`
}

type SchedulingPolicy added in v0.14.3

type SchedulingPolicy struct {
	Queue    string `json:"queue"`
	QueueID  string `json:"-"`
	Priority string `json:"priority,omitempty"`
}

SchedulingPolicy indicate queueID/priority

type StopRequest added in v0.14.4

type StopRequest struct {
	StopForce bool `json:"stopForce"`
}

type UpdateClusterRequest added in v0.14.3

type UpdateClusterRequest struct {
	ClusterCommonInfo
}

type UpdateClusterResponse added in v0.14.3

type UpdateClusterResponse struct {
	ClusterInfo
}

type UpdateFlavourRequest added in v0.14.3

type UpdateFlavourRequest struct {
	Name            string                     `json:"-"`
	CPU             string                     `json:"cpu,omitempty"`
	Mem             string                     `json:"mem,omitempty"`
	ScalarResources schema.ScalarResourcesType `json:"scalarResources,omitempty"`
}

UpdateFlavourRequest convey request for update flavour

type UpdateFlavourResponse added in v0.14.3

type UpdateFlavourResponse struct {
	Flavour
}

UpdateFlavourResponse convey response for update flavour

type UpdateJobRequest added in v0.14.3

type UpdateJobRequest struct {
	JobID       string            `json:"-"`
	Priority    string            `json:"priority"`
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
}

type UpdatePipelineRequest added in v0.14.4

type UpdatePipelineRequest = CreatePipelineRequest

type UpdatePipelineResponse added in v0.14.4

type UpdatePipelineResponse struct {
	PipelineID        string `json:"pipelineID"`
	PipelineVersionID string `json:"pipelineVersionID"`
}

type UpdateQueueRequest added in v0.14.3

type UpdateQueueRequest struct {
	Name         string              `json:"-"`
	Namespace    string              `json:"-"`
	ClusterName  string              `json:"-"`
	QuotaType    string              `json:"-"`
	MaxResources schema.ResourceInfo `json:"maxResources,omitempty"`
	MinResources schema.ResourceInfo `json:"minResources,omitempty"`
	Location     map[string]string   `json:"location,omitempty"`
	// 任务调度策略
	SchedulingPolicy []string `json:"schedulingPolicy,omitempty"`
	Status           string   `json:"-"`
}

type UpdateQueueResponse added in v0.14.3

type UpdateQueueResponse struct {
	Queue
}

type UpdateRunRequest added in v0.14.4

type UpdateRunRequest struct {
	StopForce bool `json:"stopForce"`
}

type UserGetter

type UserGetter interface {
	User() UserInterface
}

type UserInterface

type UserInterface interface {
	Login(ctx context.Context, request *LoginInfo) (*LoginResponse, error)
}

type WorkflowRuntimeInfo added in v0.14.3

type WorkflowRuntimeInfo struct {
	Name      string                   `json:"name,omitempty"`
	Namespace string                   `json:"namespace,omitempty"`
	ID        string                   `json:"id,omitempty"`
	Status    string                   `json:"status,omitempty"`
	Nodes     []DistributedRuntimeInfo `json:"nodes,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL