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 ConvertPortMappings(containerPorts []uint32) []executor.PortMapping
- func LRPContainerGuid(processGuid, instanceGuid string) string
- func NewRunRequestFromDesiredLRP(containerGuid string, desiredLRP *models.DesiredLRP, ...) (executor.RunRequest, error)
- func NewRunRequestFromTask(task *models.Task) (executor.RunRequest, error)
- type ArbitraryRootFSProvider
- type AuctionCellClient
- type CellState
- type Client
- type ClientFactory
- type FixedSetRootFSProvider
- type LRP
- type Resource
- type Resources
- type RootFSProvider
- type RootFSProviderType
- type RootFSProviders
- type SimClient
- type StackPathMap
- type StringSet
- 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 ErrorInsufficientResources = errors.New("insufficient resources")
View Source
var Routes = rata.Routes{ {Path: "/state", Method: "GET", Name: StateRoute}, {Path: "/work", Method: "POST", Name: PerformRoute}, {Path: "/v1/lrps/:process_guid/instances/:instance_guid/stop", Method: "POST", Name: StopLRPInstanceRoute}, {Path: "/v1/tasks/:task_guid/cancel", Method: "POST", Name: CancelTaskRoute}, {Path: "/sim/reset", Method: "POST", Name: Sim_ResetRoute}, {Path: "/ping", Method: "GET", Name: PingRoute}, {Path: "/evacuate", Method: "POST", Name: EvacuateRoute}, }
Functions ¶
func ActualLRPKeyFromTags ¶
func ActualLRPKeyFromTags(tags executor.Tags) (*models.ActualLRPKey, error)
func ActualLRPNetInfoFromContainer ¶
func ActualLRPNetInfoFromContainer(container executor.Container) (*models.ActualLRPNetInfo, error)
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)
Types ¶
type ArbitraryRootFSProvider ¶
type ArbitraryRootFSProvider struct{}
func (ArbitraryRootFSProvider) MarshalJSON ¶
func (provider ArbitraryRootFSProvider) MarshalJSON() ([]byte, error)
func (ArbitraryRootFSProvider) Type ¶
func (ArbitraryRootFSProvider) Type() RootFSProviderType
type AuctionCellClient ¶
type CellState ¶
type CellState struct { RootFSProviders RootFSProviders AvailableResources Resources TotalResources Resources LRPs []LRP Tasks []Task Zone string Evacuating bool }
func NewCellState ¶
func (CellState) ComputeScore ¶
func (*CellState) MatchRootFS ¶
func (*CellState) ResourceMatch ¶
type Client ¶
type Client interface { AuctionCellClient StopLRPInstance(key models.ActualLRPKey, instanceKey models.ActualLRPInstanceKey) error CancelTask(taskGuid string) error SetStateClient(stateClient *http.Client) StateClientTimeout() time.Duration }
type ClientFactory ¶
func NewClientFactory ¶
func NewClientFactory(httpClient, stateClient *http.Client) ClientFactory
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 Resource ¶
type Resource struct { MemoryMB int32 `json:"MemoryMB"` DiskMB int32 `json:"DiskMB"` RootFs string `json:"RootFs"` }
func NewResource ¶
type Resources ¶
type Resources struct { MemoryMB int32 `json:"MemoryMB"` DiskMB int32 `json:"DiskMB"` Containers int `json:"Containers"` }
func NewResources ¶
func (*Resources) ComputeScore ¶
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 StackPathMap ¶
func UnmarshalStackPathMap ¶
func UnmarshalStackPathMap(payload []byte) (StackPathMap, error)
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
evacuation_context/fake_evacuation_context
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 |
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 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 |
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.