Documentation
¶
Index ¶
- Variables
- func AppendRecordDeployment(dbName string, cpu string, gpu1 string, gpu2 string) error
- func AppendRecordLogTime(imageNum int, app string, version string, runtime string, predTotal float64, ...) error
- func AppendRecordProcessing(dbName string, runtime string, imageNum int, duration float64, ...) error
- func Average(arr []float64) float64
- func CompareVersion(version1 string, version2 string) int
- func CreateAppVersionTable(dbName string) error
- func CreateDatabase(dbName string) error
- func CreateDeployment(app string, NumGPU int64) error
- func CreateDeploymentTimeTable(dbName string) error
- func CreateLogTimeTable(dbName string) error
- func CreateProcessingTimeTable(dbName string, runtime string) error
- func CreateRegressionTable(dbName string) error
- func Deploy(namespace string, deployment string, NumGPU int64, app string) (bool, bool, float64, error)
- func Extrapolate(runtime string, imageNum int, app string, version string) float64
- func GetBandWidth() float64
- func GetDeploymentTime(runtime string) map[string]float64
- func GetProcTime(imageNum int, app string, version string, runtime string) map[string]float64
- func GetTotalTime(imageNum int, app string, version string, runtime string) (map[float64]string, map[string]*TimeLog)
- func GetTransferTime(imageNum int) map[string]float64
- func GetWindowSize(runtime string) int
- func HomeDir() string
- func InitDB()
- func InsertAppVersion(app string, version string) error
- func IsPodReady(deployment string, deploymentsClient appsv1.DeploymentInterface) <-chan DeployResult
- func LogTimes(imageNum int, app string, version string, runtime string, predTimeLog *TimeLog, ...)
- func Median(arr []float64) float64
- func Min(a int, b int) int
- func NullString(str string) sql.NullString
- func ParseElapsed(output []byte) float64
- func QueryAppVersion(app string) string
- func QueryDataSet(runtime string, app string, version string, numDP int) (mat.Matrix, mat.Matrix)
- func QueryDeploymentTime(runtime string) float64
- func QueryDeploymentTimeNautilus(numGPU int64, app string) (bool, float64)
- func QueryDeploymentTimeSeries(runtime string) []float64
- func QueryGPUNum(namespace string, deployment string) int64
- func Regress(runtime string, app string, version string, numDP int) (float64, float64)
- func Schedule(runtime string, imageNum int, app string, version string, all bool) []byte
- func SetupRegression(app string, version string)
- func SocketClient(port int, runtime string, app string, version string, all bool)
- func StartInquisitor(winSizeInterval int, app string, interval int)
- func UpdateAppVersion(app string, version string) error
- func UpdateDeploymentTimeTable(app string) error
- func UpdateRegressionTimeTable(runtime string) error
- func UpdateWindowSizes()
- type DeployResult
- type TimeLog
- func CreateTimeLog(transfer float64, deployment float64, processing float64) *TimeLog
- func Request(runtime string, imageNum int, app string, version string, transferTime float64) ([]byte, bool, *TimeLog)
- func RunOnEdge(imageNum int, app string, version string) ([]byte, bool, *TimeLog)
- func RunOnNautilus(runtime string, imageNum int, app string, version string, transferTime float64) ([]byte, bool, *TimeLog)
- func SelectRunTime(imageNum int, app string, version string, runtime string) (string, *TimeLog)
Constants ¶
This section is empty.
Variables ¶
var (
RunDeployment string = "image-clf-inf"
)
Global variable of Configuration
Functions ¶
func AppendRecordDeployment ¶
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 CompareVersion ¶
CompareVersion compares two version strings Return 1 if first > second Return -1 if first < second Return 0 if first = second
func CreateAppVersionTable ¶
CreateAppVersionTable create table that maps application and latest version
func CreateDatabase ¶
CreateDatabase creates a database in MySQL instance. CREATE operation is idempotent.
func CreateDeployment ¶
CreateDeployment creates new deployment
func CreateDeploymentTimeTable ¶
CreateDeploymentTimeTable creates a table for monitoring deployment time of runtimes
func CreateLogTimeTable ¶
CreateLogTimeTable create table for logging total response time and its component
func CreateProcessingTimeTable ¶
CreateProcessingTimeTable creates a table for recording processing time of image batches
func CreateRegressionTable ¶
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 ¶
Extrapolate function inferences runtime by coefficient and intercept.
func GetBandWidth ¶
func GetBandWidth() float64
GetBandWidth solicits bandwidth of Pi Zero at Sedgwick Reserve.
func GetDeploymentTime ¶
GetDeploymentTime returns the latest deployment time in the DeploymentTime table of specific runtime
func GetProcTime ¶
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 ¶
GetTransferTime calculates the transfer time from Sedgwick reserve to Mayhem cloud to Nautilus
func GetWindowSize ¶
GetWindowSize calculates the optimal window size for median of deployment time
func InsertAppVersion ¶
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 NullString ¶
func NullString(str string) sql.NullString
NullString returns sql NullString if the input is null
func QueryAppVersion ¶
QueryAppVersion queries the latest version of an application Returns 0 when app doesn't exist in AppVersion table
func QueryDataSet ¶
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 ¶
QueryDeploymentTime queries latest deployment time of specific runtime
func QueryDeploymentTimeNautilus ¶
QueryDeploymentTimeNautilus queries the current deployment time on Nautilus for runtimes
func QueryDeploymentTimeSeries ¶
QueryDeploymentTimeSeries queries a series of deployment time of specific runtime
func QueryGPUNum ¶
QueryGPUNum queries the number of GPU in current pod
func Schedule ¶
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 ¶
SetupRegression set up multiple data points in each runtime processing time table for regression when the app / version is updated
func SocketClient ¶
SocketClient listens to the task request from the server
func StartInquisitor ¶
StartInquisitor starts inquisitor
func UpdateAppVersion ¶
UpdateAppVersion updates the latest version of an application
func UpdateDeploymentTimeTable ¶
UpdateDeploymentTimeTable updates the DeploymentTime table
func UpdateRegressionTimeTable ¶
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
Types ¶
type DeployResult ¶
DeployResult contains progressed and timeout boolean values
type TimeLog ¶
TimeLog contains total response time and its three components
func CreateTimeLog ¶
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