server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpConfig

func DumpConfig(sflags interface{})

func EnsureAPIService

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

EnsureAPIService ensure the apiservice.spec.caBundle is fresh

func GetGpuNodeHasSynced added in v0.2.0

func GetGpuNodeHasSynced(ctx context.Context, mgr manager.Manager, object client.Object) (cache.InformerSynced, error)

func GetKubeAndAggregatorClientset

func GetKubeAndAggregatorClientset() (restconf *rest.Config, kubeClient kubernetes.Interface,
	aggregatorClient clientset.Interface, gpuClient gpuclientset.Interface, gpuPodClient gpupodclientset.Interface, err error)

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 WriteJSON

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

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)

Directories

Path Synopsis
Package watcher notify the change of gpupod and gpunode to watchers from rest api in metricserver.
Package watcher notify the change of gpupod and gpunode to watchers from rest api in metricserver.

Jump to

Keyboard shortcuts

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