commonexecutors

package
v0.0.0-...-9994f1b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package commonexecutors contains the definitions of the commonly used executors.

Index

Constants

View Source
const (
	CtrExecutorType       interfaces.ExecutorType = "CtrExecutor"
	ContainerExecutorType interfaces.ExecutorType = "ContainerExecutor"

	// For testing purpose only
	NoExecutorType interfaces.ExecutorType = "NoExecutor"
)

All supported common executor types.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerExecutor

type ContainerExecutor struct {
	*interfaces.AbstractExecutor

	Ctr              *crostoolrunner.CrosToolRunner
	WaitGroups       []*sync.WaitGroup
	LogChannels      []chan<- bool
	ContainerChannel chan struct {
		interfaces.ContainerInterface
		// contains filtered or unexported fields
	}
	// KnownNetworks maps the network name to its ID.
	KnownNetworks map[string]string
	// contains filtered or unexported fields
}

ContainerExecutor represents executor for all container related commands.

func (*ContainerExecutor) CloseLogs

func (ex *ContainerExecutor) CloseLogs() error

CloseLogs signals to the streaming logs through their channels that they can close.

func (*ContainerExecutor) ExecuteCommand

func (ex *ContainerExecutor) ExecuteCommand(ctx context.Context, cmdInterface interfaces.CommandInterface) error

func (*ContainerExecutor) ReadLogs

func (ex *ContainerExecutor) ReadLogs(ctx context.Context) error

func (*ContainerExecutor) Start

func (ex *ContainerExecutor) Start(
	ctx context.Context,
	contReq *api.ContainerRequest,
	template *api.Template,
	containerImage string,
	bbID int64) (interfaces.ContainerInterface, *labapi.IpEndpoint, error)

Start starts the container.

type CtrExecutor

type CtrExecutor struct {
	*interfaces.AbstractExecutor

	Ctr                        *crostoolrunner.CrosToolRunner
	CrosProvisionServiceClient testapi.GenericProvisionServiceClient
}

CtrExecutor represents executor for all crostoolrunner (ctr) related commands.

func NewCtrExecutor

func NewCtrExecutor(ctr *crostoolrunner.CrosToolRunner) *CtrExecutor

func (*CtrExecutor) ExecuteCommand

func (ex *CtrExecutor) ExecuteCommand(ctx context.Context, cmdInterface interfaces.CommandInterface) error

func (*CtrExecutor) GcloudAuth

func (ex *CtrExecutor) GcloudAuth(ctx context.Context, dockerKeyFileLocation string, useDockerKeyDirectly bool) error

GcloudAuth does the gcloud auth through ctr.

func (*CtrExecutor) StartAsync

func (ex *CtrExecutor) StartAsync(ctx context.Context) error

StartAsync starts the ctr server asynchronously.

func (*CtrExecutor) Stop

func (ex *CtrExecutor) Stop(ctx context.Context) error

Stop stops the ctr server.

Jump to

Keyboard shortcuts

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