resourceprovider

package
v0.0.0-brrefs-pull-106... Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const CONTROL_LOOP_INTERVAL = 10 * time.Second

the background "even if we have not heard of an event" loop i.e. things will not wait 10 seconds - the control loop reacts to events in the system - this 10 second background loop is just for in case we miss any events

Variables

View Source
var Module = fx.Options(
	dealmaker.Module,
	fx.Provide(
		newServices,
	),
)

Functions

func AddResourceProviderCliFlags added in v0.2.5

func AddResourceProviderCliFlags(cmd *cobra.Command, options *ResourceProviderOptions)

func AddResourceProviderOfferCliFlags added in v0.2.5

func AddResourceProviderOfferCliFlags(cmd *cobra.Command, offerOptions *ResourceProviderOfferOptions)

func CheckResourceProviderOfferOptions added in v0.2.5

func CheckResourceProviderOfferOptions(options ResourceProviderOfferOptions) error

func CheckResourceProviderOptions added in v0.2.5

func CheckResourceProviderOptions(options ResourceProviderOptions) error

Types

type ResourceProvider added in v0.3.0

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

func NewResourceProvider added in v0.3.0

func NewResourceProvider(
	options ResourceProviderOptions,
	web3SDK *web3.Web3SDK,
	executor executor.Executor,
	dealMakerService *dealmaker.Service,
) (*ResourceProvider, error)

func (*ResourceProvider) Start added in v0.3.0

func (resourceProvider *ResourceProvider) Start(ctx context.Context, cm *system.CleanupManager) chan error

type ResourceProviderController added in v0.3.0

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

func NewResourceProviderController added in v0.3.0

func NewResourceProviderController(
	options ResourceProviderOptions,
	web3SDK *web3.Web3SDK,
	executor executor.Executor,
	dealmakerService *dealmaker.Service,
) (*ResourceProviderController, error)

func (*ResourceProviderController) Start added in v0.3.0

func (controller *ResourceProviderController) Start(ctx context.Context, cm *system.CleanupManager) chan error

type ResourceProviderOfferOptions added in v0.3.0

type ResourceProviderOfferOptions struct {
	// if we are configuring a single machine then
	// these values are populated by the flags
	OfferSpec dto.MachineSpec
	// we can dupliate the single spec to create a list of specs
	OfferCount int
	// this represents how many machines we will keep
	// offering to the network
	// we can configure this with a config file
	// to start with we will just add --cpu --gpu and --ram flags
	// to the resource provider CLI which constrains them to a single machine
	Specs []dto.MachineSpec
	// the list of modules we are willing to run
	// an empty list means anything
	Modules []string

	// this will normally be FixedPrice for RP's
	Mode dto.PricingMode

	// the default pricing for this resource provider
	// for all modules that don't have a specific price
	DefaultPricing  dto.DealPricing
	DefaultTimeouts dto.DealTimeouts

	// allow different pricing for different modules
	ModulePricing  map[string]dto.DealPricing
	ModuleTimeouts map[string]dto.DealTimeouts

	// which mediators and directories this RP will trust
	Services dto.ServiceConfig
}

this configures the resource offers we will keep track of

func GetDefaultResourceProviderOfferOptions added in v0.2.5

func GetDefaultResourceProviderOfferOptions() ResourceProviderOfferOptions

func ProcessResourceProviderOfferOptions added in v0.2.5

func ProcessResourceProviderOfferOptions(options ResourceProviderOfferOptions) (ResourceProviderOfferOptions, error)

type ResourceProviderOptions added in v0.3.0

type ResourceProviderOptions struct {
	Bacalhau bacalhau.BacalhauExecutorOptions
	Offers   ResourceProviderOfferOptions
	Web3     web3.Web3Options
}

func NewResourceProviderOptions added in v0.2.5

func NewResourceProviderOptions() ResourceProviderOptions

func ProcessResourceProviderOptions added in v0.2.5

func ProcessResourceProviderOptions(options ResourceProviderOptions) (ResourceProviderOptions, error)

Jump to

Keyboard shortcuts

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