orchestrator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FCROOTPATH    = "/celestial"
	FCOUTFILEPATH = "/celestial/out/"

	DEFAULTRATE = "10.0Gbps"

	// MAXLATENCY means unusable: nothing is usable above 999.999 seconds?
	MAXLATENCY   = 999999.9
	MINBANDWIDTH = 0

	GUESTINTERFACE = "eth0"
	NAMESERVER     = "1.1.1.1"

	WGPORT      = 3000
	WGINTERFACE = "wg0"
	MASK        = "/26"

	// setting the path directly means we don't have to consult lookpath for each command
	// TODO: in theory we should probably add a LookPath to this
	TC       = "/sbin/tc"
	IPTABLES = "/sbin/iptables"
	IPSET    = "/sbin/ipset"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Orchestrator

type Orchestrator struct {
	Initialized bool
	// contains filtered or unexported fields
}

Orchestrator orchestrates different firecracker microVMs on the host.

func New

func New(eager bool, initDelay int, networkInterface string) (*Orchestrator, error)

New creates a new Orchestrator.

func (*Orchestrator) CreateMachine

func (o *Orchestrator) CreateMachine(m commons.MachineID, vCPUCount uint64, memSizeMiB uint64, htEnabled bool, diskSizeMiB uint64, bootparams string, kernel string, rootfs string, bandwidth uint64, active bool) error

CreateMachine creates a new firecracker microVM.

func (*Orchestrator) DBGetConstellation

func (o *Orchestrator) DBGetConstellation(w io.Writer) error

func (*Orchestrator) DBGetGroundStation

func (o *Orchestrator) DBGetGroundStation(name string, w io.Writer) error

func (*Orchestrator) DBGetPath

func (o *Orchestrator) DBGetPath(sourceShell int32, sourceId uint32, targetShell int32, targetId uint32, w io.Writer) error

func (*Orchestrator) DBGetSatellite

func (o *Orchestrator) DBGetSatellite(shell uint32, sat uint32, w io.Writer) error

func (*Orchestrator) DBGetShell

func (o *Orchestrator) DBGetShell(shell uint32, w io.Writer) error

func (*Orchestrator) GetGSTID

func (o *Orchestrator) GetGSTID(name string) (uint64, error)

GetGSTID returns the ID of a ground station machine.

func (*Orchestrator) GetGSTIPAddress

func (o *Orchestrator) GetGSTIPAddress(name string) (string, error)

GetGSTIPAddress returns an IP address of a ground station machine.

func (*Orchestrator) GetIPAddress

func (o *Orchestrator) GetIPAddress(shell int64, id uint64) (string, error)

GetIPAddress returns an IP address of a satellite machine.

func (*Orchestrator) GetMachineByIP

func (o *Orchestrator) GetMachineByIP(ip net.IP) (commons.MachineID, error)

GetMachineByIP returns a machine identifier based on an IP address.

func (*Orchestrator) InitDB

func (o *Orchestrator) InitDB(host string) error

func (*Orchestrator) InitRemotes

func (o *Orchestrator) InitRemotes(addr []string) error

func (*Orchestrator) InitShells

func (o *Orchestrator) InitShells(s []commons.Shell) error
func (o *Orchestrator) LockForLink(a commons.MachineID) error

LockForLink locks a machine for link modification.

func (o *Orchestrator) ModifyLink(a commons.MachineID, b commons.MachineID, latency float64, bandwidth uint64) error

ModifyLink modifies the latency (in ms) of the links between two firecracker microVMs. It assumes that LockForLink is called before.

func (*Orchestrator) ModifyMachine

func (o *Orchestrator) ModifyMachine(m commons.MachineID, active bool) error

ModifyMachine pauses or resumes a firecracker microVM.

func (*Orchestrator) Ready

func (o *Orchestrator) Ready() (bool, uint64)
func (o *Orchestrator) RemoveLink(a commons.MachineID, b commons.MachineID) error

RemoveLink removes a link from two firecracker microVMs. It assumes that LockForLink is called before.

func (*Orchestrator) RouteMachine

func (o *Orchestrator) RouteMachine(m commons.MachineID, bandwidth uint64, host uint64) error

func (*Orchestrator) SetPeerID

func (o *Orchestrator) SetPeerID(id uint64) error

func (*Orchestrator) StartPeer

func (o *Orchestrator) StartPeer(publickey string, peer uint64) error

StartPeer starts connection to a peer

func (*Orchestrator) StartPeering

func (o *Orchestrator) StartPeering() error
func (o *Orchestrator) UnlockForLink(a commons.MachineID) error

UnlockForLink unlocks a machine for link modification.

Jump to

Keyboard shortcuts

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