Documentation
¶
Index ¶
- Constants
- Variables
- func ActualLRPInstanceKeyFromContainer(container executor.Container, cellID string) (*models.ActualLRPInstanceKey, error)
- func ActualLRPKeyFromTags(tags executor.Tags) (*models.ActualLRPKey, error)
- func ActualLRPNetInfoFromContainer(container executor.Container) (*models.ActualLRPNetInfo, error)
- func BestFitFashion(st *ScoreType)
- func ConvertCachedDependencies(modelDeps []*models.CachedDependency) []executor.CachedDependency
- func ConvertCachedDependency(modelDep *models.CachedDependency) executor.CachedDependency
- func ConvertPortMappings(containerPorts []uint32) []executor.PortMapping
- func LRPContainerGuid(processGuid, instanceGuid string) string
- func NewRoutes(secure bool) rata.Routes
- func NewRunRequestFromDesiredLRP(containerGuid string, desiredLRP *models.DesiredLRP, ...) (executor.RunRequest, error)
- func NewRunRequestFromTask(task *models.Task) (executor.RunRequest, error)
- func WorstFitFashion(st *ScoreType)
- type ArbitraryRootFSProvider
- type CellState
- func (c *CellState) AddLRP(lrp *LRP)
- func (c *CellState) AddTask(task *Task)
- func (c CellState) ComputeScore(res *Resource, startingContainerWeight float64) float64
- func (c *CellState) MatchPlacementTags(desiredPlacementTags []string) bool
- func (c *CellState) MatchRootFS(rootfs string) bool
- func (c *CellState) MatchVolumeDrivers(volumeDrivers []string) bool
- func (c *CellState) ResourceMatch(res *Resource) error
- type Client
- type ClientFactory
- type FixedSetRootFSProvider
- type InsufficientResourcesError
- type LRP
- type PlacementConstraint
- type Resource
- type Resources
- type RootFSProvider
- type RootFSProviderType
- type RootFSProviders
- type ScoreFunc
- type ScoreType
- type ScoreTypeFunc
- type SimClient
- type StackPathMap
- type StringSet
- type TLSConfig
- type Task
- type Work
Constants ¶
View Source
const ( LifecycleTag = "lifecycle" ResultFileTag = "result-file" DomainTag = "domain" TaskLifecycle = "task" LRPLifecycle = "lrp" ProcessGuidTag = "process-guid" InstanceGuidTag = "instance-guid" ProcessIndexTag = "process-index" )
View Source
const ( StateRoute = "STATE" PerformRoute = "PERFORM" StopLRPInstanceRoute = "StopLRPInstance" CancelTaskRoute = "CancelTask" Sim_ResetRoute = "RESET" PingRoute = "Ping" EvacuateRoute = "Evacuate" )
Variables ¶
View Source
var ( ErrContainerMissingTags = errors.New("container is missing tags") ErrInvalidProcessIndex = errors.New("container does not have a valid process index") )
View Source
var ErrorIncompatibleRootfs = errors.New("rootfs not found")
View Source
var Routes = append(RoutesInsecure, RoutesSecure...)
View Source
var RoutesInsecure = NewRoutes(false)
View Source
var RoutesSecure = NewRoutes(true)
Functions ¶
func ActualLRPKeyFromTags ¶
func ActualLRPKeyFromTags(tags executor.Tags) (*models.ActualLRPKey, error)
func ActualLRPNetInfoFromContainer ¶
func ActualLRPNetInfoFromContainer(container executor.Container) (*models.ActualLRPNetInfo, error)
func BestFitFashion ¶
func BestFitFashion(st *ScoreType)
func ConvertCachedDependencies ¶
func ConvertCachedDependencies(modelDeps []*models.CachedDependency) []executor.CachedDependency
func ConvertCachedDependency ¶
func ConvertCachedDependency(modelDep *models.CachedDependency) executor.CachedDependency
func ConvertPortMappings ¶
func ConvertPortMappings(containerPorts []uint32) []executor.PortMapping
func LRPContainerGuid ¶
func NewRunRequestFromDesiredLRP ¶
func NewRunRequestFromDesiredLRP( containerGuid string, desiredLRP *models.DesiredLRP, lrpKey *models.ActualLRPKey, lrpInstanceKey *models.ActualLRPInstanceKey, ) (executor.RunRequest, error)
func NewRunRequestFromTask ¶
func NewRunRequestFromTask(task *models.Task) (executor.RunRequest, error)
func WorstFitFashion ¶
func WorstFitFashion(st *ScoreType)
Types ¶
type ArbitraryRootFSProvider ¶
type ArbitraryRootFSProvider struct{}
func (ArbitraryRootFSProvider) MarshalJSON ¶
func (provider ArbitraryRootFSProvider) MarshalJSON() ([]byte, error)
func (ArbitraryRootFSProvider) Type ¶
func (ArbitraryRootFSProvider) Type() RootFSProviderType
type CellState ¶
type CellState struct {
RootFSProviders RootFSProviders
AvailableResources Resources
TotalResources Resources
LRPs []LRP
Tasks []Task
StartingContainerCount int
Zone string
Evacuating bool
VolumeDrivers []string
PlacementTags []string
OptionalPlacementTags []string
}
func NewCellState ¶
func (CellState) ComputeScore ¶
func (*CellState) MatchPlacementTags ¶
func (*CellState) MatchRootFS ¶
func (*CellState) MatchVolumeDrivers ¶
func (*CellState) ResourceMatch ¶
type Client ¶
type Client interface {
State(logger lager.Logger) (CellState, error)
Perform(logger lager.Logger, work Work) (Work, error)
StopLRPInstance(logger lager.Logger, key models.ActualLRPKey, instanceKey models.ActualLRPInstanceKey) error
CancelTask(logger lager.Logger, taskGuid string) error
SetStateClient(stateClient *http.Client)
StateClientTimeout() time.Duration
}
type ClientFactory ¶
func NewClientFactory ¶
func NewClientFactory(httpClient, stateClient *http.Client, tlsConfig *TLSConfig) (ClientFactory, error)
type FixedSetRootFSProvider ¶
type FixedSetRootFSProvider struct {
FixedSet StringSet
}
func NewFixedSetRootFSProvider ¶
func NewFixedSetRootFSProvider(rootfses ...string) FixedSetRootFSProvider
func (FixedSetRootFSProvider) MarshalJSON ¶
func (provider FixedSetRootFSProvider) MarshalJSON() ([]byte, error)
func (FixedSetRootFSProvider) Match ¶
func (provider FixedSetRootFSProvider) Match(rootfs url.URL) bool
func (FixedSetRootFSProvider) Type ¶
func (FixedSetRootFSProvider) Type() RootFSProviderType
func (*FixedSetRootFSProvider) UnmarshalJSON ¶
func (provider *FixedSetRootFSProvider) UnmarshalJSON(payload []byte) error
type InsufficientResourcesError ¶
type InsufficientResourcesError struct {
Problems map[string]struct{}
}
func (InsufficientResourcesError) Error ¶
func (i InsufficientResourcesError) Error() string
type LRP ¶
type LRP struct {
models.ActualLRPKey
PlacementConstraint
Resource
}
func NewLRP ¶
func NewLRP(key models.ActualLRPKey, res Resource, pc PlacementConstraint) LRP
func (*LRP) Identifier ¶
type PlacementConstraint ¶
func NewPlacementConstraint ¶
func NewPlacementConstraint(rootFs string, placementTags, volumeDrivers []string) PlacementConstraint
func (*PlacementConstraint) Valid ¶
func (p *PlacementConstraint) Valid() bool
type Resource ¶
func NewResource ¶
type RootFSProvider ¶
type RootFSProvider interface {
Type() RootFSProviderType
Match(url.URL) bool
}
type RootFSProviderType ¶
type RootFSProviderType string
const ( RootFSProviderTypeArbitrary RootFSProviderType = "arbitrary" RootFSProviderTypeFixedSet RootFSProviderType = "fixed_set" )
type RootFSProviders ¶
type RootFSProviders map[string]RootFSProvider
func (RootFSProviders) Copy ¶
func (p RootFSProviders) Copy() RootFSProviders
func (*RootFSProviders) UnmarshalJSON ¶
func (providers *RootFSProviders) UnmarshalJSON(payload []byte) error
type ScoreType ¶
type ScoreType struct {
Compute ScoreFunc
}
func NewScoreType ¶
func NewScoreType(f ScoreTypeFunc) *ScoreType
type ScoreTypeFunc ¶
type ScoreTypeFunc func(*ScoreType)
type StackPathMap ¶
func UnmarshalStackPathMap ¶
func UnmarshalStackPathMap(payload []byte) (StackPathMap, error)
type TLSConfig ¶
type TLSConfig struct {
RequireTLS bool
CertFile, KeyFile, CaCertFile string
ClientCacheSize int // the tls client cache size, 0 means use golang default value
}
capture the behavior described in the comment of this story https://www.pivotaltracker.com/story/show/130664747/comments/152863773
type Task ¶
type Task struct {
TaskGuid string
Domain string
PlacementConstraint
Resource
}
func (*Task) Identifier ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
auctioncellrepfakes
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
|
cmd
|
|
|
rep
command
|
|
|
evacuation_context/fake_evacuation_context
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
|
generator creates operations for container processing
|
generator creates operations for container processing |
|
fake_generator
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
|
internal/fake_internal
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
|
maintainfakes
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.