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 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 QuantityParser(v *QuantityValidation) func(string) (interface{}, error)
- func QuantityPtrID(quantity *Quantity) string
- func QuantityPtrsEqual(quantity *Quantity, quantity2 *Quantity) bool
- 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 ONNX
- type Predictor
- type Quantity
- func (quantity *Quantity) Equal(quantity2 Quantity) bool
- func (quantity *Quantity) ID() string
- func (quantity Quantity) MarshalBinary() ([]byte, error)
- func (quantity Quantity) MarshalJSON() ([]byte, error)
- func (quantity Quantity) MarshalText() ([]byte, error)
- func (quantity *Quantity) SplitInTwo() (*kresource.Quantity, *kresource.Quantity)
- func (quantity *Quantity) String() string
- func (quantity *Quantity) ToFloat32() float32
- func (quantity *Quantity) ToKi() int64
- func (quantity *Quantity) UnmarshalBinary(data []byte) error
- func (quantity *Quantity) UnmarshalJSON(data []byte) error
- func (quantity *Quantity) UnmarshalText(data []byte) error
- type QuantityValidation
- 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 TensorFlow
- type Tracker
Constants ¶
const ( // Shared UnknownKey = "unknown" NameKey = "name" KindKey = "kind" // API ModelKey = "model" PathKey = "path" EndpointKey = "endpoint" RequestHandlerKey = "request_handler" SignatureKeyKey = "signature_key" TrackerKey = "tracker" ModelTypeKey = "model_type" KeyKey = "key" TensorFlowKey = "tensorflow" ONNXKey = "onnx" PredictorKey = "predictor" MetadataKey = "metadata" PythonPathKey = "python_path" // 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 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 QuantityParser ¶
func QuantityParser(v *QuantityValidation) func(string) (interface{}, error)
func QuantityPtrID ¶
func QuantityPtrsEqual ¶
Types ¶
type API ¶
type API struct { ResourceFields Endpoint *string `json:"endpoint" yaml:"endpoint"` TensorFlow *TensorFlow `json:"tensorflow" yaml:"tensorflow"` ONNX *ONNX `json:"onnx" yaml:"onnx"` Predictor *Predictor `json:"predictor" yaml:"predictor"` Tracker *Tracker `json:"tracker" yaml:"tracker"` Compute *APICompute `json:"compute" yaml:"compute"` }
func (*API) AreProjectFilesRequired ¶ added in v0.8.0
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 Quantity `json:"cpu" yaml:"cpu"` Mem *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
func (*Config) AreProjectFilesRequired ¶ 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 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 ONNX ¶ added in v0.10.0
type ONNX struct { Model string `json:"model" yaml:"model"` RequestHandler *string `json:"request_handler" yaml:"request_handler"` PythonPath *string `json:"python_path" yaml:"python_path"` Metadata map[string]interface{} `json:"metadata" yaml:"metadata"` }
func (*ONNX) UserConfigStr ¶ added in v0.10.0
type Predictor ¶ added in v0.10.0
type Predictor struct { Path string `json:"path" yaml:"path"` Model *string `json:"model" yaml:"model"` PythonPath *string `json:"python_path" yaml:"python_path"` Metadata map[string]interface{} `json:"metadata" yaml:"metadata"` }
func (*Predictor) UserConfigStr ¶ added in v0.10.0
type Quantity ¶
func (Quantity) MarshalBinary ¶
func (Quantity) MarshalJSON ¶
func (Quantity) MarshalText ¶
func (*Quantity) SplitInTwo ¶
SplitInTwo divides the quantity in two and return both halves (ensuring they add up to the original value)
func (*Quantity) UnmarshalBinary ¶
func (*Quantity) UnmarshalJSON ¶
func (*Quantity) UnmarshalText ¶
type QuantityValidation ¶
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
type TensorFlow ¶ added in v0.10.0
type TensorFlow struct { Model string `json:"model" yaml:"model"` RequestHandler *string `json:"request_handler" yaml:"request_handler"` SignatureKey *string `json:"signature_key" yaml:"signature_key"` PythonPath *string `json:"python_path" yaml:"python_path"` Metadata map[string]interface{} `json:"metadata" yaml:"metadata"` }
func (*TensorFlow) UserConfigStr ¶ added in v0.10.0
func (tf *TensorFlow) UserConfigStr() string