util

package
v0.0.0-...-47d56ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2020 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 6 Imported by: 0

Documentation

Overview

* Tencent is pleased to support the open source community by making TKEStack available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use * this file except in compliance with the License. You may obtain a copy of the * License at * * https://opensource.org/licenses/Apache-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	VCoreAnnotation         = "tencent.com/vcuda-core"
	VMemoryAnnotation       = "tencent.com/vcuda-memory"
	PredicateTimeAnnotation = "tencent.com/predicate-time"
	PredicateGPUIndexPrefix = "tencent.com/predicate-gpu-idx-"
	PredicateNode           = "tencent.com/predicate-node"
	GPUAssigned             = "tencent.com/gpu-assigned"
	HundredCore             = 100
)

Variables

This section is empty.

Functions

func GetCapacityOfNode

func GetCapacityOfNode(node *v1.Node, resourceName string) int

Get the capacity of request resource of the Node

func GetGPUDeviceCountOfNode

func GetGPUDeviceCountOfNode(node *v1.Node) int

GetGPUDeviceCountOfNode returns the number of GPU devices

func GetGPUResourceOfContainer

func GetGPUResourceOfContainer(container *v1.Container, resourceName v1.ResourceName) uint

GetGPUResourceOfPod returns the limit size of GPU resource of given container

func GetGPUResourceOfPod

func GetGPUResourceOfPod(pod *v1.Pod, resourceName v1.ResourceName) uint

GetGPUResourceOfPod returns the limit size of GPU resource of given pod

func GetPredicateIdxOfContainer

func GetPredicateIdxOfContainer(pod *v1.Pod, containerIndex int) ([]int, error)

GetPredicateIdxOfContainer returns the idx number of given container should be run on which GPU device

func IsGPUEnabledNode

func IsGPUEnabledNode(node *v1.Node) bool

Is the Node has GPU device

func IsGPURequiredContainer

func IsGPURequiredContainer(c *v1.Container) bool

IsGPURequiredContainer tell if the container is a GPU request container

func IsGPURequiredPod

func IsGPURequiredPod(pod *v1.Pod) bool

IsGPURequiredPod tell if the pod is a GPU request pod

func ShouldRetry

func ShouldRetry(err error) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL