client

package
v0.0.0-...-c1909df Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RunDeployment string = "image-clf-inf"
)

Global variable of Configuration

Functions

func AppendRecordDeployment

func AppendRecordDeployment(dbName string, cpu string, gpu1 string, gpu2 string) error

AppendRecordDeployment appends a record of (image num, duration) to Processing Time table of specific runtime

func AppendRecordLogTime

func AppendRecordLogTime(imageNum int, app string, version string, runtime string,
	predTotal float64, predTransfer float64, predDeploy float64, predProc float64,
	actTotal float64, actTransfer float64, actDeploy float64, actProc float64) error

AppendRecordLogTime appends a record to LogTime table

func AppendRecordProcessing

func AppendRecordProcessing(dbName string, runtime string, imageNum int,
	duration float64, application string, version string) error

AppendRecordProcessing appends a record of (image num, duration) to Processing Time table of specific runtime

func Average

func Average(arr []float64) float64

Average returns the mean of float numbers in an array

func CompareVersion

func CompareVersion(version1 string, version2 string) int

CompareVersion compares two version strings Return 1 if first > second Return -1 if first < second Return 0 if first = second

func CreateAppVersionTable

func CreateAppVersionTable(dbName string) error

CreateAppVersionTable create table that maps application and latest version

func CreateDatabase

func CreateDatabase(dbName string) error

CreateDatabase creates a database in MySQL instance. CREATE operation is idempotent.

func CreateDeployment

func CreateDeployment(app string, NumGPU int64) error

CreateDeployment creates new deployment

func CreateDeploymentTimeTable

func CreateDeploymentTimeTable(dbName string) error

CreateDeploymentTimeTable creates a table for monitoring deployment time of runtimes

func CreateLogTimeTable

func CreateLogTimeTable(dbName string) error

CreateLogTimeTable create table for logging total response time and its component

func CreateProcessingTimeTable

func CreateProcessingTimeTable(dbName string, runtime string) error

CreateProcessingTimeTable creates a table for recording processing time of image batches

func CreateRegressionTable

func CreateRegressionTable(dbName string) error

CreateRegressionTable creates a table for Bayesian Ridge Regression coefficient and intercept

func Deploy

func Deploy(namespace string, deployment string, NumGPU int64, app string) (bool, bool, float64, error)

Deploy function deploys new deployment and patches kubeless function on Nautilus based on number of GPU

func Extrapolate

func Extrapolate(runtime string, imageNum int, app string, version string) float64

Extrapolate function inferences runtime by coefficient and intercept.

func GetBandWidth

func GetBandWidth() float64

GetBandWidth solicits bandwidth of Pi Zero at Sedgwick Reserve.

func GetDeploymentTime

func GetDeploymentTime(runtime string) map[string]float64

GetDeploymentTime returns the latest deployment time in the DeploymentTime table of specific runtime

func GetProcTime

func GetProcTime(imageNum int, app string, version string, runtime string) map[string]float64

GetProcTime calculates the runtime of four scenarios: edge, cpu, gpu1, gpu2

func GetTotalTime

func GetTotalTime(imageNum int, app string, version string, runtime string) (map[float64]string, map[string]*TimeLog)

GetTotalTime calculate total time (Addition of transfer and run time) of four scenarios

func GetTransferTime

func GetTransferTime(imageNum int) map[string]float64

GetTransferTime calculates the transfer time from Sedgwick reserve to Mayhem cloud to Nautilus

func GetWindowSize

func GetWindowSize(runtime string) int

GetWindowSize calculates the optimal window size for median of deployment time

func HomeDir

func HomeDir() string

HomeDir gets home directory of current user

func InitDB

func InitDB()

InitDB initializes DB and all necessary tables

func InsertAppVersion

func InsertAppVersion(app string, version string) error

InsertAppVersion inserts the nonexistent app and its current version

func IsPodReady

func IsPodReady(deployment string, deploymentsClient appsv1.DeploymentInterface) <-chan DeployResult

IsPodReady makes judgement about if a deployment is ready

func LogTimes

func LogTimes(imageNum int, app string, version string, runtime string, predTimeLog *TimeLog, actTimeLog *TimeLog)

LogTimes logs Predicted/Actual total response time, transfer time, deployment time, processing time

func Median

func Median(arr []float64) float64

Median returns the median of an array of float numbers

func Min

func Min(a int, b int) int

Min function returns the minimum between two integers

func NullString

func NullString(str string) sql.NullString

NullString returns sql NullString if the input is null

func ParseElapsed

func ParseElapsed(output []byte) float64

ParseElapsed capture time in output

func QueryAppVersion

func QueryAppVersion(app string) string

QueryAppVersion queries the latest version of an application Returns 0 when app doesn't exist in AppVersion table

func QueryDataSet

func QueryDataSet(runtime string, app string, version string, numDP int) (mat.Matrix, mat.Matrix)

QueryDataSet queries a certain amount of data point of runtimes from ProcessingTime table numDP - The number of data point in the data set return X (nSamples, nFeatures), Y (nSamples)

func QueryDeploymentTime

func QueryDeploymentTime(runtime string) float64

QueryDeploymentTime queries latest deployment time of specific runtime

func QueryDeploymentTimeNautilus

func QueryDeploymentTimeNautilus(numGPU int64, app string) (bool, float64)

QueryDeploymentTimeNautilus queries the current deployment time on Nautilus for runtimes

func QueryDeploymentTimeSeries

func QueryDeploymentTimeSeries(runtime string) []float64

QueryDeploymentTimeSeries queries a series of deployment time of specific runtime

func QueryGPUNum

func QueryGPUNum(namespace string, deployment string) int64

QueryGPUNum queries the number of GPU in current pod

func Regress

func Regress(runtime string, app string, version string, numDP int) (float64, float64)

Regress function leveraging Bayesian Ridge Regression

func Schedule

func Schedule(runtime string, imageNum int, app string, version string, all bool) []byte

Schedule is the entry point of Scheduler. Parameter: runtime is the preset runtime. If it's empty string, SelectRunTime will select one. Return: runtime for appending processing time to corresponding table

func SetupRegression

func SetupRegression(app string, version string)

SetupRegression set up multiple data points in each runtime processing time table for regression when the app / version is updated

func SocketClient

func SocketClient(port int, runtime string, app string, version string, all bool)

SocketClient listens to the task request from the server

func StartInquisitor

func StartInquisitor(winSizeInterval int, app string, interval int)

StartInquisitor starts inquisitor

func UpdateAppVersion

func UpdateAppVersion(app string, version string) error

UpdateAppVersion updates the latest version of an application

func UpdateDeploymentTimeTable

func UpdateDeploymentTimeTable(app string) error

UpdateDeploymentTimeTable updates the DeploymentTime table

func UpdateRegressionTimeTable

func UpdateRegressionTimeTable(runtime string) error

UpdateRegressionTimeTable updates coefficient and intercept of specific runtime in the Regression Table

Caution: Updating Regression Table is subject to disk I/O. Keep this functionality for future necessary use case

func UpdateWindowSizes

func UpdateWindowSizes()

UpdateWindowSizes updates optimal window sizes

Types

type DeployResult

type DeployResult struct {
	Progressed bool
	Timeout    bool
}

DeployResult contains progressed and timeout boolean values

type TimeLog

type TimeLog struct {
	Total      float64
	Transfer   float64
	Deployment float64
	Processing float64
}

TimeLog contains total response time and its three components

func CreateTimeLog

func CreateTimeLog(transfer float64, deployment float64, processing float64) *TimeLog

CreateTimeLog creates Time Log by three components

func Request

func Request(runtime string, imageNum int, app string, version string, transferTime float64) ([]byte, bool, *TimeLog)

Request is a wrap function both for executing jobs and setting up processing time table for regression

func RunOnEdge

func RunOnEdge(imageNum int, app string, version string) ([]byte, bool, *TimeLog)

RunOnEdge runs the task on mini edge cloud with AVX support

func RunOnNautilus

func RunOnNautilus(runtime string, imageNum int, app string, version string, transferTime float64) ([]byte, bool, *TimeLog)

RunOnNautilus sends request to Nautilus based on runtime and image number return output & processing time

func SelectRunTime

func SelectRunTime(imageNum int, app string, version string, runtime string) (string, *TimeLog)

SelectRunTime select the runtime among four scenarios

Jump to

Keyboard shortcuts

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