server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpConfig

func DumpConfig(sflags interface{}) error

func EnsureAPIService

func EnsureAPIService(aggregatorClient clientset.Interface, cacert []byte) error

EnsureAPIService ensure the apiservice.spec.caBundle is fresh

func GetBusyDeviceSet

func GetBusyDeviceSet(prl []*jsonstruct.PodResourcesDetail) sets.String

func GetKubeAndAggregatorClientset

func GetKubeAndAggregatorClientset() (kubernetes.Interface, clientset.Interface, error)

func GetListener

func GetListener(sflags *options.MetricsPodResourceFlags, cfg *tls.Config) (listener net.Listener, err error)

GetListener get standard net Listener with server config and tls config.

func GetPodRequestGpuNum

func GetPodRequestGpuNum(pod *corev1.Pod) int64

func GetTlsConfig

func GetTlsConfig(certs *generator.Artifacts) (*tls.Config, error)

GetTlsConfig get tls config with server config certs files.

func LogOrWriteConfig

func LogOrWriteConfig(fileName string, sflags interface{}) error

func MapSetToList

func MapSetToList(mapset map[string]sets.String) map[string][]string

func NodeStatusToGpuInfoStatus

func NodeStatusToGpuInfoStatus(status *NodeStatus) *apis.GpuInfoStatus

func PodResourcesDetailToPodResource

func PodResourcesDetailToPodResource(prdList []*jsonstruct.PodResourcesDetail) []*apis.PodResource

func WriteJSON

func WriteJSON(w http.ResponseWriter, code int, v interface{}) error

WriteJSON send back http stream, encode the value v with standard json encoding.

Types

type NodeGpuInfoMap

type NodeGpuInfoMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

struct to store gpu info from all nodes

func NewNodeGpuInfoMap

func NewNodeGpuInfoMap() *NodeGpuInfoMap

func (*NodeGpuInfoMap) DumpNodeGpuInfo

func (gim *NodeGpuInfoMap) DumpNodeGpuInfo() string

func (*NodeGpuInfoMap) GetAllNodeGpuInfo

func (gim *NodeGpuInfoMap) GetAllNodeGpuInfo() []*NodeGpuInfo

func (*NodeGpuInfoMap) GetNodeDeviceInUse

func (gim *NodeGpuInfoMap) GetNodeDeviceInUse(node string) (value sets.String)

func (*NodeGpuInfoMap) GetNodeGpuInfo

func (gim *NodeGpuInfoMap) GetNodeGpuInfo(node string) (value *NodeGpuInfo, exist bool)

func (*NodeGpuInfoMap) SetNodeDeviceInUse

func (gim *NodeGpuInfoMap) SetNodeDeviceInUse(node string, deviceInUse sets.String)

func (*NodeGpuInfoMap) SetNodeGpuInfo

func (gim *NodeGpuInfoMap) SetNodeGpuInfo(node string, value *NodeGpuInfo)

type NodeStatus

type NodeStatus struct {
	Name            string
	Health          bool
	LastHealthyTime time.Time
}

type NodeStatusMap

type NodeStatusMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

struct to store node status info from NodeHealthChecker

func NewNodeStatusMap

func NewNodeStatusMap() *NodeStatusMap

func (*NodeStatusMap) GetNodeStatus

func (gim *NodeStatusMap) GetNodeStatus(node string) (value *NodeStatus, exist bool)

func (*NodeStatusMap) ListNodeStatus

func (gim *NodeStatusMap) ListNodeStatus() []*NodeStatus

func (*NodeStatusMap) SetNodeGpuInfo

func (gim *NodeStatusMap) SetNodeGpuInfo(node string, value *NodeStatus)

Jump to

Keyboard shortcuts

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