batch

package
v0.0.0-...-58c3220 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const JobTagKey = "name"
View Source
const TagKey = "name"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionReference

type ConnectionReference struct {
	// ODAHU Connection
	Connection string `json:"connection"`
	// User can override path otherwise Connection path will be used.
	// For dataSource:
	// Input data files must have .json extension and be valid JSON files that follows
	// [Predict Protocol - Version 2](https://github.com/kubeflow/kfserving/blob/v0.5.1/docs/predict-api/v2/required_api.md#inference-request-json-object).
	// For outputDestination:
	// Output data files must have .json extension and be valid JSON files that follows
	// [Predict Protocol - Version 2](https://github.com/kubeflow/kfserving/blob/v0.5.1/docs/predict-api/v2/required_api.md#inference-response-json-object).
	// nFor modelSource:
	// If path has .zip / .tar.gz suffix then it will be unpacked before delivering to user predictor container.
	// Otherwise its considered and a directory and will be delivered to user predictor container AS-IS
	Path string `json:"path"`
}

ConnectionReference refers to specific Connection. Connection path can be overridden using Path

type InferenceJob

type InferenceJob struct {
	// Resource ID
	ID string `json:"id"`
	// Deletion mark
	DeletionMark bool `json:"deletionMark,omitempty" swaggerignore:"true"`
	// CreatedAt describes when InferenceJob was launched (readonly)
	CreatedAt time.Time `json:"createdAt,omitempty"`
	// UpdatedAt describes when InferenceJob was updated (readonly)
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
	// Spec describes parameters of InferenceJob
	Spec InferenceJobSpec `json:"spec,omitempty"`
	// Spec describes execution status of InferenceJob (readonly)
	Status InferenceJobStatus `json:"status,omitempty"`
}

type InferenceJobFilter

type InferenceJobFilter struct {
}

type InferenceJobSpec

type InferenceJobSpec struct {
	// InferenceServiceID refers to BatchInferenceService
	InferenceServiceID string `json:"inferenceServiceId"`
	// DataSource defines location input data files.
	// Input data files must have .json extension and be valid JSON files that follows
	// [Predict Protocol - Version 2](https://github.com/kubeflow/kfserving/blob/v0.5.1/docs/predict-api/v2/required_api.md#inference-request-json-object)
	// If nil then will be filled from BatchInferenceService.
	DataSource *ConnectionReference `json:"dataSource"`
	// OutputDestination defines location of directory with output files.
	// Output data files must have .json extension and be valid JSON files that follows
	// [Predict Protocol - Version 2](https://github.com/kubeflow/kfserving/blob/v0.5.1/docs/predict-api/v2/required_api.md#inference-response-json-object)
	// If nil then will be filled from BatchInferenceService.
	OutputDestination *ConnectionReference `json:"outputDestination"`
	// Node selector for specifying a node pool
	NodeSelector map[string]string `json:"nodeSelector"`
	// Resources for model container
	// The same format like k8s uses for pod resources.
	Resources *v1alpha1.ResourceRequirements `json:"resources"`
	// BatchRequestID is unique identifier for InferenceJob that helps to correlate between
	// Model input, model output and feedback
	// Take into account that it is not the same as kubeflow InferenceRequest id
	// Each InferenceJob can process more than one InferenceRequest (delivered in separate input file)
	// So each BatchRequestID has set of corresponding InferenceRequest and their IDs
	BatchRequestID string `json:"requestId"`
}

func (*InferenceJobSpec) Scan

func (spec *InferenceJobSpec) Scan(value interface{}) error

func (InferenceJobSpec) Value

func (spec InferenceJobSpec) Value() (driver.Value, error)

type InferenceJobStatus

type InferenceJobStatus struct {
	// State describes current state of InferenceJob
	State JobState `json:"state"`
	// Message is any message from runtime service about status of InferenceJob
	Message string `json:"message"`
	// Reason is a reason of some InferenceJob state that was retrieved from runtime service.
	// for example reason of failure
	Reason string `json:"reason"`
	// PodName is a name of Pod in Kubernetes that is running under the hood of InferenceJob
	PodName string `json:"podName"`
}

