Documentation ¶
Index ¶
- Constants
- func ErrorCannotBeNull() error
- func ErrorDuplicateConfig(resourceType resource.Type) error
- func ErrorDuplicateEndpoints(endpoint string, apiNames ...string) error
- func ErrorDuplicateResourceName(resources ...Resource) error
- func ErrorExternalNotFound(path string) error
- func ErrorFieldMustBeDefinedForPredictorType(fieldKey string, predictorType PredictorType) error
- func ErrorFieldNotSupportedByPredictorType(fieldKey string, predictorType PredictorType) error
- func ErrorImplDoesNotExist(path string) error
- func ErrorInitReplicasGreaterThanMax(init int32, max int32) error
- func ErrorInitReplicasLessThanMin(init int32, min int32) error
- func ErrorInvalidTensorFlowDir(path string) error
- func ErrorMalformedConfig() error
- func ErrorMinReplicasGreaterThanMax(min int32, max int32) error
- func ErrorMissingAppDefinition() error
- func ErrorONNXDoesntSupportZip() error
- func ErrorOneOfPrerequisitesNotDefined(argName string, prerequisites ...string) error
- func ErrorSpecifyAllOrNone(vals ...string) error
- func ErrorSpecifyOneModelFormatFoundMultiple(found []string, vals ...string) error
- func ErrorSpecifyOneModelFormatFoundNone(vals ...string) error
- func ErrorUndefinedResource(resourceName string, resourceTypes ...resource.Type) error
- func GetTFServingExportFromS3Path(path string, awsClient *aws.Client) (string, error)
- func Identify(r Resource) string
- func IsValidTensorFlowS3Directory(path string, awsClient *aws.Client) bool
- func ModelTypeStrings() []string
- func PredictorTypeStrings() []string
- func ValidatePythonPath(path string, projectFileMap map[string][]byte) error
- type API
- type APICompute
- type APIs
- type App
- type Config
- type Error
- type ErrorKind
- type ModelType
- type Predictor
- type PredictorType
- type Resource
- type ResourceFields
- func (resourceFields *ResourceFields) GetFilePath() string
- func (resourceFields *ResourceFields) GetIndex() int
- func (resourceFields *ResourceFields) GetName() string
- func (resourceFields *ResourceFields) SetFilePath(filePath string)
- func (resourceFields *ResourceFields) SetIndex(index int)
- func (resourceFields *ResourceFields) UserConfigStr() string
- type Tracker
Constants ¶
const ( // Shared UnknownKey = "unknown" NameKey = "name" KindKey = "kind" // API ModelKey = "model" TypeKey = "type" PathKey = "path" PredictorKey = "predictor" EndpointKey = "endpoint" SignatureKeyKey = "signature_key" TrackerKey = "tracker" ModelTypeKey = "model_type" KeyKey = "key" ConfigKey = "config" PythonPathKey = "python_path" EnvKey = "env" // Compute ComputeKey = "compute" MinReplicasKey = "min_replicas" MaxReplicasKey = "max_replicas" InitReplicasKey = "init_replicas" TargetCPUUtilizationKey = "target_cpu_utilization" CPUKey = "cpu" GPUKey = "gpu" MemKey = "mem" )
Variables ¶
This section is empty.
Functions ¶
func ErrorCannotBeNull ¶
func ErrorCannotBeNull() error
func ErrorDuplicateConfig ¶
func ErrorDuplicateEndpoints ¶ added in v0.10.0
func ErrorExternalNotFound ¶ added in v0.4.1
func ErrorFieldMustBeDefinedForPredictorType ¶ added in v0.12.0
func ErrorFieldMustBeDefinedForPredictorType(fieldKey string, predictorType PredictorType) error
func ErrorFieldNotSupportedByPredictorType ¶ added in v0.12.0
func ErrorFieldNotSupportedByPredictorType(fieldKey string, predictorType PredictorType) error
func ErrorImplDoesNotExist ¶
func ErrorInitReplicasGreaterThanMax ¶ added in v0.6.0
func ErrorInitReplicasLessThanMin ¶ added in v0.6.0
func ErrorInvalidTensorFlowDir ¶ added in v0.9.0
func ErrorMalformedConfig ¶
func ErrorMalformedConfig() error
func ErrorMinReplicasGreaterThanMax ¶ added in v0.6.0
func ErrorMissingAppDefinition ¶
func ErrorMissingAppDefinition() error
func ErrorONNXDoesntSupportZip ¶ added in v0.8.0
func ErrorONNXDoesntSupportZip() error
func ErrorSpecifyAllOrNone ¶
func ErrorSpecifyOneModelFormatFoundMultiple ¶ added in v0.10.0
func ErrorSpecifyOneModelFormatFoundNone ¶ added in v0.10.0
func ErrorUndefinedResource ¶
func GetTFServingExportFromS3Path ¶ added in v0.8.0
func IsValidTensorFlowS3Directory ¶ added in v0.8.0
IsValidTensorFlowS3Directory checks that the path contains a valid S3 directory for TensorFlow models Must contain the following structure: - 1523423423/ (version prefix, usually a timestamp)
- saved_model.pb
- variables/
- variables.index
- variables.data-00000-of-00001 (there are a variable number of these files)
func ModelTypeStrings ¶ added in v0.8.0
func ModelTypeStrings() []string
func PredictorTypeStrings ¶ added in v0.12.0
func PredictorTypeStrings() []string
Types ¶
type API ¶
type API struct { ResourceFields Endpoint *string `json:"endpoint" yaml:"endpoint"` Predictor *Predictor `json:"predictor" yaml:"predictor"` Tracker *Tracker `json:"tracker" yaml:"tracker"` Compute *APICompute `json:"compute" yaml:"compute"` }
func (*API) GetResourceType ¶
func (*API) UserConfigStr ¶ added in v0.5.0
type APICompute ¶
type APICompute struct { MinReplicas int32 `json:"min_replicas" yaml:"min_replicas"` MaxReplicas int32 `json:"max_replicas" yaml:"max_replicas"` InitReplicas int32 `json:"init_replicas" yaml:"init_replicas"` TargetCPUUtilization int32 `json:"target_cpu_utilization" yaml:"target_cpu_utilization"` CPU k8s.Quantity `json:"cpu" yaml:"cpu"` Mem *k8s.Quantity `json:"mem" yaml:"mem"` GPU int64 `json:"gpu" yaml:"gpu"` }
func (*APICompute) ID ¶
func (ac *APICompute) ID() string
func (*APICompute) IDWithoutReplicas ¶
func (ac *APICompute) IDWithoutReplicas() string
Only consider CPU, Mem, GPU
func (*APICompute) UserConfigStr ¶ added in v0.5.0
func (ac *APICompute) UserConfigStr() string
func (*APICompute) Validate ¶ added in v0.6.0
func (ac *APICompute) Validate() error
type Config ¶
func ReadConfigFile ¶ added in v0.8.0
type ErrorKind ¶
type ErrorKind int
const ( ErrUnknown ErrorKind = iota ErrDuplicateResourceName ErrDuplicateConfig ErrMalformedConfig ErrMissingAppDefinition ErrUndefinedResource ErrSpecifyAllOrNone ErrSpecifyOnlyOne ErrOneOfPrerequisitesNotDefined ErrCannotBeNull ErrMinReplicasGreaterThanMax ErrInitReplicasGreaterThanMax ErrInitReplicasLessThanMin ErrSpecifyOneModelFormatFoundNone ErrSpecifyOneModelFormatFoundMultiple ErrImplDoesNotExist ErrExternalNotFound ErrONNXDoesntSupportZip ErrInvalidTensorFlowDir ErrFieldMustBeDefinedForPredictorType ErrFieldNotSupportedByPredictorType ErrDuplicateEndpoints )
func (ErrorKind) MarshalBinary ¶
MarshalBinary satisfies BinaryMarshaler
func (ErrorKind) MarshalText ¶
MarshalText satisfies TextMarshaler
func (*ErrorKind) UnmarshalBinary ¶
UnmarshalBinary satisfies BinaryUnmarshaler Needed for msgpack
func (*ErrorKind) UnmarshalText ¶
UnmarshalText satisfies TextUnmarshaler
type ModelType ¶ added in v0.8.0
type ModelType int
func ModelTypeFromString ¶ added in v0.8.0
func (ModelType) MarshalBinary ¶ added in v0.8.0
MarshalBinary satisfies BinaryMarshaler
func (ModelType) MarshalText ¶ added in v0.8.0
MarshalText satisfies TextMarshaler
func (*ModelType) UnmarshalBinary ¶ added in v0.8.0
UnmarshalBinary satisfies BinaryUnmarshaler Needed for msgpack
func (*ModelType) UnmarshalText ¶ added in v0.8.0
UnmarshalText satisfies TextUnmarshaler
type Predictor ¶ added in v0.10.0
type Predictor struct { Type PredictorType `json:"type" yaml:"type"` Path string `json:"path" yaml:"path"` Model *string `json:"model" yaml:"model"` PythonPath *string `json:"python_path" yaml:"python_path"` Config map[string]interface{} `json:"config" yaml:"config"` Env map[string]string `json:"env" yaml:"env"` SignatureKey *string `json:"signature_key" yaml:"signature_key"` }
func (*Predictor) ONNXValidate ¶ added in v0.12.0
func (*Predictor) PythonValidate ¶ added in v0.12.0
func (*Predictor) TensorFlowValidate ¶ added in v0.12.0
func (*Predictor) UserConfigStr ¶ added in v0.10.0
type PredictorType ¶ added in v0.12.0
type PredictorType int
const ( UnknownPredictorType PredictorType = iota PythonPredictorType TensorFlowPredictorType ONNXPredictorType )
func PredictorTypeFromString ¶ added in v0.12.0
func PredictorTypeFromString(s string) PredictorType
func (PredictorType) MarshalBinary ¶ added in v0.12.0
func (t PredictorType) MarshalBinary() ([]byte, error)
MarshalBinary satisfies BinaryMarshaler
func (PredictorType) MarshalText ¶ added in v0.12.0
func (t PredictorType) MarshalText() ([]byte, error)
MarshalText satisfies TextMarshaler
func (PredictorType) String ¶ added in v0.12.0
func (t PredictorType) String() string
func (*PredictorType) UnmarshalBinary ¶ added in v0.12.0
func (t *PredictorType) UnmarshalBinary(data []byte) error
UnmarshalBinary satisfies BinaryUnmarshaler Needed for msgpack
func (*PredictorType) UnmarshalText ¶ added in v0.12.0
func (t *PredictorType) UnmarshalText(text []byte) error
UnmarshalText satisfies TextUnmarshaler
type Resource ¶
type Resource interface { GetName() string GetResourceType() resource.Type GetIndex() int SetIndex(int) GetFilePath() string SetFilePath(string) }
type ResourceFields ¶
type ResourceFields struct { Name string `json:"name" yaml:"name"` Index int `json:"index" yaml:"-"` FilePath string `json:"file_path" yaml:"-"` }
func (*ResourceFields) GetFilePath ¶
func (resourceFields *ResourceFields) GetFilePath() string
func (*ResourceFields) GetIndex ¶
func (resourceFields *ResourceFields) GetIndex() int
func (*ResourceFields) GetName ¶
func (resourceFields *ResourceFields) GetName() string
func (*ResourceFields) SetFilePath ¶
func (resourceFields *ResourceFields) SetFilePath(filePath string)
func (*ResourceFields) SetIndex ¶
func (resourceFields *ResourceFields) SetIndex(index int)
func (*ResourceFields) UserConfigStr ¶ added in v0.5.0
func (resourceFields *ResourceFields) UserConfigStr() string