Documentation
¶
Index ¶
- Constants
- func RegisterConnectorPlugin(connectorService *ConnectorService)
- func SetConfig(cfg *Config) error
- type ClientSet
- type Config
- type Connector
- type ConnectorService
- type Deployment
- type Plugin
- func (p *Plugin) Create(ctx context.Context, taskCtx webapi.TaskExecutionContextReader) (webapi.ResourceMeta, webapi.Resource, error)
- func (p *Plugin) Delete(ctx context.Context, taskCtx webapi.DeleteContext) error
- func (p *Plugin) Get(ctx context.Context, taskCtx webapi.GetContext) (latest webapi.Resource, err error)
- func (p *Plugin) GetConfig() webapi.PluginConfig
- func (p *Plugin) ResourceRequirements(_ context.Context, _ webapi.TaskExecutionContextReader) (namespace core.ResourceNamespace, constraints core.ResourceConstraintsSpec, ...)
- func (p *Plugin) Status(ctx context.Context, taskCtx webapi.StatusContext) (phase core.PhaseInfo, err error)
- type Registry
- type RegistryKey
- type ResourceMetaWrapper
- type ResourceWrapper
Constants ¶
View Source
const ID = "connector-service"
Variables ¶
This section is empty.
Functions ¶
func RegisterConnectorPlugin ¶
func RegisterConnectorPlugin(connectorService *ConnectorService)
Types ¶
type ClientSet ¶
type ClientSet struct {
// contains filtered or unexported fields
}
ClientSet contains the clients exposed to communicate with various connector services.
type Config ¶
type Config struct {
// WebAPI defines config for the base WebAPI plugin
WebAPI webapi.PluginConfig `json:"webApi,omitempty" yaml:"webApi,omitempty" pflag:",Defines config for the base WebAPI plugin."`
// ResourceConstraints defines resource constraints on how many executions to be created per project/overall at any given time
ResourceConstraints core.ResourceConstraintsSpec `` /* 188-byte string literal not displayed */
// The default connector if there does not exist a more specific matching against task types
DefaultConnector Deployment `json:"defaultConnector,omitempty" yaml:"defaultConnector,omitempty" pflag:",The default connector."`
// The connectors used to match against specific task types. {connectorDeploymentID: ConnectorDeployment}
ConnectorDeployments map[string]*Deployment `json:"connectors,omitempty" yaml:"connectors,omitempty" pflag:",The connectors."`
// The connectors deployed as connector apps. {connectorDeploymentID: ConnectorDeployment}
ConnectorApps map[string]*Deployment `json:"connectorApps,omitempty" yaml:"connectorApps,omitempty" pflag:",The connectors."`
// Maps task types to their connectors. {TaskType: connectorDeploymentID}
ConnectorForTaskTypes map[string]string `json:"connectorForTaskTypes,omitempty" yaml:"connectorForTaskTypes,omitempty" pflag:"-,"`
// SupportedTaskTypes is a list of task types that are supported by this plugin.
SupportedTaskTypes []string `` /* 145-byte string literal not displayed */
// PollInterval is the interval at which the plugin should poll the connector for metadata updates
PollInterval config.Duration `` /* 149-byte string literal not displayed */
// Connector App Logs
Logs logs.LogConfig `json:"logs,omitempty" yaml:"logs,omitempty" pflag:",Log configuration for connector tasks"`
}
Config is config for 'connector' plugin
type Connector ¶
type Connector struct {
// ConnectorDeployment is the connector deployment where this connector is running.
ConnectorDeployment *Deployment
// ConnectorID is the ID of the connector.
ConnectorID string
// IsConnectorApp indicates whether this connector is a connector app.
IsConnectorApp bool
}
type ConnectorService ¶
func (*ConnectorService) ContainTaskType ¶
func (p *ConnectorService) ContainTaskType(taskType string) bool
ContainTaskType check if connector supports this task type.
func (*ConnectorService) SetSupportedTaskType ¶
func (p *ConnectorService) SetSupportedTaskType(taskTypes []string)
SetSupportedTaskType set supportTaskType in the connector service.
type Deployment ¶
type Deployment struct {
// Endpoint points to a connector gRPC endpoint
Endpoint string `json:"endpoint"`
// Insecure indicates whether the communication with the gRPC service is insecure
Insecure bool `json:"insecure"`
// DefaultServiceConfig sets default gRPC service config; check https://github.com/grpc/grpc/blob/master/doc/service_config.md for more details
DefaultServiceConfig string `json:"defaultServiceConfig,omitempty" yaml:"defaultServiceConfig,omitempty"`
// Timeouts defines various RPC timeout values for different plugin operations: CreateTask, GetTask, DeleteTask; if not configured, defaults to DefaultTimeout
Timeouts map[string]config.Duration `json:"timeouts,omitempty" yaml:"timeouts,omitempty"`
// DefaultTimeout gives the default RPC timeout if a more specific one is not defined in Timeouts; if neither DefaultTimeout nor Timeouts is defined for an operation, RPC timeout will not be enforced
DefaultTimeout config.Duration `json:"defaultTimeout,omitempty" yaml:"defaultTimeout,omitempty"`
// The tasks in this domain will be handled by this agent
Domain string `json:"domain,omitempty" yaml:"domain,omitempty"`
}
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) Create ¶
func (p *Plugin) Create(ctx context.Context, taskCtx webapi.TaskExecutionContextReader) (webapi.ResourceMeta, webapi.Resource, error)
func (*Plugin) GetConfig ¶
func (p *Plugin) GetConfig() webapi.PluginConfig
func (*Plugin) ResourceRequirements ¶
func (p *Plugin) ResourceRequirements(_ context.Context, _ webapi.TaskExecutionContextReader) ( namespace core.ResourceNamespace, constraints core.ResourceConstraintsSpec, err error)
type Registry ¶
type Registry map[RegistryKey]*Connector
type RegistryKey ¶
type RegistryKey struct {
// contains filtered or unexported fields
}
type ResourceMetaWrapper ¶
type ResourceMetaWrapper struct {
OutputPrefix string
ConnectorResourceMeta []byte
TaskCategory connectorPb.TaskCategory
Domain string
Connection flyteIdl.Connection
}
type ResourceWrapper ¶
type ResourceWrapper struct {
Phase flyteIdl.TaskExecution_Phase
Outputs *task.Outputs
Message string
LogLinks []*flyteIdl.TaskLog
CustomInfo *structpb.Struct
ConnectorID string
IsConnectorApp bool
}
func (ResourceWrapper) IsTerminal ¶
func (r ResourceWrapper) IsTerminal() bool
IsTerminal is used to avoid making network calls to the connector service if the resource is already in a terminal state.
Click to show internal directories.
Click to hide internal directories.