Documentation ¶
Index ¶
- Constants
- type Config
- type Plugin
- func (p Plugin) Create(ctx context.Context, tCtx webapi.TaskExecutionContextReader) (resourceMeta webapi.ResourceMeta, resource webapi.Resource, err error)
- func (p Plugin) Delete(ctx context.Context, tCtx webapi.DeleteContext) error
- func (p Plugin) Get(ctx context.Context, tCtx 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, tCtx webapi.StatusContext) (phase core.PhaseInfo, err error)
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Contains the default configs needed for the webapi base implementation. WebAPI webapi.PluginConfig `json:"webApi" pflag:",Defines config for the base WebAPI plugin."` ResourceConstraints core.ResourceConstraintsSpec `` /* 141-byte string literal not displayed */ }
The config object for this plugin.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (Plugin) Create ¶
func (p Plugin) Create(ctx context.Context, tCtx webapi.TaskExecutionContextReader) (resourceMeta webapi.ResourceMeta, resource webapi.Resource, err error)
func (Plugin) Delete ¶
Delete the object in the remote service using the resource key. Flyte will call this API at least once. If the resource has already been deleted, the API should not fail.
func (Plugin) Get ¶
func (p Plugin) Get(ctx context.Context, tCtx webapi.GetContext) (latest webapi.Resource, err error)
Get the resource that matches the keys. If the plugin hits any failure, it should stop and return the failure. This API will be called asynchronously and periodically to update the set of tasks currently in progress. It's acceptable if this API is blocking since it'll be called from a background go-routine. Best practices:
- Instead of returning the entire response object retrieved from the WebAPI, construct a smaller object that has enough information to construct the status/phase, error and/or output.
- This object will NOT be serialized/marshaled. It's, therefore, not a requirement to make it so.
- There is already client-side throttling in place. If the WebAPI returns a throttling error, you should return it as is so that the appropriate metrics are updated and the system administrator can update throttling params accordingly.
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)
func (Plugin) Status ¶
func (p Plugin) Status(ctx context.Context, tCtx webapi.StatusContext) (phase core.PhaseInfo, err error)
Status checks the status of a given resource and translates it to a Flyte-understandable PhaseInfo. This API should avoid making any network calls and should run very efficiently.