aws

package
v0.0.0-...-82e5c22 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 28 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Nodes []*Node

	InstanceType       string
	CleanupWait        bool
	RunInstancesConfig func(*ec2.RunInstancesInput) error
	// contains filtered or unexported fields
}

func NewCluster

func NewCluster() *Cluster

NewCluster creates a new AWS cluster. This uses standard AWS profile env vars. With no configuration, this uses the default profile. The user/role used must have the appropriate permissions for the test runner, in order to find the resources in the account and launch/destroy EC2 instances.

By default, this looks for the node agent binary by searching up from PWD for a "nodeagent" file.

func (*Cluster) Cleanup

func (c *Cluster) Cleanup(ctx context.Context) error

func (*Cluster) Context

func (c *Cluster) Context(ctx context.Context) *Cluster

func (*Cluster) NewNode

func (c *Cluster) NewNode(ctx context.Context) (clusteriface.Node, error)

func (*Cluster) NewNodes

func (c *Cluster) NewNodes(ctx context.Context, n int) (clusteriface.Nodes, error)

func (*Cluster) WithAMIID

func (c *Cluster) WithAMIID(amiID string) *Cluster

func (*Cluster) WithCleanupWait

func (c *Cluster) WithCleanupWait() *Cluster

WithCleanupWait causes the Cleanup methods to wait for instance termination to succeed before returning.

func (*Cluster) WithInstanceType

func (c *Cluster) WithInstanceType(s string) *Cluster

func (*Cluster) WithLogger

func (c *Cluster) WithLogger(l *zap.SugaredLogger) *Cluster

func (*Cluster) WithNodeAgentBin

func (c *Cluster) WithNodeAgentBin(binPath string) *Cluster

func (*Cluster) WithRunInstancesInput

func (c *Cluster) WithRunInstancesInput(f func(input *ec2.RunInstancesInput) error) *Cluster

WithRunInstancesInput registers a callback for customizing RunInstances calls when new nodes are created.

func (*Cluster) WithSession

func (c *Cluster) WithSession(sess *session.Session) *Cluster

type Node

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

func (*Node) Dial

func (n *Node) Dial(ctx context.Context, network, addr string) (net.Conn, error)

func (*Node) Fetch

func (n *Node) Fetch(ctx context.Context, url, path string) error

func (*Node) Heartbeat

func (n *Node) Heartbeat(ctx context.Context) error

func (*Node) ReadFile

func (n *Node) ReadFile(ctx context.Context, path string) (io.ReadCloser, error)

func (*Node) SendFile

func (n *Node) SendFile(ctx context.Context, filePath string, contents io.Reader) error

func (*Node) StartProc

func (*Node) Stop

func (n *Node) Stop(ctx context.Context) error

func (*Node) String

func (n *Node) String() string

type Option

type Option func(c *Cluster)

Jump to

Keyboard shortcuts

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