jupiterbrain

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: MIT Imports: 18 Imported by: 0

README

Jupiter Brain

GoDoc Build Status

Jupiter Brain is a virtual machine cloud manager backed by vSphere, prioritizing fast boot times for ephemeral VMs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseVirtualMachineNotFoundError

type BaseVirtualMachineNotFoundError struct {
	Path string
	Name string
}

BaseVirtualMachineNotFoundError is returned if a base virtual machine isn't found.

func (BaseVirtualMachineNotFoundError) Error

type Instance

type Instance struct {
	ID          string `db:"id"`
	IPAddresses []string
	State       string
	CreatedAt   time.Time   `db:"created_at"`
	DestroyedAt pq.NullTime `db:"destroyed_at"`
}

Instance is our representation of an instance woop woop

type InstanceConfig added in v1.1.0

type InstanceConfig struct {
	// Type is the type of data in the payload and is required to be "instances".
	// The endpoint for creating new instances will check this value for correctness.
	Type string `json:"type"`

	// BaseImage is the VM name of the image the new instance will be cloned from.
	BaseImage string `json:"base-image"`

	// CPUCount is the number of CPUs the new instance should have.
	// If CPUCount is 0, the number of CPUs will not be changed from what is configured
	// in the base image.
	CPUCount int `json:"cpus"`

	// RAM is the amount of RAM in MB that the new instance should have.
	// If RAM is 0, the amount of RAM will not be changed from what is configured in the
	// base image.
	RAM int `json:"ram"`
}

InstanceConfig specifies how a new instance should be configured

func (InstanceConfig) ConfigSpec added in v1.1.0

ConfigSpec constructs a spec for reconfiguring the VM after it is cloned. ConfigSpec returns nil if none of the config parameters for the VM are set. In that case, no reconfigure task for the VM should be run.

func (InstanceConfig) Track added in v1.1.0

func (c InstanceConfig) Track(ctx context.Context)

Track adds fields to the current Honeycomb event with information about the VM config that was requested.

type InstanceManager

type InstanceManager interface {
	Fetch(context.Context, string) (*Instance, error)
	List(context.Context) ([]*Instance, error)
	Start(context.Context, InstanceConfig) (*Instance, error)
	Terminate(context.Context, string) error
}

InstanceManager is the interface used for managing instances wow!

func NewVSphereInstanceManager

func NewVSphereInstanceManager(log *logrus.Logger, vSphereURL *url.URL, paths VSpherePaths, readConcurrency, createConcurrency, deleteConcurrency int) InstanceManager

NewVSphereInstanceManager creates a new instance manager backed by vSphere

type VSpherePaths

type VSpherePaths struct {
	// BasePath is the path to a folder in which the base VMs that the
	// instance manager use to create VMs are. These VMs should have a
	// snapshot named "base", and new VMs will spin up from this snapshot.
	// The path should end with a slash.
	BasePath string

	// VMPath is the path to a folder in which VMs will be cloned into. Any
	// VM in this folder can be displayed and stopped with the instance
	// manager. The path should end with a slash.
	VMPath string

	// ClusterPath is the inventory path to a ClusterComputeResource that
	// is used as the resource pool for new VMs.
	ClusterPath string
}

VSpherePaths holds some vSphere inventory paths that are required for the InstanceManager to function properly.

type VirtualMachineNotFoundError

type VirtualMachineNotFoundError struct {
	Path string
	ID   string
}

VirtualMachineNotFoundError is returned if a virtual machine isn't found.

func (VirtualMachineNotFoundError) Error

Directories

Path Synopsis
cmd
Package metrics provides easy methods to send metrics
Package metrics provides easy methods to send metrics
pkg
Package server contains an HTTP API server to interface with the Jupiter Brain API.
Package server contains an HTTP API server to interface with the Jupiter Brain API.

Jump to

Keyboard shortcuts

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