kumonitor

package
v0.0.0-...-232fc37 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright 2022 Hyeon-Jun Jang, SSLab, Konkuk University

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

http://www.apache.org/licenses/LICENSE-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 OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalAvg

func CalAvg(array []uint64, windowSize int) float64

func CheckPodPath

func CheckPodPath(pi *PodInfo) bool

func GetCpuAcctUsage

func GetCpuAcctUsage(cpuPath string) (uint64, uint64)

Get AcctUsage Functions From Cgroup or GPU Virt

func GetFileParamUint

func GetFileParamUint(Path, File string) uint64

func GetFileUint

func GetFileUint(path string) (uint64, bool)

func GetGpuAcctUsage

func GetGpuAcctUsage(gpuPath string) (uint64, uint64)

func GetMtime

func GetMtime() (uint64, error)

func PathExists

func PathExists(path string) bool

func ReadCPUMax

func ReadCPUMax(cpuPath string) uint64

func ReadCPUStat

func ReadCPUStat(cpuPath string) (uint64, bool)

func UpdateGemini

func UpdateGemini()

func WriteCPUMax

func WriteCPUMax(cpuPath string, quota uint64)

Types

type AcctUsageAndTime

type AcctUsageAndTime struct {
	// contains filtered or unexported fields
}

type Configuraion

type Configuraion struct {
	// contains filtered or unexported fields
}

type Monitor

type Monitor struct {
	RunningPodMap   PodInfoMap
	CompletedPodMap PodInfoMap
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor(
	monitoringPeriod, windowSize int64,
	nodeName string,
	monitoringMode bool,
	staticV float64) *Monitor

func (*Monitor) FindPodNameById

func (m *Monitor) FindPodNameById(id string) *PodInfo

Func Name : FindPodNameById() Objective : 1) Find the Pod Name in RunningPodMap Using ID

func (*Monitor) MonitorAndAutoScale

func (m *Monitor) MonitorAndAutoScale()

Func Name : MonitorAndAutoScale()

Objective :
1) Monitoring the pods in RunningPodMap
2) Check and Remove Completed Pods

func (*Monitor) Run

func (m *Monitor) Run(stopCh, ebpfCh, newPodCh chan string)

func (*Monitor) UpdateNewPod

func (m *Monitor) UpdateNewPod(vgpuNToken string)

Func Name : UpdateNewPod() Objective : 1) Initalize New Pod

  1. Pulling and Wait for New Pod

type PodIDtoNameMap

type PodIDtoNameMap map[string]string

type PodInfo

type PodInfo struct {
	PodName string
	ID      string

	TokenQueue       float64
	TokenReservation float64
	UpdatedCount     int64 // Update Count from KuScale

	RNs []ResourceName
	RIs map[ResourceName]*ResourceInfo
	// contains filtered or unexported fields
}

Pod Info are managed by KuScale

func NewPodInfo

func NewPodInfo(podName string, RNs []ResourceName) *PodInfo

func (*PodInfo) CPU

func (pi *PodInfo) CPU() *ResourceInfo

func (*PodInfo) GPU

func (pi *PodInfo) GPU() *ResourceInfo

func (*PodInfo) SetInitLimit

func (pi *PodInfo) SetInitLimit()

func (*PodInfo) UpdateDynamicWeight

func (pi *PodInfo) UpdateDynamicWeight(staticV float64)

Func Name : (pi *PodInfo) UpdateDynamicWeight(staticV float64)

Objective :
1) Update DynamicWeight

func (*PodInfo) UpdatePodUsage

func (pi *PodInfo) UpdatePodUsage()

Func Name : (pi *PodInfo) UpdatePodUsage()

Objective :
1) Monitoring the pods in RunningPodMap
2) Check and Remove Completed Pods

func (*PodInfo) UpdateTokenQueue

func (pi *PodInfo) UpdateTokenQueue()

Func Name : (pi *PodInfo) UpdateTokenQueue()

Objective :
1) Update TokenQueue

type PodInfoMap

type PodInfoMap map[string]*PodInfo

type PodStatus

type PodStatus string
const (
	PodInitializing PodStatus = "initializing"
	PodNotReady     PodStatus = "not ready"
	PodRunning      PodStatus = "running"
	PodCompleted    PodStatus = "completed"
)

type ResourceInfo

type ResourceInfo struct {
	// contains filtered or unexported fields
}

func (*ResourceInfo) AvgUsage

func (ri *ResourceInfo) AvgUsage() float64

func (*ResourceInfo) DynamicWeight

func (ri *ResourceInfo) DynamicWeight() float64

func (*ResourceInfo) Init

func (ri *ResourceInfo) Init(name ResourceName, scale int, price float64)

func (*ResourceInfo) Limit

func (ri *ResourceInfo) Limit() float64

func (*ResourceInfo) Price

func (ri *ResourceInfo) Price() float64

func (*ResourceInfo) SetLimit

func (ri *ResourceInfo) SetLimit(limit float64)

func (*ResourceInfo) Usage

func (ri *ResourceInfo) Usage() float64

type ResourceName

type ResourceName string

Jump to

Keyboard shortcuts

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