executors

package
v0.0.0-...-3a98d3a Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AndroidDutExecutorType         interfaces.ExecutorType = "AndroidDutExecutor"
	AndroidProvisionExecutorType   interfaces.ExecutorType = "AndroidProvisionExecutor"
	InvServiceExecutorType         interfaces.ExecutorType = "InvServiceExecutor"
	CacheServerExecutorType        interfaces.ExecutorType = "CacheServerExecutor"
	CrosDutExecutorType            interfaces.ExecutorType = "CrosDutExecutor"
	CrosDutVmExecutorType          interfaces.ExecutorType = "CrosDutVmExecutor"
	CrosProvisionExecutorType      interfaces.ExecutorType = "CrosProvisionExecutor"
	CrosVMProvisionExecutorType    interfaces.ExecutorType = "CrosVMProvisionExecutor"
	CrosTestExecutorType           interfaces.ExecutorType = "CrosTestExecutor"
	CrosTestFinderExecutorType     interfaces.ExecutorType = "CrosTestFinderExecutor"
	CrosGcsPublishExecutorType     interfaces.ExecutorType = "CrosGcsPublishExecutor"
	CrosTkoPublishExecutorType     interfaces.ExecutorType = "CrosTkoPublishExecutor"
	CrosRdbPublishExecutorType     interfaces.ExecutorType = "CrosRdbPublishExecutor"
	CrosPublishExecutorType        interfaces.ExecutorType = "CrosPublishExecutor"
	SshTunnelExecutorType          interfaces.ExecutorType = "SshTunnelExecutor"
	GenericProvisionExecutorType   interfaces.ExecutorType = "GenericProvisionExecutor"
	GenericTestsExecutorType       interfaces.ExecutorType = "GenericTestsExecutor"
	GenericPostProcessExecutorType interfaces.ExecutorType = "GenericPostProcessExecutor"
	GenericPublishExecutorType     interfaces.ExecutorType = "GenericPublishExecutor"
	GenericServiceExecutorType     interfaces.ExecutorType = "GenericServiceExecutor"

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

All supported executor types.

View Source
const MaxPublishMsgSize = 1024 * 1024 * 400

MaxPublishMsgSize the maximum size of the publish request message that the cros-publish gRPC can receive is 400MB. TODO: Remove once streaming is implemented.

Variables

This section is empty.

Functions

This section is empty.

Types

type AndroidDutExecutor

type AndroidDutExecutor struct {
	*interfaces.AbstractExecutor

	NamePrefix              string
	Container               interfaces.ContainerInterface
	AndroidDutServiceClient testapi.DutServiceClient
	AndroidDutServerAddress *labapi.IpEndpoint
	ServerAddress           string
}

AndroidDutExecutor represents executor for all android-dut related commands.

func NewAndroidDutExecutor

func NewAndroidDutExecutor(container interfaces.ContainerInterface) *AndroidDutExecutor

func (*AndroidDutExecutor) ExecuteCommand

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

func (*AndroidDutExecutor) Start

func (ex *AndroidDutExecutor) Start(
	ctx context.Context,
	cacheServerAddress *labapi.IpEndpoint,
	androidDutSshAddress *labapi.IpEndpoint) error

Start starts the android-dut server.

type AndroidProvisionExecutor

type AndroidProvisionExecutor struct {
	*interfaces.AbstractExecutor

	Container                     interfaces.ContainerInterface
	AndroidProvisionServiceClient testapi.GenericProvisionServiceClient
	ServerAddress                 string
}

AndroidProvisionExecutor represents executor for all android provision related commands.

func NewAndroidProvisionExecutor

func NewAndroidProvisionExecutor(container interfaces.ContainerInterface) *AndroidProvisionExecutor

NewAndroidProvisionExecutor creates a new AndroidProvisionExecutor object.

func (*AndroidProvisionExecutor) ExecuteCommand

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

ExecuteCommand will execute relevant steps based on command type.

func (*AndroidProvisionExecutor) Install

Install invokes the provision install endpoint of android-provision.

func (*AndroidProvisionExecutor) Start

Start starts the android-provision server.

type CacheServerExecutor

type CacheServerExecutor struct {
	*interfaces.AbstractExecutor

	Container     interfaces.ContainerInterface
	ServerAddress string
}

