instance

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MPL-2.0 Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// AgentImage is the image we'll use to create a working volume.
	AgentImage = "gcr.io/cirrus-ci-community/cirrus-ci-agent:v1.8.0"

	// Where working volume is mounted to.
	WorkingVolumeMountpoint = "/tmp/cirrus-ci"

	// Agent binary relative to the WorkingVolumeMountpoint.
	WorkingVolumeAgent = "cirrus-ci-agent"

	// Working directory relative to the WorkingVolumeMountpoint.
	WorkingVolumeWorkingDir = "working-dir"
)

Variables

View Source
var (
	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 RunDockerizedAgent added in v0.3.0

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

Types

type ContainerInstance added in v0.3.0

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

func (*ContainerInstance) Run added in v0.3.0

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

type Instance

type Instance interface {
	Run(context.Context, *RunConfig) error
}

func NewFromProto

func NewFromProto(instance *api.Task_Instance, commands []*api.Command) (Instance, error)

type Params added in v0.3.0

type Params struct {
	Image                  string
	CPU                    float32
	Memory                 uint32
	AdditionalContainers   []*api.AdditionalContainer
	CommandFrom, CommandTo string
	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) error

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) error

type RunConfig

type RunConfig struct {
	ProjectDir                 string
	Endpoint                   string
	ServerSecret, ClientSecret string
	TaskID                     int64
	Logger                     *echelon.Logger
	DirtyMode                  bool
}

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, projectDir string, dontPopulate bool) (*Volume, error)

CreateWorkingVolume returns a Docker volume name with the agent and copied projectDir.

func CreateWorkingVolumeFromConfig added in v0.3.0

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

CreateWorkingVolume returns a Docker volume name with the agent and copied projectDir.

func (*Volume) Close added in v0.3.0

func (volume *Volume) Close() 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