Version: v0.0.0-...-db3a1d9 Latest Latest

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

Go to latest
Published: Nov 8, 2019 License: Apache-2.0 Imports: 15 Imported by: 0




View Source
const (
	GetModelDeploymentURL    = "/model/deployment/:id"
	GetAllModelDeploymentURL = "/model/deployment"
	CreateModelDeploymentURL = "/model/deployment"
	UpdateModelDeploymentURL = "/model/deployment"
	DeleteModelDeploymentURL = "/model/deployment/:id"
	IDMdURLParam             = "id"
View Source
const (
	EmptyImageErrorMessage             = "the image parameter is empty"
	NegativeMinReplicasErrorMessage    = "minimum number of replicas parameter must not be less than 0"
	NegativeMaxReplicasErrorMessage    = "maximum number of replicas parameter must not be less than 1"
	MinMoreThanMinReplicasErrorMessage = "minimum number of replicas parameter must not be less than maximum" +
		" number of replicas parameter"
	ReadinessProbeErrorMessage = "readiness probe must be positive number"
	LivenessProbeErrorMessage  = "liveness probe parameter must be positive number"
View Source
const (
	GetModelRouteURL    = "/model/route/:id"
	GetAllModelRouteURL = "/model/route"
	CreateModelRouteURL = "/model/route"
	UpdateModelRouteURL = "/model/route"
	DeleteModelRouteURL = "/model/route/:id"
	IDMrURLParam        = "id"
View Source
const (
	URLPrefixEmptyErrorMessage = "URL Prefix must not be empty"
	EmptyTargetErrorMessage    = "model deployment targets must contain at least one element"
	OneTargetErrorMessage      = "it must have 100 weight or nil value if there is only one target"
	MissedWeightErrorMessage   = "weights must be present if there are more than one model deployment targets"
	TotalWeightErrorMessage    = "total target weight does not equal 100"
	URLPrefixSlashErrorMessage = "the URL prefix must start with slash"
	ForbiddenPrefix            = "the URL prefix %s is forbidden"
	ErrorMessageTemplate       = "%s: %s"
	ValidationMrErrorMessage   = "Validation of model route is failed"


View Source
var (
	MdDefaultMinimumReplicas = int32(0)
	MdDefaultMaximumReplicas = int32(1)

	MdDefaultResources = &v1alpha1.ResourceRequirements{
		Limits: &v1alpha1.ResourceList{
			CPU:    &defaultCPULimit,
			Memory: &defaultMemoryLimit,
		Requests: &v1alpha1.ResourceList{
			CPU:    &defaultCPURequests,
			Memory: &defaultMemoryRequests,
	MdDefaultLivenessProbeInitialDelay  = int32(2)
	MdDefaultReadinessProbeInitialDelay = int32(2)
View Source
var (
	MaxWeight         = int32(100)
	ForbiddenPrefixes = []string{
		"/model", "/feedback",


func ConfigureRoutes

func ConfigureRoutes(routeGroup *gin.RouterGroup, repository md_repository.Repository)

func ValidatesMDAndSetDefaults

func ValidatesMDAndSetDefaults(md *deployment.ModelDeployment) (err error)


type ModelDeploymentController

type ModelDeploymentController struct {
	// contains filtered or unexported fields

type ModelRouteController

type ModelRouteController struct {
	// contains filtered or unexported fields

type MrValidator

type MrValidator struct {
	// contains filtered or unexported fields

func NewMrValidator

func NewMrValidator(mdRepository md_repository.Repository) *MrValidator

func (*MrValidator) ValidatesAndSetDefaults

func (mrv *MrValidator) ValidatesAndSetDefaults(mr *deployment.ModelRoute) (err error)

Jump to

Keyboard shortcuts

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