containers

package
v0.0.0-...-d996d1d Latest Latest
Warning

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

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

Documentation

Overview

Package containers defines all container types.

Index

Constants

View Source
const (
	// For testing purposes only
	UnsupportedContainerType               interfaces.ContainerType = "UnsupportedContainer"
	AndroidDutTemplatedContainerType       interfaces.ContainerType = "AndroidDutTemplatedContainer"
	AndroidProvisionTemplatedContainerType interfaces.ContainerType = "AndroidProvisionTemplatedContainer"
	CacheServerTemplatedContainerType      interfaces.ContainerType = "CacheServerTemplatedContainer"
	CrosProvisionTemplatedContainerType    interfaces.ContainerType = "CrosProvisionTemplatedContainer"
	CrosVMProvisionTemplatedContainerType  interfaces.ContainerType = "CrosVMProvisionTemplatedContainer"
	CrosDutTemplatedContainerType          interfaces.ContainerType = "CrosDutTemplatedContainer"
	CrosTestTemplatedContainerType         interfaces.ContainerType = "CrosTestTemplatedContainer"
	CrosTestFinderTemplatedContainerType   interfaces.ContainerType = "CrosTestFinderTemplatedContainer"
	CrosGcsPublishTemplatedContainerType   interfaces.ContainerType = "CrosGcsPublishTemplatedContainer"
	CrosTkoPublishTemplatedContainerType   interfaces.ContainerType = "CrosTkoPublishTemplatedContainer"
	CrosRdbPublishTemplatedContainerType   interfaces.ContainerType = "CrosRdbPublishTemplatedContainer"
	CrosPublishTemplatedContainerType      interfaces.ContainerType = "CrosPublishTemplatedContainer"
	GenericProvisionTemplatedContainerType interfaces.ContainerType = "GenericProvisionTemplatedContainer"
	PostProcessTemplatedContainerType      interfaces.ContainerType = "PostProcessTemplatedContainer"
)

All supported container types.

Variables

This section is empty.

Functions

func GetContainerImageKeyFromContainerType

func GetContainerImageKeyFromContainerType(containerType interfaces.ContainerType) string

GetContainerImageKeyFromContainerType converts a ContainerType to its commonly known string representation.

func NewAndroidDutTemplatedContainer

func NewAndroidDutTemplatedContainer(
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface

func NewCacheServerTemplatedContainer

func NewCacheServerTemplatedContainer(
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface

func NewContainer

func NewContainer(
	contType interfaces.ContainerType,
	namePrefix string,
	network string,
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner,
	isTemplated bool) interfaces.ContainerInterface

func NewCrosDutTemplatedContainer

func NewCrosDutTemplatedContainer(
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface

func NewCrosProvisionTemplatedContainer

func NewCrosProvisionTemplatedContainer(
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface

func NewCrosPublishTemplatedContainer

func NewCrosPublishTemplatedContainer(
	contType interfaces.ContainerType,
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface

func NewCrosTestFinderTemplatedContainer

func NewCrosTestFinderTemplatedContainer(
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface

func NewCrosTestTemplatedContainer

func NewCrosTestTemplatedContainer(
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface

func NewCrosVMProvisionTemplatedContainer

func NewCrosVMProvisionTemplatedContainer(
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface

func NewGenericProvisionTemplatedContainer

func NewGenericProvisionTemplatedContainer(
	namePrefix string,
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface

func NewGenericTemplatedContainer

func NewGenericTemplatedContainer(
	contType interfaces.ContainerType,
	containerImage string,
	namePrefix string,
	ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface

func NewPostProcessTemplatedContainer

func NewPostProcessTemplatedContainer(
	contType interfaces.ContainerType,
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) interfaces.ContainerInterface

NewPostProcessTemplatedContainer creates a new templated post-process container.

Types

type AbstractContainer

type AbstractContainer struct {
	interfaces.ContainerInterface

	Name       string
	Network    string
	TempDirLoc string

	ConcreteContainer  interfaces.ContainerInterface
	StartContainerResp *api.StartContainerResponse
	GetContainerResp   *api.GetContainerResponse
	// contains filtered or unexported fields
}

AbstractContainer represents abstract container.

func NewAbstractContainer

func NewAbstractContainer(
	contType interfaces.ContainerType,
	namePrefix string,
	network string,
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) AbstractContainer

func (*AbstractContainer) GetContainer

func (cont *AbstractContainer) GetContainer(ctx context.Context) (*api.GetContainerResponse, error)

GetContainer gets the container info.

func (*AbstractContainer) GetContainerType

func (cont *AbstractContainer) GetContainerType() interfaces.ContainerType

func (*AbstractContainer) GetLogsLocation

func (cont *AbstractContainer) GetLogsLocation() (string, error)

func (*AbstractContainer) InitializeBase

func (cont *AbstractContainer) InitializeBase(ctx context.Context) error

InitializeBase does initial work that is common to all containers.

func (*AbstractContainer) ProcessContainer

func (cont *AbstractContainer) ProcessContainer(
	ctx context.Context,
	template *api.Template) (string, error)

ProcessContainer processes(initialize, start, get, retrieve server address) the container.

func (*AbstractContainer) StopContainer

func (cont *AbstractContainer) StopContainer(ctx context.Context) error

StopContainer stop the container.

type ContainerState

type ContainerState string

ContainerState types

const (
	ContainerStateNotInitialized ContainerState = "NotInitialized"
	ContainerStateInitialized    ContainerState = "Initialized"
	ContainerStateStarted        ContainerState = "Started"
	ContainerStateStopped        ContainerState = "Stopped"
)

type NonTemplatedContainer

type NonTemplatedContainer struct {
	AbstractContainer

	LogsDirToMount string

	Network        string
	Volumes        []string
	Expose         []string
	EnvVars        []string
	StartCmd       []string
	TestResultsDir string

	StartContainerReq *api.StartContainerRequest
}

NonTemplatedContainer represents the cft non-templated container.

func NewNonTemplatedContainer

func NewNonTemplatedContainer(
	contType interfaces.ContainerType,
	namePrefix string,
	network string,
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) *NonTemplatedContainer

func (*NonTemplatedContainer) Initialize

func (cont *NonTemplatedContainer) Initialize(
	ctx context.Context,
	template *api.Template) error

Initialize initializes the container.

func (*NonTemplatedContainer) StartContainer

func (cont *NonTemplatedContainer) StartContainer(ctx context.Context) (*api.StartContainerResponse, error)

StartContainer starts the container.

type TemplatedContainer

type TemplatedContainer struct {
	AbstractContainer

	StartTemplatedContainerReq *api.StartTemplatedContainerRequest
}

TemplatedContainer represents the cft templated container.

func NewTemplatedContainer

func NewTemplatedContainer(contType interfaces.ContainerType,
	namePrefix string,
	network string,
	containerImage string,
	ctr *crostoolrunner.CrosToolRunner) *TemplatedContainer

func (*TemplatedContainer) Initialize

func (cont *TemplatedContainer) Initialize(
	ctx context.Context,
	template *api.Template) error

Initialize initializes the container.

func (*TemplatedContainer) StartContainer

func (cont *TemplatedContainer) StartContainer(ctx context.Context) (*api.StartContainerResponse, error)

StartContainer starts the container.

Jump to

Keyboard shortcuts

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