Documentation ¶
Index ¶
Constants ¶
View Source
const ( // HostName represents the hostname label used // internally by placement engine HostName = "peloton.placementengine.hostname" )
Variables ¶
View Source
var ( // CPUAvailable represents the available cpu in a host offer, each cpu adds 100 %, so a 24 core machine will // have 2400 % cpu. CPUAvailable = metrics.Type{ Name: "cpu_available", Unit: "%", Inherited: false, } // CPUReserved represents the reserved cpu on a host offer or of a task. CPUReserved = metrics.Type{ Name: "cpu_reserved", Unit: "%", Inherited: true, } // CPUFree represents the free cpu for a host offer. CPUFree = metrics.Type{ Name: "cpu_free", Unit: "%", Inherited: false, } // GPUAvailable represents the available gpu in a host offer, each gpu adds 100 %, so a 384 core gpu will // have 38400 % cpu. GPUAvailable = metrics.Type{ Name: "gpu_available", Unit: "%", Inherited: false, } // GPUReserved represents the reserved gpu on a host offer or of a task. GPUReserved = metrics.Type{ Name: "gpu_reserved", Unit: "%", Inherited: true, } // GPUFree represents the free gpu for a host offer. GPUFree = metrics.Type{ Name: "gpu_free", Unit: "%", Inherited: false, } // MemoryAvailable represents the available memory on a host offer. MemoryAvailable = metrics.Type{ Name: "memory_available", Unit: "bytes", Inherited: false, } // MemoryReserved represents the reserved memory on a host offer or of a task. MemoryReserved = metrics.Type{ Name: "memory_reserved", Unit: "bytes", Inherited: true, } // MemoryFree represents the free memory for a host offer. MemoryFree = metrics.Type{ Name: "memory_free", Unit: "bytes", Inherited: false, } // DiskAvailable represents the available disk on a host offer. DiskAvailable = metrics.Type{ Name: "disk_available", Unit: "bytes", Inherited: false, } // DiskReserved represents the reserved disk on a host offer or of a task. DiskReserved = metrics.Type{ Name: "disk_reserved", Unit: "bytes", Inherited: true, } // DiskFree represents the free disk for a host offer. DiskFree = metrics.Type{ Name: "disk_free", Unit: "bytes", Inherited: false, } // PortsAvailable represents the available ports on a host offer. PortsAvailable = metrics.Type{ Name: "ports_available", Unit: "#", Inherited: false, } // PortsReserved represents the reserved ports on a host offer or of a task. PortsReserved = metrics.Type{ Name: "ports_reserved", Unit: "#", Inherited: true, } // PortsFree represents the free ports for a host offer. PortsFree = metrics.Type{ Name: "ports_free", Unit: "#", Inherited: false, } )
Functions ¶
func New ¶
func New(placer algorithms.Placer, config *config.PlacementConfig) plugins.Strategy
New will create a new strategy using Mimir-lib to do the placement logic.
func OfferToGroup ¶
OfferToGroup will convert an offer to a group.
Types ¶
type Entity ¶
type Entity struct { Name string `json:"name"` Relations map[string]int `json:"relations"` Metrics map[string]float64 `json:"metrics"` }
Entity is a helper to be able to make structured logging of the Mimir library types.
type Group ¶
type Group struct { Name string `json:"name"` Labels map[string]int `json:"labels"` Metrics map[string]float64 `json:"metrics"` Relations map[string]int `json:"relations"` Entities map[string]*Entity `json:"entities"` }
Group is a helper to be able to make structured logging of the Mimir library types.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mimir provides the two main types 'group' and 'entity', and fast algorithms to place the entities on the given groups while satisfying the requirements of the entities.
|
Package mimir provides the two main types 'group' and 'entity', and fast algorithms to place the entities on the given groups while satisfying the requirements of the entities. |
generation
Package generation provides builders to easily build groups, entities and their resource and affinity requirements and placement orderings.
|
Package generation provides builders to easily build groups, entities and their resource and affinity requirements and placement orderings. |
model
Package model contains all the data container types needed to model your physical and logical infrastructure through the concept of a group and all your tasks, processes or containers through the concept of an entity.
|
Package model contains all the data container types needed to model your physical and logical infrastructure through the concept of a group and all your tasks, processes or containers through the concept of an entity. |
Click to show internal directories.
Click to hide internal directories.