Documentation
¶
Index ¶
- Constants
- func CreateRemotePlugin(pluginEntry webapi.PluginEntry) core.PluginEntry
- func ToPluginPhase(s core.Phase) (webapi.Phase, error)
- type CacheItem
- type Client
- type CorePlugin
- func (c CorePlugin) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error
- func (c CorePlugin) Finalize(ctx context.Context, tCtx core.TaskExecutionContext) error
- func (c CorePlugin) GetID() string
- func (c CorePlugin) GetProperties() core.PluginProperties
- func (c CorePlugin) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (core.Transition, error)
- type Metrics
- type ResourceCache
Constants ¶
View Source
const (
BadReturnCodeError stdErrors.ErrorCode = "RETURNED_UNKNOWN"
)
Variables ¶
This section is empty.
Functions ¶
func CreateRemotePlugin ¶
func CreateRemotePlugin(pluginEntry webapi.PluginEntry) core.PluginEntry
Types ¶
type Client ¶
type Client interface {
// Get multiple resources that match all the keys. If the plugin hits any failure, it should stop and return
// the failure. This batch will not be processed further.
Get(ctx context.Context, tCtx webapi.GetContext) (latest webapi.Resource, 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.
Status(ctx context.Context, tCtx webapi.StatusContext) (phase core.PhaseInfo, err error)
}
Client interface needed for resource cache to fetch latest updates for resources.
type CorePlugin ¶
type CorePlugin struct {
// contains filtered or unexported fields
}
func (CorePlugin) Abort ¶
func (c CorePlugin) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error
func (CorePlugin) Finalize ¶
func (c CorePlugin) Finalize(ctx context.Context, tCtx core.TaskExecutionContext) error
func (CorePlugin) GetID ¶
func (c CorePlugin) GetID() string
func (CorePlugin) GetProperties ¶
func (c CorePlugin) GetProperties() core.PluginProperties
func (CorePlugin) Handle ¶
func (c CorePlugin) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (core.Transition, error)
type Metrics ¶
type Metrics struct {
Scope promutils.Scope
ResourceReleased labeled.Counter
ResourceReleaseFailed labeled.Counter
AllocationGranted labeled.Counter
AllocationNotGranted labeled.Counter
ResourceWaitTime prometheus.Summary
SucceededUnmarshalState labeled.StopWatch
FailedUnmarshalState labeled.Counter
}
type ResourceCache ¶
type ResourceCache struct {
// AutoRefresh
autorefreshcache.AutoRefresh
// contains filtered or unexported fields
}
A generic AutoRefresh cache that uses a client to fetch items' status.
func NewResourceCache ¶
func NewResourceCache(ctx context.Context, name string, client Client, cfg webapi.CachingConfig, rateCfg webapi.RateLimiterConfig, scope promutils.Scope) (ResourceCache, error)
func (*ResourceCache) SyncResource ¶
func (q *ResourceCache) SyncResource(ctx context.Context, batch autorefreshcache.Batch) ( updatedBatch []autorefreshcache.ItemSyncResponse, err error)
This basically grab an updated status from Client and store it in the cache All other handling should be in the synchronous loop.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.