util

package
v0.0.0-...-f852ded Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2018 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPublicConnections

func CheckPublicConnections(t *testing.T, machines []db.Machine,
	containers []db.Container, connections []db.Connection)

CheckPublicConnections test that HTTP GETs against all ports that are connected to the public internet succeed.

func GetCurrentBlueprint

func GetCurrentBlueprint(c client.Client) (blueprint.Blueprint, error)

GetCurrentBlueprint returns the blueprint currently deployed by the daemon.

func GetDefaultDaemonClient

func GetDefaultDaemonClient() (client.Client, connection.Credentials, error)

GetDefaultDaemonClient gets an API client connected to the daemon on the default socket with the default TLS credentials.

func WaitForContainers

func WaitForContainers(bp blueprint.Blueprint) error

WaitForContainers blocks until either all containers in the given blueprint have been booted, or 10 minutes have passed.

Types

type SSHUtil

type SSHUtil struct {
	ssh.Client
	// contains filtered or unexported fields
}

SSHUtil makes it easy to parallelize executing commands on Kelda containers.

It does several things to make executing commands faster: 1. It reuses SSH connections.

2. It caches state. Shelling out to `kelda ssh` requires requerying all machines and containers in order to figure out the leader's IP address.

3. It rate limits the number of parallel sessions to avoid overloading the remote host.

func NewSSHUtil

func NewSSHUtil(machines []db.Machine, creds connection.Credentials) (SSHUtil, error)

NewSSHUtil creates a new SSHUtil instance configured to connect to containers on the given machines. Any calls to `SSHUtil.SSH` for a container scheduled on a machine not given here will fail.

func (SSHUtil) SSH

func (sshUtil SSHUtil) SSH(dbc db.Container, containerCmd ...string) (string, error)

SSH executes `cmd` on the given container, and returns the stdout and stderr output of the command in a single string.

Jump to

Keyboard shortcuts

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