cluster

package
v0.0.0-...-c283e9f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: BSD-3-Clause Imports: 27 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFlynn

func BuildFlynn(bc BootConfig, rootFS, commit string, merge bool, out io.Writer) (string, error)

Types

type BootConfig

type BootConfig struct {
	Kernel     string
	BackupsDir string
}

type BootResult

type BootResult struct {
	ControllerDomain string
	ControllerPin    string
	ControllerKey    string
	Instances        []*Instance
}

type Cluster

type Cluster struct {
	ID            string    `json:"id"`
	Instances     instances `json:"instances"`
	ClusterDomain string    `json:"cluster_domain"`
	ControllerPin string    `json:"controller_pin"`
	ControllerKey string    `json:"controller_key"`
	RouterIP      string    `json:"router_ip"`
	// contains filtered or unexported fields
}

func New

func New(bc BootConfig, out io.Writer) *Cluster

func (*Cluster) AddHost

func (c *Cluster) AddHost() (*Instance, error)

func (*Cluster) AddVanillaHost

func (c *Cluster) AddVanillaHost(rootFS string) (*Instance, error)

func (*Cluster) Boot

func (c *Cluster) Boot(typ ClusterType, count int, buildLog *buildlog.Log, killOnFailure bool) (res *BootResult, err error)

func (*Cluster) BuildFlynn

func (c *Cluster) BuildFlynn(rootFS, commit string, merge bool, runTests bool) (string, error)

func (*Cluster) CLIConfig

func (c *Cluster) CLIConfig() (*config.Config, error)

func (*Cluster) ControllerDomain

func (c *Cluster) ControllerDomain() string

func (*Cluster) DumpLogs

func (c *Cluster) DumpLogs(buildLog *buildlog.Log)

func (*Cluster) GitDomain

func (c *Cluster) GitDomain() string

func (*Cluster) RemoveHost

func (c *Cluster) RemoveHost(id string) error

RemoveHost stops flynn-host on the instance but leaves it running so the logs are still available if we need to dump them later.

func (*Cluster) Run

func (c *Cluster) Run(command string, s *Streams) error

func (*Cluster) RunWithEnv

func (c *Cluster) RunWithEnv(command string, s *Streams, env map[string]string) error

func (*Cluster) Shutdown

func (c *Cluster) Shutdown()

func (*Cluster) Size

func (c *Cluster) Size() int

type ClusterType

type ClusterType uint8
const (
	ClusterTypeDefault ClusterType = iota
	ClusterTypeRelease
	ClusterTypeNone
)

type Instance

type Instance struct {
	ID string `json:"id"`
	IP string `json:"ip"`

	*VMConfig
	// contains filtered or unexported fields
}

func (*Instance) Kill

func (i *Instance) Kill() error

func (*Instance) Run

func (i *Instance) Run(command string, s *Streams) error

func (*Instance) RunWithEnv

func (i *Instance) RunWithEnv(command string, s *Streams, env map[string]string) error

func (*Instance) RunWithTimeout

func (i *Instance) RunWithTimeout(command string, s *Streams, timeout time.Duration) error

func (*Instance) Shutdown

func (i *Instance) Shutdown() error

func (*Instance) Start

func (i *Instance) Start() error

func (*Instance) Wait

func (i *Instance) Wait(timeout time.Duration, f func() error) error

type Streams

type Streams struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

type VMConfig

type VMConfig struct {
	Kernel     string
	Memory     int64
	Cores      int
	Disk       *VMDisk
	Args       []string
	Out        io.Writer `json:"-"`
	BackupsDir string
	// contains filtered or unexported fields
}

type VMDisk

type VMDisk struct {
	FS   string
	COW  bool
	Temp bool
}

type VMManager

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

func NewVMManager

func NewVMManager(client controller.Client) *VMManager

func (*VMManager) NewInstance

func (v *VMManager) NewInstance(c *VMConfig) (*Instance, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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