Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertComputeResourceToResourceGroups(cr v12.ComputeResource, shape v12.ComputeResource) v13.ResourceGroups
- func ConvertResourceGroupsToComputeResource(groups v13.ResourceGroups) v12.ComputeResource
- func FindLabel(labels map[string]string, labelName string) (string, bool)
- func FromComputeResourceToResourceList(resources v12.ComputeResource) v1.ResourceList
- func FromResourceListToComputeResource(limits v1.ResourceList) v12.ComputeResource
- func GetGpu(limits v1.ResourceList) int64
- func HasLabelAndValue(labels map[string]string, labelName string, value string) bool
- func ToJSONString(value interface{}) string
- type FormatDetailsLevel
- type FormatterOptions
- type NodeAndPods
Constants ¶
View Source
const ( True = "True" OneMegaByte = int64(1024 * 1024) OneMBPS = int64(1000000) ResourceGpu = "nvidia.com/gpu" ResourceNetwork = "titus/network" )
Variables ¶
View Source
var ( // Deprecated ComputeResourceLowCPU = titusPool.ComputeResource{ CPU: 1, GPU: 0, MemoryMB: 8096, DiskMB: 16384, NetworkMBPS: 256, } ComputeResourcesRegular = titusPool.ComputeResource{ CPU: 4, GPU: 0, MemoryMB: 8096, DiskMB: 16384, NetworkMBPS: 256, } ComputeResourcesHighCPU = titusPool.ComputeResource{ CPU: 20, GPU: 0, MemoryMB: 8096, DiskMB: 16384, NetworkMBPS: 256, } // Proportional resoure allocation across all dimensions (excluding GPU which is a special case). ComputeResourcesUnitProportional = titusPool.ComputeResource{ CPU: 1, GPU: 0, MemoryMB: 8096, DiskMB: 16384, NetworkMBPS: 256, } MachineFromUnitProportional96 = func() *machineTypeV1.MachineTypeConfig { return &machineTypeV1.MachineTypeConfig{ ObjectMeta: v12.ObjectMeta{ Name: "test.proportional96", Namespace: "default", }, Spec: machineTypeV1.MachineType{ Name: "m5.metal", ComputeResource: ComputeResourcesUnitProportional.Multiply(96), }, } } )
Functions ¶
func ConvertComputeResourceToResourceGroups ¶ added in v0.38.4
func ConvertComputeResourceToResourceGroups(cr v12.ComputeResource, shape v12.ComputeResource) v13.ResourceGroups
func ConvertResourceGroupsToComputeResource ¶ added in v0.38.4
func ConvertResourceGroupsToComputeResource(groups v13.ResourceGroups) v12.ComputeResource
func FromComputeResourceToResourceList ¶
func FromComputeResourceToResourceList(resources v12.ComputeResource) v1.ResourceList
func FromResourceListToComputeResource ¶
func FromResourceListToComputeResource(limits v1.ResourceList) v12.ComputeResource
FIXME Resources are in MB but should be in bytes
func GetGpu ¶ added in v0.13.0
func GetGpu(limits v1.ResourceList) int64
func HasLabelAndValue ¶
func ToJSONString ¶
func ToJSONString(value interface{}) string
Types ¶
type FormatDetailsLevel ¶
type FormatDetailsLevel int
const ( FormatCompact FormatDetailsLevel = 0 FormatEssentials FormatDetailsLevel = 1 FormatDetails FormatDetailsLevel = 2 )
type FormatterOptions ¶
type FormatterOptions struct {
Level FormatDetailsLevel
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.