CacheServerExecutor represents executor for all cache-server related commands.

func NewCacheServerExecutor

func NewCacheServerExecutor(container interfaces.ContainerInterface) *CacheServerExecutor

func (*CacheServerExecutor) ExecuteCommand

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

func (*CacheServerExecutor) Start

func (ex *CacheServerExecutor) Start(
	ctx context.Context) error

Start starts the cache server.

type CrosDutExecutor

type CrosDutExecutor struct {
	*interfaces.AbstractExecutor

	NamePrefix           string
	Container            interfaces.ContainerInterface
	CrosDutServiceClient testapi.DutServiceClient
	DutServerAddress     *labapi.IpEndpoint
	ServerAddress        string
}

CrosDutExecutor represents executor for all cros-dut related commands.

func NewCrosDutExecutor

func NewCrosDutExecutor(container interfaces.ContainerInterface) *CrosDutExecutor

func (*CrosDutExecutor) ExecuteCommand

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

func (*CrosDutExecutor) Start

func (ex *CrosDutExecutor) Start(
	ctx context.Context,
	cacheServerAddress *labapi.IpEndpoint,
	dutSshAddress *labapi.IpEndpoint) error

Start starts the cros-dut server.

type CrosDutVmExecutor

type CrosDutVmExecutor struct {
	*interfaces.AbstractExecutor

	// Dependencies for Injection
	Container   interfaces.ContainerInterface
	ImageApi    vmlabapi.ImageApi
	InstanceApi vmlabapi.InstanceApi
}

CrosDutVmExecutor implements the execution of the steps defined in supported DutVm-related commands.

func NewCrosDutVmExecutor

func NewCrosDutVmExecutor(container interfaces.ContainerInterface) *CrosDutVmExecutor

func (*CrosDutVmExecutor) ExecuteCommand

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

type CrosProvisionExecutor

type CrosProvisionExecutor struct {
	*interfaces.AbstractExecutor

	Container                  interfaces.ContainerInterface
	CrosProvisionServiceClient testapi.GenericProvisionServiceClient
	ServerAddress              string
}

CrosProvisionExecutor represents executor for all cros-provision related commands.

func NewCrosProvisionExecutor

func NewCrosProvisionExecutor(container interfaces.ContainerInterface) *CrosProvisionExecutor

func (*CrosProvisionExecutor) ExecuteCommand

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

func (*CrosProvisionExecutor) Install

Install invokes the provision install endpoint of cros-provision.

func (*CrosProvisionExecutor) Start

func (ex *CrosProvisionExecutor) Start(
	ctx context.Context,
	provisionInputReq *testapi.CrosProvisionRequest) error

Start starts the cros-provision server.

func (*CrosProvisionExecutor) StartUp

type CrosPublishExecutor

type CrosPublishExecutor struct {
	*interfaces.AbstractExecutor

	Container                 interfaces.ContainerInterface
	GcsPublishServiceClient   testapi.GenericPublishServiceClient
	TkoPublishServiceClient   testapi.GenericPublishServiceClient
	CpconPublishServiceClient testapi.GenericPublishServiceClient
	RdbPublishServiceClient   testapi.GenericPublishServiceClient
	ServerAddress             string
}

CrosPublishExecutor represents executor for all cros-publish related commands.

func NewCrosPublishExecutor

func NewCrosPublishExecutor(
	container interfaces.ContainerInterface,
	execType interfaces.ExecutorType) *CrosPublishExecutor

func (*CrosPublishExecutor) ExecuteCommand

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

func (*CrosPublishExecutor) InvokePublishWithAsyncLogging

func (ex *CrosPublishExecutor) InvokePublishWithAsyncLogging(
	ctx context.Context,
	publishType string,
	request *api.PublishRequest,
	client api.GenericPublishServiceClient,
	step *build.Step) error

InvokePublishWithAsyncLogging invokes publish endpoint of the service with async logging.

func (*CrosPublishExecutor) Publish

Publish invokes the publish endpoint of cros-publish.

func (*CrosPublishExecutor) Start

Start starts the cros-publish server.

type CrosTestExecutor

type CrosTestExecutor struct {
	*interfaces.AbstractExecutor

	Container             interfaces.ContainerInterface
	CrosTestServiceClient testapi.ExecutionServiceClient
	ServerAddress         string
}

