boot

package
v0.0.0-...-c92af4d Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: AGPL-3.0, Apache-2.0, CC-BY-SA-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command cmd.Handler = bootCommand{}

Functions

This section is empty.

Types

type Supervisor

type Supervisor struct {
	SourcePath           string // e.g., /home/username/src/arvados
	SourceVersion        string // e.g., acbd1324...
	ClusterType          string // e.g., production
	ListenHost           string // e.g., localhost
	ControllerAddr       string // e.g., 127.0.0.1:8000
	NoWorkbench1         bool
	OwnTemporaryDatabase bool
	Stderr               io.Writer
	// contains filtered or unexported fields
}

func (*Supervisor) Cluster

func (super *Supervisor) Cluster() *arvados.Cluster

func (*Supervisor) RunProgram

func (super *Supervisor) RunProgram(ctx context.Context, dir string, opts runOptions, prog string, args ...string) error

RunProgram runs prog with args, using dir as working directory. If ctx is cancelled while the child is running, RunProgram terminates the child, waits for it to exit, then returns.

Child's environment will have our env vars, plus any given in env.

Child's stdout will be written to output if non-nil, otherwise the boot command's stderr.

func (*Supervisor) Start

func (super *Supervisor) Start(ctx context.Context, cfg *arvados.Config, cfgPath string)

func (*Supervisor) Stop

func (super *Supervisor) Stop()

func (*Supervisor) Wait

func (super *Supervisor) Wait() error

func (*Supervisor) WaitReady

func (super *Supervisor) WaitReady() (*arvados.URL, bool)

type TestCluster

type TestCluster struct {
	Super         Supervisor
	Config        arvados.Config
	ControllerURL *url.URL
	ClusterID     string
}

TestCluster stores a working test cluster data

func NewTestCluster

func NewTestCluster(srcPath, clusterID string, cfg *arvados.Config, listenHost string, logWriter func(...interface{})) *TestCluster

NewTestCluster loads the provided configuration, and sets up a test cluster ready for being started.

func (*TestCluster) AnonymousClients

func (tc *TestCluster) AnonymousClients() (context.Context, *arvados.Client, *keepclient.KeepClient)

AnonymousClients returns Context, arvados.Client and keepclient structs initialized to communicate with the cluster as the anonymous user.

func (*TestCluster) ClientsWithToken

func (tc *TestCluster) ClientsWithToken(token string) (context.Context, *arvados.Client, *keepclient.KeepClient)

ClientsWithToken returns Context, Arvados.Client and keepclient structs initialized to connect to the cluster with the supplied Arvados token.

func (*TestCluster) Conn

func (tc *TestCluster) Conn() *rpc.Conn

Conn gets rpc connection struct initialized to communicate with the specified cluster.

func (*TestCluster) RootClients

func (tc *TestCluster) RootClients() (context.Context, *arvados.Client, *keepclient.KeepClient)

RootClients returns Context, arvados.Client and keepclient structs initialized to communicate with the cluster as the system root user.

func (*TestCluster) Start

func (tc *TestCluster) Start()

Start the test cluster.

func (*TestCluster) UserClients

func (tc *TestCluster) UserClients(rootctx context.Context, c *check.C, conn *rpc.Conn, authEmail string, activate bool) (context.Context, *arvados.Client, *keepclient.KeepClient, arvados.User)

UserClients logs in as a user called "example", get the user's API token, initialize clients with the API token, set up the user and optionally activate the user. Return client structs for communicating with the cluster on behalf of the 'example' user.

func (*TestCluster) WaitReady

func (tc *TestCluster) WaitReady() bool

WaitReady waits for all components to report healthy, and finishes setting up the TestCluster struct.

Jump to

Keyboard shortcuts

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