cluster

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const HostnameSeparator = '.'

Variables

View Source
var (

	// ErrInsufficientCapacity is the new error when capacity is insufficient
	ErrInsufficientCapacity = errors.New("insufficient capacity")
)
View Source
var ErrNotRunning = errors.New("not running")

ErrNotRunning is the error when service is not running

Functions

func NewNode added in v0.2.4

func NewNode(id string, available atypes.ResourceUnits) ctypes.Node

NewNode returns new Node instance with provided details

func NewServiceLog added in v0.2.2

func NewServiceLog(name string, stream io.ReadCloser) *ctypes.ServiceLog

NewServiceLog creates and returns a service log with provided details

Types

type Client added in v0.0.8

type Client interface {
	ReadClient
	Deploy(context.Context, mtypes.LeaseID, *manifest.Group) error
	TeardownLease(context.Context, mtypes.LeaseID) error
	Deployments(context.Context) ([]ctypes.Deployment, error)
	Inventory(context.Context) ([]ctypes.Node, error)
}

Client interface lease and deployment methods

func NullClient added in v0.0.8

func NullClient() Client

NullClient returns nullClient instance

type Cluster

type Cluster interface {
	Reserve(mtypes.OrderID, atypes.ResourceGroup) (ctypes.Reservation, error)
	Unreserve(mtypes.OrderID) error
}

Cluster is the interface that wraps Reserve and Unreserve methods

type Config added in v0.9.1

type Config struct {
	InventoryResourcePollPeriod     time.Duration
	InventoryResourceDebugFrequency uint
	InventoryExternalPortQuantity   uint
	CPUCommitLevel                  float64
	MemoryCommitLevel               float64
	StorageCommitLevel              float64
	BlockedHostnames                []string
}

func NewDefaultConfig added in v0.9.1

func NewDefaultConfig() Config

type HostnameServiceClient added in v0.9.3

type HostnameServiceClient interface {
	ReserveHostnames(hostnames []string, did dtypes.DeploymentID) <-chan error
	ReleaseHostnames(hostnames []string)
	CanReserveHostnames(hostnames []string, did dtypes.DeploymentID) <-chan error
}

type ReadClient added in v0.7.3

type ReadClient interface {
	LeaseStatus(context.Context, mtypes.LeaseID) (*ctypes.LeaseStatus, error)
	ServiceStatus(context.Context, mtypes.LeaseID, string) (*ctypes.ServiceStatus, error)
	ServiceLogs(context.Context, mtypes.LeaseID, string, bool, *int64) ([]*ctypes.ServiceLog, error)
}

type Service

type Service interface {
	StatusClient
	Cluster
	Close() error
	Ready() <-chan struct{}
	Done() <-chan struct{}
	HostnameService() HostnameServiceClient
}

Service manage compute cluster for the provider. Will eventually integrate with kubernetes, etc...

func NewService

func NewService(ctx context.Context, session session.Session, bus pubsub.Bus, client Client, cfg Config) (Service, error)

NewService returns new Service instance

type SimpleHostnames added in v0.9.3

type SimpleHostnames struct {
	Hostnames map[string]dtypes.DeploymentID
	// contains filtered or unexported fields

} /* Used in test code */

func (*SimpleHostnames) CanReserveHostnames added in v0.9.3

func (sh *SimpleHostnames) CanReserveHostnames(hostnames []string, did dtypes.DeploymentID) <-chan error

func (*SimpleHostnames) ReleaseHostnames added in v0.9.3

func (sh *SimpleHostnames) ReleaseHostnames(hostnames []string)

func (*SimpleHostnames) ReserveHostnames added in v0.9.3

func (sh *SimpleHostnames) ReserveHostnames(hostnames []string, did dtypes.DeploymentID) <-chan error

type StatusClient added in v0.3.4

type StatusClient interface {
	Status(context.Context) (*ctypes.Status, error)
}

StatusClient is the interface which includes status of service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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