CrosTestExecutor represents executor for all cros-test related commands.

func NewCrosTestExecutor

func NewCrosTestExecutor(container interfaces.ContainerInterface) *CrosTestExecutor

func (*CrosTestExecutor) ExecuteCommand

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

func (*CrosTestExecutor) ExecuteTests

ExecuteTests invokes the run tests endpoint of cros-test.

func (*CrosTestExecutor) Start

func (ex *CrosTestExecutor) Start(ctx context.Context) error

Start starts the cros-test server.

type CrosTestFinderExecutor

type CrosTestFinderExecutor struct {
	*interfaces.AbstractExecutor

	Container                   interfaces.ContainerInterface
	CrosTestFinderServiceClient testapi.TestFinderServiceClient
	ServerAddress               string
}

CrosTestFinderExecutor represents executor for all cros-test-finder related commands.

func NewCrosTestFinderExecutor

func NewCrosTestFinderExecutor(container interfaces.ContainerInterface) *CrosTestFinderExecutor

func (*CrosTestFinderExecutor) ExecuteCommand

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

func (*CrosTestFinderExecutor) FindTests

ExecuteTests invokes the run tests endpoint of cros-test.

func (*CrosTestFinderExecutor) Start

Start starts the cros-test-finder server.

type CrosVMProvisionExecutor

type CrosVMProvisionExecutor struct {
	*interfaces.AbstractExecutor

	Container                    interfaces.ContainerInterface
	CrosVMProvisionServiceClient testapi.GenericProvisionServiceClient
	ServerAddress                string
}

CrosVMProvisionExecutor represents executor for all vm-provision related commands.

func NewCrosVMProvisionExecutor

func NewCrosVMProvisionExecutor(container interfaces.ContainerInterface) *CrosVMProvisionExecutor

NewCrosVMProvisionExecutor creates a new CrosVMProvisionExecutor object.

func (*CrosVMProvisionExecutor) ExecuteCommand

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

ExecuteCommand will execute relevant steps based on command type.

func (*CrosVMProvisionExecutor) LeaseDutVM

LeaseDutVM invokes the provision install endpoint of vm-provision.

func (*CrosVMProvisionExecutor) ReleaseDutVM

ReleaseDutVM invokes the provision install endpoint of vm-provision.

func (*CrosVMProvisionExecutor) Start

Start starts the vm-provision server.

type GenericPostProcessExecutor

type GenericPostProcessExecutor struct {
	*interfaces.AbstractExecutor
}

GenericPostProcessExecutor represents executor for all post process related commands.

func NewGenericPostProcessExecutor

func NewGenericPostProcessExecutor() *GenericPostProcessExecutor

NewGenericPostProcessExecutor creates a new generic post process executor.

func (*GenericPostProcessExecutor) ConnectToService

ConnectToService connects to the GenericPostProcessService attached to the server address.

func (*GenericPostProcessExecutor) ExecuteCommand

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

func (*GenericPostProcessExecutor) GenericPostProcessHandler

func (ex *GenericPostProcessExecutor) GenericPostProcessHandler(
	ctx context.Context,
	cmd *commands.GenericPostProcessCmd) (err error)

GenericPostProcessHandler executes the post process commands.

func (*GenericPostProcessExecutor) RunActivities

RunActivities invokes the RunActivities endpoint of the PostProcessServiceClient.

func (*GenericPostProcessExecutor) StartUp

StartUp invokes the StartUp endpoint of the PostProcessServiceClient.

type GenericProvisionExecutor

type GenericProvisionExecutor struct {
	*interfaces.AbstractExecutor
}

GenericProvisionExecutor represents executor for all cros-provision related commands.

func NewGenericProvisionExecutor

func NewGenericProvisionExecutor() *GenericProvisionExecutor

func (*GenericProvisionExecutor) ConnectToService

ConnectToService connects to the GenericProvisionService attached to the server address.

func (*GenericProvisionExecutor) ExecuteCommand

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

func (*GenericProvisionExecutor) Install

Startup invokces the StartUp endpoint of the GenericProvisionServiceClient

func (*GenericProvisionExecutor) Startup

Startup invokces the StartUp endpoint of the GenericProvisionServiceClient

