node

package
v0.0.0-...-38a8f93 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Node package contains the main logic for a KAGETAKA's node. It represents a KAGETAKA's node it has a one-to-one relation with the number of daemons/machine in the system. It is the facade for all the functionality exposing it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

Node is the top level entry structure, facade, for all the functionality of a KAGETAKA's node.

func NewNode

func NewNode(config *configuration.Configuration, overlayCli overlay.Overlay, kagetakaCli external.Kagetaka,
	dockerClient external.DockerClient, apiServer api.Server) *Node

NewNode creates a Node object that contains all the functionality of a KAGETAKA's node.

func (*Node) AddTrader

func (n *Node) AddTrader(guidBytes []byte)

func (*Node) AdvertiseOffersNeighbor

func (n *Node) AdvertiseOffersNeighbor(ctx context.Context, fromTrader, toNeighborTrader, traderOffering *types.Node)

func (*Node) Configuration

func (n *Node) Configuration(c context.Context) *configuration.Configuration

Configuration returns the system's configuration of this node.

func (*Node) CreateOffer

func (n *Node) CreateOffer(ctx context.Context, fromNode *types.Node, toNode *types.Node, offer *types.Offer)

func (*Node) DebugSizeBytes

func (n *Node) DebugSizeBytes() int

func (*Node) GUID

func (n *Node) GUID() string

func (*Node) GetOffers

func (n *Node) GetOffers(ctx context.Context, fromNode, toTrader *types.Node, relay bool) []types.AvailableOffer

func (*Node) GetSystemPartitionsState

func (n *Node) GetSystemPartitionsState() *partitions.SystemResourcePartitions

func (*Node) LaunchContainers

func (n *Node) LaunchContainers(ctx context.Context, fromBuyer *types.Node, offer *types.Offer,
	containersConfigs []types.ContainerConfig) ([]types.ContainerStatus, error)

func (*Node) ListContainers

func (n *Node) ListContainers(_ context.Context) []types.ContainerStatus

func (*Node) NodeInformationSim

func (n *Node) NodeInformationSim() (types.Resources, types.Resources, int, int)

NodeInformationSim returns the available resources, maximum available resources and number of offers in the node. Note: Only available when the node is running in simulation mode.

func (*Node) RefreshOffer

func (n *Node) RefreshOffer(ctx context.Context, fromTrader *types.Node, offer *types.Offer) bool

func (*Node) RefreshOffersSim

func (n *Node) RefreshOffersSim()

RefreshOffersSim triggers the inner actions to refresh all the offers that the node is handling. Note: Only available when the node is running in simulation mode.

func (*Node) RemoveOffer

func (n *Node) RemoveOffer(ctx context.Context, fromSupp *types.Node, toTrader *types.Node, offer *types.Offer)

func (*Node) SpreadOffersSim

func (n *Node) SpreadOffersSim()

SpreadOffersSim triggers the inner actions to spread the offers that the node is handling. Note: Only available when the node is running in simulation mode.

func (*Node) Start

func (n *Node) Start(join bool, joinIP string) error

Start the node's functions. If the node is joining an instance of KAGETAKA's it is called with join as true and the joinIP contains the IP address of a node that already belongs to the KAGETAKA's instance.

func (*Node) Stop

func (n *Node) Stop(ctx context.Context)

Stop the node's functions.

func (*Node) StopContainers

func (n *Node) StopContainers(ctx context.Context, containersIDs []string) error

func (*Node) StopLocalContainer

func (n *Node) StopLocalContainer(ctx context.Context, containerID string) error

func (*Node) SubmitContainers

func (n *Node) SubmitContainers(ctx context.Context, containerConfigs []types.ContainerConfig) ([]types.ContainerStatus, error)

func (*Node) UpdateOffer

func (n *Node) UpdateOffer(ctx context.Context, fromSupplier, toTrader *types.Node, offer *types.Offer)

Jump to

Keyboard shortcuts

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