devstack

package
v1.2.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLibp2pKeySize = 2048
)

Variables

This section is empty.

Functions

func NewNoopExecutorsFactory

func NewNoopExecutorsFactory() node.ExecutorsFactory

func NewNoopExecutorsFactoryWithConfig

func NewNoopExecutorsFactoryWithConfig(config noop_executor.ExecutorConfig) node.ExecutorsFactory

func NewNoopNodeDependencyInjector

func NewNoopNodeDependencyInjector() node.NodeDependencyInjector

Noop implementations of node factories used to mock certain components, which is useful for testing.

func NewNoopPublishersFactory

func NewNoopPublishersFactory() node.PublishersFactory

func NewNoopPublishersFactoryWithConfig added in v0.3.25

func NewNoopPublishersFactoryWithConfig(config noop_publisher.PublisherConfig) node.PublishersFactory

func NewNoopStorageProvidersFactory

func NewNoopStorageProvidersFactory() node.StorageProvidersFactory

func NewNoopStorageProvidersFactoryWithConfig

func NewNoopStorageProvidersFactoryWithConfig(config noop_storage.StorageConfig) node.StorageProvidersFactory

func ToIPFSClients

func ToIPFSClients(nodes []*node.Node) []ipfs.Client

Types

type CloserWithContext

type CloserWithContext interface {
	// Close closes the resource.
	Close(context.Context) error
}

type ConfigOption added in v1.0.4

type ConfigOption = func(cfg *DevStackConfig)

func WithAllowListedLocalPaths added in v1.0.4

func WithAllowListedLocalPaths(paths []string) ConfigOption

func WithCPUProfilingFile added in v1.0.4

func WithCPUProfilingFile(path string) ConfigOption

func WithComputeConfig added in v1.0.4

func WithComputeConfig(computeCfg node.ComputeConfig) ConfigOption

func WithDependencyInjector added in v1.0.4

func WithDependencyInjector(injector node.NodeDependencyInjector) ConfigOption

func WithDisabledFeatures added in v1.0.4

func WithDisabledFeatures(disable node.FeatureConfig) ConfigOption

func WithExecutorPlugins added in v1.0.4

func WithExecutorPlugins(enabled bool) ConfigOption

func WithMemoryProfilingFile added in v1.0.4

func WithMemoryProfilingFile(path string) ConfigOption

func WithNodeInfoPublisherInterval added in v1.0.4

func WithNodeInfoPublisherInterval(interval routing.NodeInfoPublisherIntervalConfig) ConfigOption

func WithNodeOverrides added in v1.0.4

func WithNodeOverrides(overrides ...node.NodeConfig) ConfigOption

func WithNumberOfBadComputeActors added in v1.0.4

func WithNumberOfBadComputeActors(count int) ConfigOption

func WithNumberOfBadRequesterActors added in v1.0.4

func WithNumberOfBadRequesterActors(count int) ConfigOption

func WithNumberOfComputeOnlyNodes added in v1.0.4

func WithNumberOfComputeOnlyNodes(count int) ConfigOption

func WithNumberOfHybridNodes added in v1.0.4

func WithNumberOfHybridNodes(count int) ConfigOption

func WithNumberOfRequesterOnlyNodes added in v1.0.4

func WithNumberOfRequesterOnlyNodes(count int) ConfigOption

func WithPeer added in v1.0.4

func WithPeer(p string) ConfigOption

func WithPublicIPFSMode added in v1.0.4

func WithPublicIPFSMode(enabled bool) ConfigOption

func WithRequesterConfig added in v1.0.4

func WithRequesterConfig(requesterConfig node.RequesterConfig) ConfigOption

type DevStack

type DevStack struct {
	Nodes          []*node.Node
	PublicIPFSMode bool
}

func Setup added in v1.0.4

func Setup(
	ctx context.Context,
	cm *system.CleanupManager,
	fsRepo *repo.FsRepo,
	opts ...ConfigOption,
) (*DevStack, error)

func (*DevStack) GetNode

func (stack *DevStack) GetNode(_ context.Context, nodeID string) (
	*node.Node, error)

func (*DevStack) GetNodeIds

func (stack *DevStack) GetNodeIds() []string

func (*DevStack) IPFSClients

func (stack *DevStack) IPFSClients() []ipfs.Client

func (*DevStack) PrintNodeInfo

func (stack *DevStack) PrintNodeInfo(ctx context.Context, fsRepo *repo.FsRepo, cm *system.CleanupManager) (string, error)

type DevStackConfig added in v1.0.4

type DevStackConfig struct {
	ComputeConfig          node.ComputeConfig
	RequesterConfig        node.RequesterConfig
	NodeDependencyInjector node.NodeDependencyInjector
	NodeOverrides          []node.NodeConfig

	// DevStackOptions
	NumberOfHybridNodes        int    // Number of nodes to start in the cluster
	NumberOfRequesterOnlyNodes int    // Number of nodes to start in the cluster
	NumberOfComputeOnlyNodes   int    // Number of nodes to start in the cluster
	NumberOfBadComputeActors   int    // Number of compute nodes to be bad actors
	NumberOfBadRequesterActors int    // Number of requester nodes to be bad actors
	Peer                       string // Connect node 0 to another network node
	PublicIPFSMode             bool   // Use public IPFS nodes
	CPUProfilingFile           string
	MemoryProfilingFile        string
	DisabledFeatures           node.FeatureConfig
	AllowListedLocalPaths      []string // Local paths that are allowed to be mounted into jobs
	NodeInfoPublisherInterval  routing.NodeInfoPublisherIntervalConfig
	ExecutorPlugins            bool // when true pluggable executors will be used.
	NodeInfoStoreTTL           time.Duration
}

func (*DevStackConfig) MarshalZerologObject added in v1.0.4

func (o *DevStackConfig) MarshalZerologObject(e *zerolog.Event)

func (*DevStackConfig) Validate added in v1.0.4

func (o *DevStackConfig) Validate() error

type DevStackIPFS

type DevStackIPFS struct {
	IPFSClients    []ipfs.Client
	CleanupManager *system.CleanupManager
}

func NewDevStackIPFS

func NewDevStackIPFS(ctx context.Context, cm *system.CleanupManager, count int) (*DevStackIPFS, error)

NewDevStackIPFS creates a devstack but with only IPFS servers connected to each other

type DevStackOptions

type DevStackOptions struct {
	NumberOfHybridNodes        int    // Number of nodes to start in the cluster
	NumberOfRequesterOnlyNodes int    // Number of nodes to start in the cluster
	NumberOfComputeOnlyNodes   int    // Number of nodes to start in the cluster
	NumberOfBadComputeActors   int    // Number of compute nodes to be bad actors
	NumberOfBadRequesterActors int    // Number of requester nodes to be bad actors
	Peer                       string // Connect node 0 to another network node
	PublicIPFSMode             bool   // Use public IPFS nodes
	CPUProfilingFile           string
	MemoryProfilingFile        string
	DisabledFeatures           node.FeatureConfig
	AllowListedLocalPaths      []string // Local paths that are allowed to be mounted into jobs
	NodeInfoPublisherInterval  routing.NodeInfoPublisherIntervalConfig
	ExecutorPlugins            bool   // when true pluggable executors will be used.
	ConfigurationRepo          string // A custom config repo
}

func (*DevStackOptions) Options added in v1.0.4

func (o *DevStackOptions) Options() []ConfigOption

Jump to

Keyboard shortcuts

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