type GenericPublishExecutor

type GenericPublishExecutor struct {
	*interfaces.AbstractExecutor
}

GenericPublishExecutor represents executor for all publish related commands.

func NewGenericPublishExecutor

func NewGenericPublishExecutor() *GenericPublishExecutor

func (*GenericPublishExecutor) ConnectToService

ConnectToService connects to the GenericPublishServiceClient attached to the server address.

func (*GenericPublishExecutor) ExecuteCommand

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

func (*GenericPublishExecutor) Publish

Publish invokces the Publish endpoint of the GenericPublishServiceClient

type GenericServiceExecutor

type GenericServiceExecutor struct {
	*interfaces.AbstractExecutor
}

GenericServiceExecutor represents executor for all cros-generic related commands.

func NewGenericServiceExecutor

func NewGenericServiceExecutor() *GenericServiceExecutor

func (*GenericServiceExecutor) ConnectToService

func (ex *GenericServiceExecutor) ConnectToService(
	ctx context.Context,
	endpoint *labapi.IpEndpoint) (api.GenericServiceClient, error)

ConnectToService connects to the GenericServiceService attached to the server address.

func (*GenericServiceExecutor) ExecuteCommand

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

func (*GenericServiceExecutor) GenericServiceHandler

func (ex *GenericServiceExecutor) GenericServiceHandler(
	ctx context.Context,
	cmd *commands.GenericServiceCmd) (err error)

GenericServiceHandler executes the generic start command.

func (*GenericServiceExecutor) Run

Run invokces the Run endpoint of the GenericServiceClient

func (*GenericServiceExecutor) Start

Start invokces the Start endpoint of the GenericServiceClient

func (*GenericServiceExecutor) Stop

Stop invokces the Stop endpoint of the GenericServiceClient

type GenericTestsExecutor

type GenericTestsExecutor struct {
	*interfaces.AbstractExecutor
}

GenericTestsExecutor represents executor for all test execution related commands.

func NewGenericTestsExecutor

func NewGenericTestsExecutor() *GenericTestsExecutor

func (*GenericTestsExecutor) ConnectToService

func (ex *GenericTestsExecutor) ConnectToService(
	ctx context.Context,
	endpoint *labapi.IpEndpoint) (api.ExecutionServiceClient, error)

ConnectToService connects to the ExecutionServiceClient attached to the server address.

func (*GenericTestsExecutor) ExecuteCommand

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

func (*GenericTestsExecutor) RunTests

RunTests invokces the RunTests endpoint of the ExecutionServiceClient

type InvServiceExecutor

type InvServiceExecutor struct {
	*interfaces.AbstractExecutor

	InventoryServiceAddress string
	InventoryServiceClient  labapi.InventoryServiceClient
	GrpcConn                *grpc.ClientConn
	DutTopology             *labapi.DutTopology
}

CrosProvisionExecutor represents executor for all inventory service related commands.

func NewInvServiceExecutor

func NewInvServiceExecutor(inventoryServiceAddress string) *InvServiceExecutor

NewInvServiceExecutor creates a new InvServiceExecutor object. inventoryServiceAddress argument is optional. If not provided, defaultLabInventoryServiceAddress will be used.

func (*InvServiceExecutor) ExecuteCommand

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

func (*InvServiceExecutor) GetDUTTopology

func (ex *InvServiceExecutor) GetDUTTopology(
	ctx context.Context,
	hostName string) (*labapi.DutTopology, error)

GetDUTTopology invokes the get dut topology endpoint of inventory service.

func (*InvServiceExecutor) Start

func (ex *InvServiceExecutor) Start(ctx context.Context, invServerAddress string) error

Start establishes a connection to inventory service.

func (*InvServiceExecutor) Stop

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

Stop closes the established connection to inventory service.

type SshTunnelExecutor

type SshTunnelExecutor struct {
	*interfaces.AbstractExecutor

	SshTunnelCmd        *exec.Cmd
	SshReverseTunnelCmd *exec.Cmd
}

SshTunnelExecutor represents executor for all ssh related commands.

func NewSshTunnelExecutor

func NewSshTunnelExecutor() *SshTunnelExecutor

func (*SshTunnelExecutor) ExecuteCommand

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

Jump to

Keyboard shortcuts

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