runenv

package
v0.0.0-...-b274fa0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEnv

type BaseEnv struct {
	// WorkDir contains any files created by the env
	WorkDir string
	// Ctx controls the lifecycle: when it's done, everything gets cleaned up
	Ctx context.Context
	// The env terminates as soon as Ctx is done or a member of the group returns
	// an error.
	*errgroup.Group
}

func NewBaseEnv

func NewBaseEnv(ctx context.Context, workDir string) (*BaseEnv, error)

func (*BaseEnv) Context

func (b *BaseEnv) Context() context.Context

type DockerEnv

type DockerEnv struct {
	BaseEnv
	BinMgr    binaries.Manager
	DockerAPI *dockerapi.Client
	NetConf   yurt.NetworkConfig
	// contains filtered or unexported fields
}

func NewDockerEnv

func NewDockerEnv(ctx context.Context, binMgr binaries.Manager, name, workDir, cidr string) (*DockerEnv, error)

func NewDockerTestEnv

func NewDockerTestEnv(t *testing.T, timeout time.Duration) (*DockerEnv, func())

func (*DockerEnv) AllocNode

func (d *DockerEnv) AllocNode(baseName string, ports yurt.Ports) (yurt.Node, error)

func (*DockerEnv) Run

func (d *DockerEnv) Run(ctx context.Context, cmd runner.Command, node yurt.Node) (runner.Harness, error)

type Env

type Env interface {
	// Run starts the specified command as the requested node.
	Run(ctx context.Context, cmd runner.Command, node yurt.Node) (runner.Harness, error)
	AllocNode(baseName string, ports yurt.Ports) (yurt.Node, error)
	Context() context.Context
	Go(f func() error)
}

type ExecEnv

type ExecEnv struct {
	BaseEnv

	LogToFiles bool
	// contains filtered or unexported fields
}

func NewExecEnv

func NewExecEnv(ctx context.Context, name, workDir string, firstPort int, binmgr binaries.Manager) (*ExecEnv, error)

func NewExecTestEnv

func NewExecTestEnv(t *testing.T, timeout time.Duration) (*ExecEnv, func())

func (ExecEnv) AllocNode

func (e ExecEnv) AllocNode(baseName string, ports yurt.Ports) (yurt.Node, error)

func (ExecEnv) Run

func (e ExecEnv) Run(ctx context.Context, cmd runner.Command, node yurt.Node) (runner.Harness, error)

type MonitoredEnv

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

MonitoredEnv runs a Prometheus server whose targets are configured dynamically as we start them. Prometheus is run locally as a sub-process. TODO make it possible to run Prometheus via any env with network access to the monitored targets.

func NewMonitoredEnv

func NewMonitoredEnv(parent, ex Env) (*MonitoredEnv, error)

func NewMonitoredExecTestEnv

func NewMonitoredExecTestEnv(t *testing.T, timeout time.Duration) (*MonitoredEnv, func())

func (*MonitoredEnv) AllocNode

func (e *MonitoredEnv) AllocNode(baseName string, ports yurt.Ports) (yurt.Node, error)

func (*MonitoredEnv) Context

func (e *MonitoredEnv) Context() context.Context

func (*MonitoredEnv) Go

func (e *MonitoredEnv) Go(f func() error)

func (*MonitoredEnv) PromAddr

func (e *MonitoredEnv) PromAddr() *runner.APIConfig

func (*MonitoredEnv) Run

func (e *MonitoredEnv) Run(ctx context.Context, cmd runner.Command, node yurt.Node) (runner.Harness, error)

Jump to

Keyboard shortcuts

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