Documentation ¶
Index ¶
- type BidStrategy
- type BidStrategyRequest
- type BidStrategyResponse
- type ChainedBidStrategy
- func (c *ChainedBidStrategy) AddStrategy(strategy BidStrategy)
- func (c *ChainedBidStrategy) ShouldBid(ctx context.Context, request BidStrategyRequest) (BidStrategyResponse, error)
- func (c *ChainedBidStrategy) ShouldBidBasedOnUsage(ctx context.Context, request BidStrategyRequest, usage model.ResourceUsageData) (BidStrategyResponse, error)
- type DistanceDelayStrategy
- type DistanceDelayStrategyParams
- type EnginesInstalledStrategy
- type EnginesInstalledStrategyParams
- type ExternalCommandStrategy
- type ExternalCommandStrategyParams
- type ExternalHTTPStrategy
- type ExternalHTTPStrategyParams
- type InputLocalityStrategy
- type InputLocalityStrategyParams
- type JobSelectionPolicyProbeData
- type NetworkingStrategy
- type StatelessJobStrategy
- type StatelessJobStrategyParams
- type TimeoutStrategy
- type TimeoutStrategyParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BidStrategy ¶
type BidStrategy interface { ShouldBid(ctx context.Context, request BidStrategyRequest) (BidStrategyResponse, error) ShouldBidBasedOnUsage(ctx context.Context, request BidStrategyRequest, resourceUsage model.ResourceUsageData) (BidStrategyResponse, error) }
func FromJobSelectionPolicy ¶
func FromJobSelectionPolicy(jsp model.JobSelectionPolicy) BidStrategy
Create a BidStrategy that implements the passed JobSelectionPolicy.
type BidStrategyRequest ¶
type BidStrategyResponse ¶
func NewShouldBidResponse ¶
func NewShouldBidResponse() BidStrategyResponse
type ChainedBidStrategy ¶
type ChainedBidStrategy struct {
Strategies []BidStrategy
}
func NewChainedBidStrategy ¶
func NewChainedBidStrategy(strategies ...BidStrategy) *ChainedBidStrategy
func (*ChainedBidStrategy) AddStrategy ¶
func (c *ChainedBidStrategy) AddStrategy(strategy BidStrategy)
AddStrategy Add new strategy to the end of the chain
func (*ChainedBidStrategy) ShouldBid ¶
func (c *ChainedBidStrategy) ShouldBid(ctx context.Context, request BidStrategyRequest) (BidStrategyResponse, error)
ShouldBid Iterate over all strategies, and return shouldBid if no error is thrown and none of the strategies return should not bid.
func (*ChainedBidStrategy) ShouldBidBasedOnUsage ¶
func (c *ChainedBidStrategy) ShouldBidBasedOnUsage( ctx context.Context, request BidStrategyRequest, usage model.ResourceUsageData) (BidStrategyResponse, error)
ShouldBidBasedOnUsage Iterate over all strategies, and return shouldBid if no error is thrown and none of the strategies return should not bid.
type DistanceDelayStrategy ¶
type DistanceDelayStrategy struct {
// contains filtered or unexported fields
}
func NewDistanceDelayStrategy ¶
func NewDistanceDelayStrategy(params DistanceDelayStrategyParams) *DistanceDelayStrategy
func (DistanceDelayStrategy) ShouldBid ¶
func (s DistanceDelayStrategy) ShouldBid(ctx context.Context, request BidStrategyRequest) (BidStrategyResponse, error)
func (DistanceDelayStrategy) ShouldBidBasedOnUsage ¶
func (s DistanceDelayStrategy) ShouldBidBasedOnUsage( _ context.Context, _ BidStrategyRequest, _ model.ResourceUsageData) (BidStrategyResponse, error)
type DistanceDelayStrategyParams ¶
type DistanceDelayStrategyParams struct {
NetworkSize int
}
type EnginesInstalledStrategy ¶
type EnginesInstalledStrategy struct {
// contains filtered or unexported fields
}
func NewEnginesInstalledStrategy ¶
func NewEnginesInstalledStrategy(params EnginesInstalledStrategyParams) *EnginesInstalledStrategy
func (*EnginesInstalledStrategy) ShouldBid ¶
func (s *EnginesInstalledStrategy) ShouldBid(ctx context.Context, request BidStrategyRequest) (BidStrategyResponse, error)
func (*EnginesInstalledStrategy) ShouldBidBasedOnUsage ¶
func (s *EnginesInstalledStrategy) ShouldBidBasedOnUsage( _ context.Context, _ BidStrategyRequest, _ model.ResourceUsageData) (BidStrategyResponse, error)
type EnginesInstalledStrategyParams ¶
type EnginesInstalledStrategyParams struct { Storages storage.StorageProvider Executors executor.ExecutorProvider Verifiers verifier.VerifierProvider Publishers publisher.PublisherProvider }
type ExternalCommandStrategy ¶
type ExternalCommandStrategy struct {
// contains filtered or unexported fields
}
func NewExternalCommandStrategy ¶
func NewExternalCommandStrategy(params ExternalCommandStrategyParams) *ExternalCommandStrategy
func (*ExternalCommandStrategy) ShouldBid ¶
func (s *ExternalCommandStrategy) ShouldBid(ctx context.Context, request BidStrategyRequest) (BidStrategyResponse, error)
func (*ExternalCommandStrategy) ShouldBidBasedOnUsage ¶
func (s *ExternalCommandStrategy) ShouldBidBasedOnUsage( _ context.Context, _ BidStrategyRequest, _ model.ResourceUsageData) (BidStrategyResponse, error)
type ExternalCommandStrategyParams ¶
type ExternalCommandStrategyParams struct {
Command string
}
type ExternalHTTPStrategy ¶
type ExternalHTTPStrategy struct {
// contains filtered or unexported fields
}
func NewExternalHTTPStrategy ¶
func NewExternalHTTPStrategy(params ExternalHTTPStrategyParams) *ExternalHTTPStrategy
func (*ExternalHTTPStrategy) ShouldBid ¶
func (s *ExternalHTTPStrategy) ShouldBid(ctx context.Context, request BidStrategyRequest) (BidStrategyResponse, error)
func (*ExternalHTTPStrategy) ShouldBidBasedOnUsage ¶
func (s *ExternalHTTPStrategy) ShouldBidBasedOnUsage( _ context.Context, _ BidStrategyRequest, _ model.ResourceUsageData) (BidStrategyResponse, error)
type ExternalHTTPStrategyParams ¶
type ExternalHTTPStrategyParams struct {
URL string
}
type InputLocalityStrategy ¶
type InputLocalityStrategy struct {
// contains filtered or unexported fields
}
func NewInputLocalityStrategy ¶
func NewInputLocalityStrategy(params InputLocalityStrategyParams) *InputLocalityStrategy
func (*InputLocalityStrategy) ShouldBid ¶
func (s *InputLocalityStrategy) ShouldBid(ctx context.Context, request BidStrategyRequest) (BidStrategyResponse, error)
func (*InputLocalityStrategy) ShouldBidBasedOnUsage ¶
func (s *InputLocalityStrategy) ShouldBidBasedOnUsage( _ context.Context, _ BidStrategyRequest, _ model.ResourceUsageData) (BidStrategyResponse, error)
type InputLocalityStrategyParams ¶
type InputLocalityStrategyParams struct { Locality model.JobSelectionDataLocality Executors executor.ExecutorProvider }
type JobSelectionPolicyProbeData ¶
type JobSelectionPolicyProbeData struct { NodeID string `json:"node_id"` JobID string `json:"job_id"` Spec model.Spec `json:"spec"` ExecutionPlan model.JobExecutionPlan `json:"execution_plan"` }
the JSON data we send to http or exec probes TODO: can we just use the BidStrategyRequest struct?
type NetworkingStrategy ¶
type NetworkingStrategy struct {
Accept bool
}
func NewNetworkingStrategy ¶
func NewNetworkingStrategy(accept bool) *NetworkingStrategy
func (*NetworkingStrategy) ShouldBid ¶
func (s *NetworkingStrategy) ShouldBid(ctx context.Context, request BidStrategyRequest) (BidStrategyResponse, error)
ShouldBid implements BidStrategy
func (*NetworkingStrategy) ShouldBidBasedOnUsage ¶
func (s *NetworkingStrategy) ShouldBidBasedOnUsage( ctx context.Context, request BidStrategyRequest, resourceUsage model.ResourceUsageData, ) (BidStrategyResponse, error)
ShouldBidBasedOnUsage implements BidStrategy
type StatelessJobStrategy ¶
type StatelessJobStrategy struct {
// contains filtered or unexported fields
}
func NewStatelessJobStrategy ¶
func NewStatelessJobStrategy(params StatelessJobStrategyParams) *StatelessJobStrategy
func (*StatelessJobStrategy) ShouldBid ¶
func (s *StatelessJobStrategy) ShouldBid(ctx context.Context, request BidStrategyRequest) (BidStrategyResponse, error)
func (*StatelessJobStrategy) ShouldBidBasedOnUsage ¶
func (s *StatelessJobStrategy) ShouldBidBasedOnUsage( _ context.Context, _ BidStrategyRequest, _ model.ResourceUsageData) (BidStrategyResponse, error)
type StatelessJobStrategyParams ¶
type StatelessJobStrategyParams struct {
RejectStatelessJobs bool
}
type TimeoutStrategy ¶
type TimeoutStrategy struct {
// contains filtered or unexported fields
}
func NewTimeoutStrategy ¶
func NewTimeoutStrategy(params TimeoutStrategyParams) *TimeoutStrategy
func (*TimeoutStrategy) ShouldBid ¶
func (s *TimeoutStrategy) ShouldBid(_ context.Context, request BidStrategyRequest) (BidStrategyResponse, error)
func (*TimeoutStrategy) ShouldBidBasedOnUsage ¶
func (s *TimeoutStrategy) ShouldBidBasedOnUsage(context.Context, BidStrategyRequest, model.ResourceUsageData) (BidStrategyResponse, error)
Click to show internal directories.
Click to hide internal directories.