builders

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2018 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HyperBuilder

type HyperBuilder struct {
	Image          string // base image
	ID             string // benchmark container ID
	HyperSize      string
	Before         []string
	Command        []string
	Context        context.Context
	HyperClient    *hyper.Client
	HyperRegion    string
	DockerClient   *docker.Client
	BenchmarkImage string
	Results        string
}

HyperBuilder is the Hyper.sh struct for dealing with hyper runtimes

func (*HyperBuilder) Benchmark

func (b *HyperBuilder) Benchmark() error

Benchmark runs the benchmark command on hyper

func (*HyperBuilder) Cleanup

func (b *HyperBuilder) Cleanup() error

Cleanup cleans up containers on hyper

func (*HyperBuilder) Display

func (b *HyperBuilder) Display() error

Display writes the benchmark output to stdout

func (*HyperBuilder) Init

func (b *HyperBuilder) Init() error

Init does requirements checks and sets up necessary variables

func (*HyperBuilder) PrepareImage

func (b *HyperBuilder) PrepareImage() error

PrepareImage pulls the base image and run `before` commands

func (*HyperBuilder) Report

func (b *HyperBuilder) Report() reporter.ReportData

Report returns data for being later written to fs

func (*HyperBuilder) SetupContainer

func (b *HyperBuilder) SetupContainer() error

SetupContainer creates the container on hyper

type LocalBuilder

type LocalBuilder struct {
	Image          string         // runtime base image
	Command        []string       // benchmark command
	Before         []string       // commands to run before bench
	ID             string         // benchmark container id
	Client         *client.Client // docker client
	Results        string         // benchmark output
	BenchmarkImage string         // if `before` is set a new image is created
	Context        context.Context
}

LocalBuilder is the local struct for managing with local runtimes

func (*LocalBuilder) Benchmark

func (l *LocalBuilder) Benchmark() error

Benchmark runs the benchmark command

func (*LocalBuilder) Cleanup

func (l *LocalBuilder) Cleanup() error

Cleanup cleans up containers used for benchmarking

func (*LocalBuilder) Display

func (l *LocalBuilder) Display() error

Display writes the benchmark output to stdout

func (*LocalBuilder) Init

func (l *LocalBuilder) Init() error

Init initializes necessary variables

func (*LocalBuilder) PrepareImage

func (l *LocalBuilder) PrepareImage() error

PrepareImage pulls the base image and run `before` commands

func (*LocalBuilder) Report

func (l *LocalBuilder) Report() reporter.ReportData

Report returns data for being later written to fs

func (*LocalBuilder) SetupContainer

func (l *LocalBuilder) SetupContainer() error

SetupContainer creates the final benchmark container locally

type RuntimeBuilder

type RuntimeBuilder interface {
	Init() error
	PrepareImage() error
	SetupContainer() error
	Cleanup() error
	Benchmark() error
	Report() reporter.ReportData
	Display() error
}

RuntimeBuilder is the interface that defines how to build runtime environments

Jump to

Keyboard shortcuts

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