instance

package
v0.32.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedToCreateInstance    = errors.New("failed to create instance")
	ErrUnsupportedInstance       = errors.New("unsupported instance type")
	ErrAdditionalContainerFailed = errors.New("additional container failed")
)
View Source
var (
	ErrVolumeCreationFailed = errors.New("working volume creation failed")
	ErrVolumeCleanupFailed  = errors.New("failed to clean up working volume")
)
View Source
var ErrPipeCreationFailed = errors.New("failed to create pipe instance")

Functions

func CreateTempArchive added in v0.3.0

func CreateTempArchive(dir string) (string, error)

func NewFromProto

func NewFromProto(anyInstance *any.Any, commands []*api.Command) (abstract.Instance, error)

func RunContainerizedAgent added in v0.17.0

func RunContainerizedAgent(ctx context.Context, config *runconfig.RunConfig, params *Params) error

Types

type ContainerInstance added in v0.3.0

type ContainerInstance struct {
	Image                string
	CPU                  float32
	Memory               uint32
	AdditionalContainers []*api.AdditionalContainer
	Platform             platform.Platform
}

func (*ContainerInstance) Run added in v0.3.0

func (inst *ContainerInstance) Run(ctx context.Context, config *runconfig.RunConfig) (err error)

func (*ContainerInstance) WorkingDirectory added in v0.16.0

func (inst *ContainerInstance) WorkingDirectory(projectDir string, dirtyMode bool) string

type Params added in v0.3.0

type Params struct {
	Image                  string
	CPU                    float32
	Memory                 uint32
	AdditionalContainers   []*api.AdditionalContainer
	CommandFrom, CommandTo string
	Platform               platform.Platform
	WorkingVolumeName      string
}

type PipeInstance added in v0.3.0

type PipeInstance struct {
	Stages []PipeStage
	CPU    float32
	Memory uint32
}

func (*PipeInstance) Run added in v0.3.0

func (pi *PipeInstance) Run(ctx context.Context, config *runconfig.RunConfig) (err error)

func (*PipeInstance) WorkingDirectory added in v0.16.0

func (pi *PipeInstance) WorkingDirectory(projectDir string, dirtyMode bool) string

type PipeStage added in v0.3.0

type PipeStage struct {
	Image                  string
	CommandFrom, CommandTo string
}

func PipeStagesFromCommands added in v0.3.0

func PipeStagesFromCommands(commands []*api.Command) ([]PipeStage, error)

PipeStagesFromCommands uses image hints in commands to build the stages.

type PrebuiltInstance added in v0.3.0

type PrebuiltInstance struct {
	Image      string
	Dockerfile string
	Arguments  map[string]string
}

func (*PrebuiltInstance) Run added in v0.3.0

func (prebuilt *PrebuiltInstance) Run(ctx context.Context, config *runconfig.RunConfig) error

func (*PrebuiltInstance) WorkingDirectory added in v0.16.0

func (prebuilt *PrebuiltInstance) WorkingDirectory(projectDir string, dirtyMode bool) string

type Volume added in v0.3.0

type Volume struct {
	// contains filtered or unexported fields
}

func CreateWorkingVolume added in v0.3.0

func CreateWorkingVolume(
	ctx context.Context,
	backend containerbackend.ContainerBackend,
	containerOptions options.ContainerOptions,
	name string,
	projectDir string,
	dontPopulate bool,
	agentVersion string,
	platform platform.Platform,
) (vol *Volume, err error)

CreateWorkingVolume returns name of the working volume created according to the specification in arguments.

func CreateWorkingVolumeFromConfig added in v0.3.0

func CreateWorkingVolumeFromConfig(
	ctx context.Context,
	config *runconfig.RunConfig,
	platform platform.Platform,
) (*Volume, error)

CreateWorkingVolumeFromConfig returns name of the working volume created according to the specification in config.

func (*Volume) Close added in v0.3.0

func (volume *Volume) Close(backend containerbackend.ContainerBackend) error

func (*Volume) Name added in v0.3.0

func (volume *Volume) Name() string

Jump to

Keyboard shortcuts

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