Back to godoc.org

Package deployment

v0.0.0 (afdeb59)
Latest Go to latest
Published: Jul 3, 2020 | License: Apache-2.0 | Module: github.com/odahu/odahu-flow/packages/operator

Index

Package Files

Constants

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"
	MaxMoreThanMinReplicasErrorMessage = "maximum number of replicas parameter must not be less than minimum 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"
)

Variables

var (
	MdDefaultMinimumReplicas            = int32(0)
	MdDefaultMaximumReplicas            = int32(1)
	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,
	deploymentConfig config.ModelDeploymentConfig,
	gpuResourceName string,
)

type ModelDeploymentController

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

type ModelDeploymentValidator

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

func NewModelDeploymentValidator

func NewModelDeploymentValidator(
	modelDeploymentConfig config.ModelDeploymentConfig,
	gpuResourceName string,
) *ModelDeploymentValidator

func (*ModelDeploymentValidator) ValidatesMDAndSetDefaults

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

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)
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

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