Documentation ¶
Index ¶
- Constants
- Variables
- func FinalTTL(ttl time.Duration) *time.Duration
- func NewHardcoded(logger lager.Logger, workerDB SaveWorkerDB, clock c.Clock, gardenAddr string, ...) ifrit.RunFunc
- type Client
- type Container
- type ContainerRootFSStrategy
- type ContainerSpec
- type GardenConnectionFactory
- type GardenWorkerDB
- type HostRootFSStrategy
- type Identifier
- type Image
- type ImageArtifactReplicationStrategy
- type ImageFactory
- type ImageFetchingDelegate
- type ImageMetadata
- type ImageSpec
- type ImageVolumeAndMetadata
- type MalformedMetadataError
- type Metadata
- type NoCompatibleWorkersError
- type NoopImageFetchingDelegate
- type OutputStrategy
- type ResourceCacheStrategy
- type RetryableConnection
- type SaveWorkerDB
- type Sleeper
- type Strategy
- type Volume
- type VolumeClient
- type VolumeFactory
- type VolumeFactoryDB
- type VolumeIdentifier
- type VolumeMount
- type VolumeProperties
- type VolumeSpec
- type Worker
- type WorkerDB
- type WorkerProvider
- type WorkerSpec
Constants ¶
View Source
const ContainerTTL = 5 * time.Minute
View Source
const RawRootFSScheme = "raw"
View Source
const VolumeTTL = 5 * time.Minute
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 ErrNoVolumeManager = errors.New("worker does not support volume management")
View Source
var ErrTeamMismatch = errors.New("mismatched team")
View Source
var ErrUnsupportedResourceType = errors.New("unsupported resource type")
View Source
var ErrVolumeExpiredImmediately = errors.New("volume expired immediately after saving")
Functions ¶
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) ValidateResourceCheckVersion(container db.SavedContainer) (bool, error) FindResourceTypeByPath(path string) (atc.WorkerResourceType, bool) FindVolume(lager.Logger, VolumeSpec) (Volume, bool, error) CreateVolume(logger lager.Logger, vs VolumeSpec, teamID int) (Volume, error) ListVolumes(lager.Logger, VolumeProperties) ([]Volume, error) LookupVolume(lager.Logger, string) (Volume, bool, error) Satisfying(WorkerSpec, atc.ResourceTypes) (Worker, error) AllSatisfying(WorkerSpec, atc.ResourceTypes) ([]Worker, error) Workers() ([]Worker, error) GetWorker(workerName string) (Worker, error) }
func NewPool ¶
func NewPool(provider WorkerProvider) Client
type ContainerRootFSStrategy ¶
type ContainerRootFSStrategy struct {
Parent Volume
}
type ContainerSpec ¶
type ContainerSpec struct { Platform string Tags []string TeamID int ImageSpec ImageSpec Ephemeral bool Env []string // Not Copy-on-Write. Used for a single mount in Get containers. Inputs []VolumeMount // Copy-on-Write. Used for mounting multiple resources into a Put container. Outputs []VolumeMount // Optional user to run processes as. Overwrites the one specified in the docker image. User string }
func (ContainerSpec) WorkerSpec ¶
func (spec ContainerSpec) WorkerSpec() WorkerSpec
type GardenConnectionFactory ¶
type GardenConnectionFactory interface {
BuildConnection() gconn.Connection
}
func NewGardenConnectionFactory ¶
func NewGardenConnectionFactory( db transport.TransportDB, logger lager.Logger, workerName string, workerHost string, retryBackOffFactory retryhttp.BackOffFactory, ) GardenConnectionFactory
type GardenWorkerDB ¶
type GardenWorkerDB interface { CreateContainer(container db.Container, ttl time.Duration, maxLifetime time.Duration, volumeHandles []string) (db.SavedContainer, error) GetContainer(handle string) (db.SavedContainer, bool, error) UpdateExpiresAtOnContainer(handle string, ttl time.Duration) error ReapContainer(string) error GetPipelineByID(pipelineID int) (db.SavedPipeline, error) InsertVolume(db.Volume) error SetVolumeTTLAndSizeInBytes(string, time.Duration, int64) error GetVolumeTTL(string) (time.Duration, bool, error) GetVolumesByIdentifier(db.VolumeIdentifier) ([]db.SavedVolume, error) }
type HostRootFSStrategy ¶
type Identifier ¶
type Identifier db.ContainerIdentifier
type ImageArtifactReplicationStrategy ¶
type ImageArtifactReplicationStrategy struct {
Name string
}
type ImageFactory ¶
type ImageFactory interface { NewImage( logger lager.Logger, cancel <-chan os.Signal, imageResource atc.ImageResource, id Identifier, metadata Metadata, tags atc.Tags, teamID int, resourceTypes atc.ResourceTypes, workerClient Client, delegate ImageFetchingDelegate, privileged bool, ) Image }
type ImageFetchingDelegate ¶
type ImageFetchingDelegate interface { Stderr() io.Writer ImageVersionDetermined(VolumeIdentifier) error }
type ImageMetadata ¶
type ImageSpec ¶
type ImageSpec struct { ResourceType string ImageURL string ImageResource *atc.ImageResource ImageVolumeAndMetadata ImageVolumeAndMetadata Privileged bool }
type ImageVolumeAndMetadata ¶
type ImageVolumeAndMetadata struct { Volume Volume MetadataReader io.ReadCloser }
type MalformedMetadataError ¶
type MalformedMetadataError struct {
UnmarshalError error
}
func (MalformedMetadataError) Error ¶
func (err MalformedMetadataError) Error() string
type Metadata ¶
type Metadata db.ContainerMetadata
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(VolumeIdentifier) error
func (NoopImageFetchingDelegate) Stderr ¶
func (NoopImageFetchingDelegate) Stderr() io.Writer
type OutputStrategy ¶
type OutputStrategy struct {
Name string
}
type ResourceCacheStrategy ¶
type RetryableConnection ¶
type RetryableConnection struct {
gconn.Connection
}
func NewRetryableConnection ¶
func NewRetryableConnection(connection gconn.Connection) *RetryableConnection
type SaveWorkerDB ¶
type SaveWorkerDB interface {
SaveWorker(db.WorkerInfo, time.Duration) (db.SavedWorker, error)
}
type Volume ¶
type Volume interface { baggageclaim.Volume // a noop method to ensure things aren't just returning baggageclaim.Volume HeartbeatingToDB() }
type VolumeClient ¶
type VolumeClient interface { FindVolume(lager.Logger, VolumeSpec) (Volume, bool, error) CreateVolume(logger lager.Logger, vs VolumeSpec, teamID int) (Volume, error) ListVolumes(lager.Logger, VolumeProperties) ([]Volume, error) LookupVolume(lager.Logger, string) (Volume, bool, error) }
func NewVolumeClient ¶
func NewVolumeClient( baggageclaimClient baggageclaim.Client, db GardenWorkerDB, volumeFactory VolumeFactory, workerName string, ) VolumeClient
type VolumeFactory ¶
func NewVolumeFactory ¶
func NewVolumeFactory(db VolumeFactoryDB, clock clock.Clock) VolumeFactory
type VolumeFactoryDB ¶
type VolumeIdentifier ¶
type VolumeIdentifier db.VolumeIdentifier
type VolumeMount ¶
type VolumeProperties ¶
type VolumeSpec ¶
type VolumeSpec struct { Strategy Strategy Properties VolumeProperties Privileged bool TTL time.Duration }
type Worker ¶
type Worker interface { Client ActiveContainers() int Description() string Name() string Uptime() time.Duration IsOwnedByTeam() bool }
func NewGardenWorker ¶
func NewGardenWorker( gardenClient garden.Client, baggageclaimClient baggageclaim.Client, volumeClient VolumeClient, volumeFactory VolumeFactory, imageFactory ImageFactory, pipelineDBFactory db.PipelineDBFactory, db GardenWorkerDB, provider WorkerProvider, clock clock.Clock, activeContainers int, resourceTypes []atc.WorkerResourceType, platform string, tags atc.Tags, teamID int, name string, startTime int64, httpProxyURL string, httpsProxyURL string, noProxy string, ) Worker
type WorkerDB ¶
type WorkerDB interface { Workers() ([]db.SavedWorker, error) GetWorker(string) (db.SavedWorker, bool, error) CreateContainer(container db.Container, ttl time.Duration, maxLifetime time.Duration, volumeHandles []string) (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 GetPipelineByID(pipelineID int) (db.SavedPipeline, error) InsertVolume(db.Volume) error GetVolumesByIdentifier(db.VolumeIdentifier) ([]db.SavedVolume, error) GetVolumeTTL(volumeHandle string) (time.Duration, bool, error) ReapVolume(handle string) error SetVolumeTTLAndSizeInBytes(string, time.Duration, int64) 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, retryBackOffFactory retryhttp.BackOffFactory, imageFactory ImageFactory, pipelineDBFactory db.PipelineDBFactory, ) WorkerProvider
type WorkerSpec ¶
func (WorkerSpec) Description ¶
func (spec WorkerSpec) Description() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
transportfakes
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 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 |
Click to show internal directories.
Click to hide internal directories.