Back to

Package deployment

Latest Go to latest

The latest major version is .

Published: Oct 9, 2019 | License: Apache-2.0 | Module:



const (
	GetModelDeploymentURL    = "/model/deployment/:id"
	GetAllModelDeploymentURL = "/model/deployment"
	CreateModelDeploymentURL = "/model/deployment"
	UpdateModelDeploymentURL = "/model/deployment"
	DeleteModelDeploymentURL = "/model/deployment/:id"
	IDMdURLParam             = "id"
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"
const (
	GetModelRouteURL    = "/model/route/:id"
	GetAllModelRouteURL = "/model/route"
	CreateModelRouteURL = "/model/route"
	UpdateModelRouteURL = "/model/route"
	DeleteModelRouteURL = "/model/route/:id"
	IDMrURLParam        = "id"
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"


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)
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)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier