providers

package
v0.0.0-...-7b701f8 Latest Latest
Warning

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

Go to latest
Published: May 13, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AwsProviderInstanceNameFmt = "corebench-aws-%s"
	AwsBenchReadyScript        = "export GOPATH=/home/ubuntu/go && while [ ! -f $GOPATH/.core-init ]; do sleep 1; done"
	AwsBenchCommandTemplate    = `` /* 201-byte string literal not displayed */
	AwsBenchStatTemplate       = " | tee benchmark.log && echo '\n\n' && $GOPATH/bin/benchstat benchmark.log"
)
View Source
const CfnTemplate = `` /* 4449-byte string literal not displayed */

Variables

This section is empty.

Functions

func NewDigitalOceanAuth

func NewDigitalOceanAuth(pat string) oauth2.TokenSource

Types

type AwsProvider

type AwsProvider struct {
	Keyfile string
	// contains filtered or unexported fields
}

func (*AwsProvider) List

func (p *AwsProvider) List(ctx context.Context) error

func (*AwsProvider) SetKeys

func (p *AwsProvider) SetKeys(keys []string)

func (*AwsProvider) Sizes

func (p *AwsProvider) Sizes(ctx context.Context) error

func (*AwsProvider) Spinup

func (p *AwsProvider) Spinup(ctx context.Context, settings ProviderSpinSettings) error

func (*AwsProvider) Term

func (p *AwsProvider) Term(ctx context.Context, settings ProviderTermSettings) error

type AwsSpinSettings

type AwsSpinSettings struct {
	Benchmem         bool
	CountFlag        int
	InstanceType     string
	Cpu              string
	Git              string
	GoVersionFlag    string
	LeaveRunningFlag bool
	RegexFlag        string
	StatFlag         bool
}

func (*AwsSpinSettings) BenchMemString

func (aws *AwsSpinSettings) BenchMemString() string

func (*AwsSpinSettings) Count

func (aws *AwsSpinSettings) Count() int

func (*AwsSpinSettings) Cpus

func (aws *AwsSpinSettings) Cpus() string

func (*AwsSpinSettings) GitURL

func (aws *AwsSpinSettings) GitURL() string

func (*AwsSpinSettings) GoVersion

func (aws *AwsSpinSettings) GoVersion() string

func (*AwsSpinSettings) InstanceTypeString

func (aws *AwsSpinSettings) InstanceTypeString() string

func (*AwsSpinSettings) LeaveRunning

func (aws *AwsSpinSettings) LeaveRunning() bool

func (*AwsSpinSettings) MaxCpu

func (aws *AwsSpinSettings) MaxCpu() int

func (*AwsSpinSettings) Regex

func (aws *AwsSpinSettings) Regex() string

func (*AwsSpinSettings) Stat

func (aws *AwsSpinSettings) Stat() bool

type AwsTermSettings

type AwsTermSettings struct {
	AllFlag  bool
	IPFlag   string
	NameFlag string
}

func (*AwsTermSettings) ShouldTerm

func (aws *AwsTermSettings) ShouldTerm(name, ip string) bool

type DigitalOceanProvider

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

func (*DigitalOceanProvider) List

func (*DigitalOceanProvider) SetKeys

func (p *DigitalOceanProvider) SetKeys(keys []string)

func (*DigitalOceanProvider) Sizes

func (p *DigitalOceanProvider) Sizes(ctx context.Context) error

func (*DigitalOceanProvider) Spinup

func (*DigitalOceanProvider) Term

type DoSpinSettings

type DoSpinSettings struct {
	Benchmem         bool
	CountFlag        int
	InstanceType     string
	Cpu              string
	Git              string
	GoVersionFlag    string
	LeaveRunningFlag bool
	RegexFlag        string
	StatFlag         bool
}

func (*DoSpinSettings) BenchMemString

func (do *DoSpinSettings) BenchMemString() string

func (*DoSpinSettings) Count

func (do *DoSpinSettings) Count() int

func (*DoSpinSettings) Cpus

func (do *DoSpinSettings) Cpus() string

func (*DoSpinSettings) GitURL

func (do *DoSpinSettings) GitURL() string

func (*DoSpinSettings) GoVersion

func (do *DoSpinSettings) GoVersion() string

func (*DoSpinSettings) InstanceTypeString

func (do *DoSpinSettings) InstanceTypeString() string

func (*DoSpinSettings) LeaveRunning

func (do *DoSpinSettings) LeaveRunning() bool

func (*DoSpinSettings) MaxCpu

func (do *DoSpinSettings) MaxCpu() int

func (*DoSpinSettings) Regex

func (do *DoSpinSettings) Regex() string

func (*DoSpinSettings) Stat

func (do *DoSpinSettings) Stat() bool

type DoTermSettings

type DoTermSettings struct {
	AllFlag  bool
	IPFlag   string
	NameFlag string
}

func (*DoTermSettings) ShouldTerm

func (do *DoTermSettings) ShouldTerm(name, ip string) bool

type Provider

type Provider interface {
	// Spinup provisions and benchmarks in one shot.
	Spinup(context.Context, ProviderSpinSettings) error
	// SetKeys allows you to specify your SSH keys to be installed on the resource.
	SetKeys(keys []string)
	// List will list any provisioned instances created by corebench.
	List(context.Context) error
	// Term terminates instance provisioned by corebench.
	Term(context.Context, ProviderTermSettings) error
	// Sizes lists the box sizes that can be provisioned by the provider.
	Sizes(context.Context) error
}

Provider is some type of provider.

func NewAwsProvider

func NewAwsProvider() Provider

func NewDigitalOceanProvider

func NewDigitalOceanProvider(pat string) Provider

type ProviderSpinSettings

type ProviderSpinSettings interface {
	GoVersion() string
	GitURL() string
	Cpus() string
	InstanceTypeString() string
	MaxCpu() int
	BenchMemString() string
	Regex() string
	LeaveRunning() bool
	Count() int
	Stat() bool
}

type ProviderTermSettings

type ProviderTermSettings interface {
	ShouldTerm(name, ip string) bool
}

Jump to

Keyboard shortcuts

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