func (*InferenceJobStatus) Scan

func (in *InferenceJobStatus) Scan(value interface{}) error

func (InferenceJobStatus) Value

func (in InferenceJobStatus) Value() (driver.Value, error)

type InferenceService

type InferenceService struct {
	ID string `json:"id"`
	// Deletion mark. Managed by system. Cannot be overridden by User
	DeletionMark bool `json:"deletionMark,omitempty" swaggerignore:"true"`
	// When resource was created. Managed by system. Cannot be overridden by User
	CreatedAt time.Time `json:"createdAt"`
	// When resource was updated. Managed by system. Cannot be overridden by User
	UpdatedAt time.Time              `json:"updatedAt"`
	Spec      InferenceServiceSpec   `json:"spec"`
	Status    InferenceServiceStatus `json:"status"`
}

type InferenceServiceFilter

type InferenceServiceFilter struct {
}

type InferenceServiceSpec

type InferenceServiceSpec struct {
	// Image is OCI image that contains user defined prediction code
	Image string `json:"image"`
	// Entrypoint array. Not executed within a shell.
	// The docker image's ENTRYPOINT is used if this is not provided.
	// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
	// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
	// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
	// regardless of whether the variable exists or not.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
	Command []string `json:"command"`
	// Arguments to the entrypoint.
	// The docker image's CMD is used if this is not provided.
	// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
	// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
	// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
	// regardless of whether the variable exists or not.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
	Args []string `json:"args"`
	// ModelRegistry defines location of ML model files
	ModelRegistry v1alpha1.ModelSource `json:"modelRegistry"`
	// DataSource defines location input data files.
	// Input data files must have .json extension and be valid JSON files that follows
	// [Predict Protocol - Version 2](https://github.com/kubeflow/kfserving/blob/v0.5.1/docs/predict-api/v2/required_api.md#inference-request-json-object)
	// Can be overridden in BatchInferenceJob definition
	DataSource *ConnectionReference `json:"dataSource,omitempty"`
	// OutputDestination defines location of directory with output files.
	// Output data files must have .json extension and be valid JSON files that follows
	// [Predict Protocol - Version 2](https://github.com/kubeflow/kfserving/blob/v0.5.1/docs/predict-api/v2/required_api.md#inference-response-json-object)
	// Can be overridden in BatchInferenceJob definition
	OutputDestination *ConnectionReference `json:"outputDestination,omitempty"`
	// Triggers are describe how to run InferenceService
	Triggers InferenceServiceTriggers `json:"triggers"`
	// Node selector for specifying a node pool
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// Resources for model container
	// The same format like k8s uses for pod resources.
	Resources *v1alpha1.ResourceRequirements `json:"resources,omitempty"`
}

func (*InferenceServiceSpec) Scan

func (spec *InferenceServiceSpec) Scan(value interface{}) error

func (InferenceServiceSpec) Value

func (spec InferenceServiceSpec) Value() (driver.Value, error)

type InferenceServiceStatus

type InferenceServiceStatus struct{}

func (*InferenceServiceStatus) Scan

func (in *InferenceServiceStatus) Scan(value interface{}) error

func (InferenceServiceStatus) Value

func (in InferenceServiceStatus) Value() (driver.Value, error)

type InferenceServiceTriggers

type InferenceServiceTriggers struct {
	// Webhook provides a REST API to execute InferenceJob that correspond to this service
	Webhook *PredictorWebhookTrigger `json:"webhook,omitempty"`
}

type JobState

type JobState string
const (
	Scheduling JobState = "scheduling"
	Running    JobState = "running"
	Succeeded  JobState = "succeeded"
	Failed     JobState = "failed"
	Unknown    JobState = "unknown"
)

type PredictorWebhookTrigger

type PredictorWebhookTrigger struct {
	// Enabled. If True then it possible to run InferenceJob by creating it using REST API
	Enabled bool `json:"enabled"`
}

Jump to

Keyboard shortcuts

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