Documentation ¶
Index ¶
- Constants
- Variables
- func FinalTTL(ttl time.Duration) *time.Duration
- func NewGardenContainerSpecFactory(logger lager.Logger, baggageclaimClient baggageclaim.Client, ...) gardenContainerSpecFactory
- func NewHardcoded(logger lager.Logger, workerDB SaveWorkerDB, clock c.Clock, gardenAddr string, ...) ifrit.RunFunc
- type Client
- type Container
- type ContainerSpec
- type ExponentialRetryPolicy
- type GardenConnectionFactory
- type GardenConnectionFactoryDB
- type GardenWorkerDB
- type Identifier
- type Image
- type ImageFetcher
- type ImageFetchingDelegate
- type ImageMetadata
- type Metadata
- type MultiWorkerError
- type MultipleContainersError
- type MultipleWorkersFoundContainerError
- type NoCompatibleWorkersError
- type NoopImageFetchingDelegate
- type ResourceTypeContainerSpec
- type RetryPolicy
- type RetryableConnection
- func (conn *RetryableConnection) Attach(handle string, processID string, processIO garden.ProcessIO) (garden.Process, error)
- func (conn *RetryableConnection) Capacity() (garden.Capacity, error)
- func (conn *RetryableConnection) Create(spec garden.ContainerSpec) (string, error)
- func (conn *RetryableConnection) CurrentBandwidthLimits(handle string) (garden.BandwidthLimits, error)
- func (conn *RetryableConnection) CurrentCPULimits(handle string) (garden.CPULimits, error)
- func (conn *RetryableConnection) CurrentDiskLimits(handle string) (garden.DiskLimits, error)
- func (conn *RetryableConnection) CurrentMemoryLimits(handle string) (garden.MemoryLimits, error)
- func (conn *RetryableConnection) Destroy(handle string) error
- func (conn *RetryableConnection) Info(handle string) (garden.ContainerInfo, error)
- func (conn *RetryableConnection) LimitBandwidth(handle string, limits garden.BandwidthLimits) (garden.BandwidthLimits, error)
- func (conn *RetryableConnection) LimitCPU(handle string, limits garden.CPULimits) (garden.CPULimits, error)
- func (conn *RetryableConnection) LimitMemory(handle string, limits garden.MemoryLimits) (garden.MemoryLimits, error)
- func (conn *RetryableConnection) List(properties garden.Properties) ([]string, error)
- func (conn *RetryableConnection) NetIn(handle string, hostPort, containerPort uint32) (uint32, uint32, error)
- func (conn *RetryableConnection) NetOut(handle string, rule garden.NetOutRule) error
- func (conn *RetryableConnection) Ping() error
- func (conn *RetryableConnection) Property(handle string, name string) (string, error)
- func (conn *RetryableConnection) RemoveProperty(handle string, name string) error
- func (conn *RetryableConnection) Run(handle string, processSpec garden.ProcessSpec, processIO garden.ProcessIO) (garden.Process, error)
- func (conn *RetryableConnection) SetProperty(handle string, name string, value string) error
- func (conn *RetryableConnection) Stop(handle string, kill bool) error
- func (conn *RetryableConnection) StreamIn(handle string, spec garden.StreamInSpec) error
- func (conn *RetryableConnection) StreamOut(handle string, spec garden.StreamOutSpec) (io.ReadCloser, error)
- type SaveWorkerDB
- type Sleeper
- type TaskContainerSpec
- type Volume
- type VolumeFactory
- type VolumeFactoryDB
- type VolumeMount
- type Worker
- type WorkerDB
- type WorkerProvider
- type WorkerSpec
Constants ¶
View Source
const VolumeTTL = containerTTL
Variables ¶
View Source
var ( ErrNoWorkers = errors.New("no workers") ErrMissingWorker = errors.New("worker for container is missing") )
View Source
var ErrIncompatiblePlatform = errors.New("incompatible platform")
View Source
var ErrMismatchedTags = errors.New("mismatched tags")
View Source
var ErrMissingVolume = errors.New("volume mounted to container is missing")
View Source
var ErrMultipleWorkersWithName = errors.New("More than one worker has given worker name")
View Source
var ErrUnsupportedResourceType = errors.New("unsupported resource type")
Functions ¶
func NewGardenContainerSpecFactory ¶
func NewGardenContainerSpecFactory(logger lager.Logger, baggageclaimClient baggageclaim.Client, imageFetcher ImageFetcher) gardenContainerSpecFactory
func NewHardcoded ¶
Types ¶
type Client ¶
type Client interface { CreateContainer( lager.Logger, <-chan os.Signal, ImageFetchingDelegate, Identifier, Metadata, ContainerSpec, atc.ResourceTypes, ) (Container, error) FindContainerForIdentifier(lager.Logger, Identifier) (Container, bool, error) LookupContainer(lager.Logger, string) (Container, bool, error) Satisfying(WorkerSpec, atc.ResourceTypes) (Worker, error) AllSatisfying(WorkerSpec, atc.ResourceTypes) ([]Worker, error) GetWorker(workerName string) (Worker, error) }
func NewPool ¶
func NewPool(provider WorkerProvider) Client
type ContainerSpec ¶
type ContainerSpec interface { WorkerSpec() WorkerSpec ImageResource() (atc.TaskImageConfig, bool) }
type ExponentialRetryPolicy ¶
type GardenConnectionFactory ¶
type GardenConnectionFactory interface { BuildConnection() gconn.Connection BuildConnectionFromDB() (gconn.Connection, error) }
func NewGardenConnectionFactory ¶
func NewGardenConnectionFactory( db GardenConnectionFactoryDB, dialer gconn.DialerFunc, logger lager.Logger, workerName string, address string, ) GardenConnectionFactory
type GardenConnectionFactoryDB ¶
type GardenConnectionFactoryDB interface {
GetWorker(string) (db.SavedWorker, bool, error)
}
type GardenWorkerDB ¶
type Identifier ¶
type Identifier db.ContainerIdentifier
type Image ¶
type Image interface { Volume() Volume Metadata() ImageMetadata Release(*time.Duration) }
type ImageFetcher ¶
type ImageFetcher interface { FetchImage( lager.Logger, atc.TaskImageConfig, <-chan os.Signal, Identifier, Metadata, ImageFetchingDelegate, Client, atc.Tags, atc.ResourceTypes, ) (Image, error) }
type ImageFetchingDelegate ¶
type ImageFetchingDelegate interface { Stderr() io.Writer ImageVersionDetermined(db.VolumeIdentifier) error }
type ImageMetadata ¶
type Metadata ¶
type Metadata db.ContainerMetadata
type MultiWorkerError ¶
type MultiWorkerError struct {
// contains filtered or unexported fields
}
func (*MultiWorkerError) AddError ¶
func (mwe *MultiWorkerError) AddError(workerName string, err error)
func (MultiWorkerError) Error ¶
func (err MultiWorkerError) Error() string
func (MultiWorkerError) Errors ¶
func (mwe MultiWorkerError) Errors() map[string]error
type MultipleContainersError ¶
type MultipleContainersError struct {
Handles []string
}
func (MultipleContainersError) Error ¶
func (err MultipleContainersError) Error() string
type MultipleWorkersFoundContainerError ¶
type MultipleWorkersFoundContainerError struct {
Names []string
}
func (MultipleWorkersFoundContainerError) Error ¶
func (err MultipleWorkersFoundContainerError) Error() string
type NoCompatibleWorkersError ¶
type NoCompatibleWorkersError struct { Spec WorkerSpec Workers []Worker }
func (NoCompatibleWorkersError) Error ¶
func (err NoCompatibleWorkersError) Error() string
type NoopImageFetchingDelegate ¶
type NoopImageFetchingDelegate struct{}
func (NoopImageFetchingDelegate) ImageVersionDetermined ¶
func (NoopImageFetchingDelegate) ImageVersionDetermined(db.VolumeIdentifier) error
func (NoopImageFetchingDelegate) Stderr ¶
func (NoopImageFetchingDelegate) Stderr() io.Writer
type ResourceTypeContainerSpec ¶
type ResourceTypeContainerSpec struct { Type string ImageResourcePointer *atc.TaskImageConfig Ephemeral bool Tags []string Env []string // Not Copy-on-Write. Used for a single mount in Get containers. Cache VolumeMount // Copy-on-Write. Used for mounting multiple resources into a Put container. Mounts []VolumeMount }
func (ResourceTypeContainerSpec) ImageResource ¶
func (spec ResourceTypeContainerSpec) ImageResource() (atc.TaskImageConfig, bool)
func (ResourceTypeContainerSpec) WorkerSpec ¶
func (spec ResourceTypeContainerSpec) WorkerSpec() WorkerSpec
type RetryableConnection ¶
type RetryableConnection struct { gconn.Connection Logger lager.Logger Sleeper Sleeper RetryPolicy RetryPolicy ConnectionFactory GardenConnectionFactory // contains filtered or unexported fields }
func NewRetryableConnection ¶
func NewRetryableConnection( logger lager.Logger, sleeper Sleeper, retryPolicy RetryPolicy, connectionFactory GardenConnectionFactory, ) *RetryableConnection
func (*RetryableConnection) Capacity ¶
func (conn *RetryableConnection) Capacity() (garden.Capacity, error)
func (*RetryableConnection) Create ¶
func (conn *RetryableConnection) Create(spec garden.ContainerSpec) (string, error)
func (*RetryableConnection) CurrentBandwidthLimits ¶
func (conn *RetryableConnection) CurrentBandwidthLimits(handle string) (garden.BandwidthLimits, error)
func (*RetryableConnection) CurrentCPULimits ¶
func (conn *RetryableConnection) CurrentCPULimits(handle string) (garden.CPULimits, error)
func (*RetryableConnection) CurrentDiskLimits ¶
func (conn *RetryableConnection) CurrentDiskLimits(handle string) (garden.DiskLimits, error)
func (*RetryableConnection) CurrentMemoryLimits ¶
func (conn *RetryableConnection) CurrentMemoryLimits(handle string) (garden.MemoryLimits, error)
func (*RetryableConnection) Destroy ¶
func (conn *RetryableConnection) Destroy(handle string) error
func (*RetryableConnection) Info ¶
func (conn *RetryableConnection) Info(handle string) (garden.ContainerInfo, error)
func (*RetryableConnection) LimitBandwidth ¶
func (conn *RetryableConnection) LimitBandwidth(handle string, limits garden.BandwidthLimits) (garden.BandwidthLimits, error)
func (*RetryableConnection) LimitMemory ¶
func (conn *RetryableConnection) LimitMemory(handle string, limits garden.MemoryLimits) (garden.MemoryLimits, error)
func (*RetryableConnection) List ¶
func (conn *RetryableConnection) List(properties garden.Properties) ([]string, error)
func (*RetryableConnection) NetOut ¶
func (conn *RetryableConnection) NetOut(handle string, rule garden.NetOutRule) error
func (*RetryableConnection) Ping ¶
func (conn *RetryableConnection) Ping() error
func (*RetryableConnection) Property ¶
func (conn *RetryableConnection) Property(handle string, name string) (string, error)
func (*RetryableConnection) RemoveProperty ¶
func (conn *RetryableConnection) RemoveProperty(handle string, name string) error
func (*RetryableConnection) Run ¶
func (conn *RetryableConnection) Run(handle string, processSpec garden.ProcessSpec, processIO garden.ProcessIO) (garden.Process, error)
func (*RetryableConnection) SetProperty ¶
func (conn *RetryableConnection) SetProperty(handle string, name string, value string) error
func (*RetryableConnection) Stop ¶
func (conn *RetryableConnection) Stop(handle string, kill bool) error
func (*RetryableConnection) StreamIn ¶
func (conn *RetryableConnection) StreamIn(handle string, spec garden.StreamInSpec) error
func (*RetryableConnection) StreamOut ¶
func (conn *RetryableConnection) StreamOut(handle string, spec garden.StreamOutSpec) (io.ReadCloser, error)
type SaveWorkerDB ¶
type SaveWorkerDB interface {
SaveWorker(db.WorkerInfo, time.Duration) (db.SavedWorker, error)
}
type TaskContainerSpec ¶
type TaskContainerSpec struct { Platform string Image string ImageResourcePointer *atc.TaskImageConfig Privileged bool Tags []string Inputs []VolumeMount Outputs []VolumeMount }
func (TaskContainerSpec) ImageResource ¶
func (spec TaskContainerSpec) ImageResource() (atc.TaskImageConfig, bool)
func (TaskContainerSpec) WorkerSpec ¶
func (spec TaskContainerSpec) WorkerSpec() WorkerSpec
type Volume ¶
type Volume interface { baggageclaim.Volume }
type VolumeFactory ¶
func NewVolumeFactory ¶
func NewVolumeFactory(db VolumeFactoryDB, clock clock.Clock) VolumeFactory
type VolumeFactoryDB ¶
type VolumeMount ¶
type Worker ¶
type Worker interface { Client ActiveContainers() int Description() string Name() string VolumeManager() (baggageclaim.Client, bool) }
func NewGardenWorker ¶
func NewGardenWorker( gardenClient garden.Client, baggageclaimClient baggageclaim.Client, volumeFactory VolumeFactory, imageFetcher ImageFetcher, db GardenWorkerDB, provider WorkerProvider, clock clock.Clock, activeContainers int, resourceTypes []atc.WorkerResourceType, platform string, tags atc.Tags, name string, ) Worker
type WorkerDB ¶
type WorkerDB interface { Workers() ([]db.SavedWorker, error) GetWorker(string) (db.SavedWorker, bool, error) CreateContainer(db.Container, time.Duration) (db.SavedContainer, error) GetContainer(string) (db.SavedContainer, bool, error) FindContainerByIdentifier(db.ContainerIdentifier) (db.SavedContainer, bool, error) UpdateExpiresAtOnContainer(handle string, ttl time.Duration) error ReapContainer(handle string) error GetVolumeTTL(volumeHandle string) (time.Duration, error) ReapVolume(handle string) error SetVolumeTTL(string, time.Duration) error }
type WorkerProvider ¶
type WorkerProvider interface { Workers() ([]Worker, error) GetWorker(string) (Worker, bool, error) FindContainerForIdentifier(Identifier) (db.SavedContainer, bool, error) GetContainer(string) (db.SavedContainer, bool, error) ReapContainer(string) error }
func NewDBWorkerProvider ¶
func NewDBWorkerProvider( logger lager.Logger, db WorkerDB, dialer gconn.DialerFunc, retryPolicy RetryPolicy, imageFetcher ImageFetcher, ) WorkerProvider
type WorkerSpec ¶
func (WorkerSpec) Description ¶
func (spec WorkerSpec) Description() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
|
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter |
fakes
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
Click to show internal directories.
Click to hide internal directories.