Skip to content

Commit

Permalink
Inference Logger Types (kubeflow#472)
Browse files Browse the repository at this point in the history
* Inference Logger Types

* Update from review

* Update from review

* Fix typo in InferenceLogResponse

* review updates

* Change enum Both to All

* revert url to pointer

* Simply to just logger

* Add missing CRD file
  • Loading branch information
ukclivecox authored and k8s-ci-robot committed Oct 30, 2019
1 parent df38d7c commit 180720e
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 7 deletions.
60 changes: 60 additions & 0 deletions config/default/crds/serving_v1alpha2_inferenceservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ spec:
required:
- container
type: object
logger:
description: Activate request/response logging
properties:
mode:
description: What payloads to log
type: string
url:
description: URL to send request logging CloudEvents
type: string
type: object
maxReplicas:
description: This is the up bound for autoscaler to scale to
format: int64
Expand All @@ -109,6 +119,16 @@ spec:
required:
- container
type: object
logger:
description: Activate request/response logging
properties:
mode:
description: What payloads to log
type: string
url:
description: URL to send request logging CloudEvents
type: string
type: object
maxReplicas:
description: This is the up bound for autoscaler to scale to
format: int64
Expand Down Expand Up @@ -249,6 +269,16 @@ spec:
required:
- container
type: object
logger:
description: Activate request/response logging
properties:
mode:
description: What payloads to log
type: string
url:
description: URL to send request logging CloudEvents
type: string
type: object
maxReplicas:
description: This is the up bound for autoscaler to scale to
format: int64
Expand Down Expand Up @@ -308,6 +338,16 @@ spec:
required:
- container
type: object
logger:
description: Activate request/response logging
properties:
mode:
description: What payloads to log
type: string
url:
description: URL to send request logging CloudEvents
type: string
type: object
maxReplicas:
description: This is the up bound for autoscaler to scale to
format: int64
Expand All @@ -333,6 +373,16 @@ spec:
required:
- container
type: object
logger:
description: Activate request/response logging
properties:
mode:
description: What payloads to log
type: string
url:
description: URL to send request logging CloudEvents
type: string
type: object
maxReplicas:
description: This is the up bound for autoscaler to scale to
format: int64
Expand Down Expand Up @@ -473,6 +523,16 @@ spec:
required:
- container
type: object
logger:
description: Activate request/response logging
properties:
mode:
description: What payloads to log
type: string
url:
description: URL to send request logging CloudEvents
type: string
type: object
maxReplicas:
description: This is the up bound for autoscaler to scale to
format: int64
Expand Down
22 changes: 22 additions & 0 deletions pkg/apis/serving/v1alpha2/inferenceservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,28 @@ type DeploymentSpec struct {
// This is the up bound for autoscaler to scale to
// +optional
MaxReplicas int `json:"maxReplicas,omitempty"`
// Activate request/response logging
// +optional
Logger *Logger `json:"logger,omitempty"`
}

type LoggerMode string

const (
LogAll LoggerMode = "all"
LogRequest LoggerMode = "request"
LogResponse LoggerMode = "response"
)

// Logger provides optional payload logging for all endpoints
// +experimental
type Logger struct {
// URL to send request logging CloudEvents
// +optional
Url *string `json:"url,omitempty"`
// What payloads to log
// +optional
Mode LoggerMode `json:"mode,omitempty"`
}

// PredictorSpec defines the configuration for a predictor,
Expand Down
57 changes: 53 additions & 4 deletions pkg/apis/serving/v1alpha2/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions pkg/apis/serving/v1alpha2/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
"v1alpha2.DeploymentSpec": {
"description": "DeploymentSpec defines the configuration for a given InferenceService service component",
"properties": {
"logger": {
"description": "Activate request/response logging",
"$ref": "#/definitions/v1alpha2.Logger"
},
"maxReplicas": {
"description": "This is the up bound for autoscaler to scale to",
"type": "integer",
Expand Down Expand Up @@ -142,6 +146,10 @@
"description": "Spec for a custom explainer",
"$ref": "#/definitions/v1alpha2.CustomSpec"
},
"logger": {
"description": "Activate request/response logging",
"$ref": "#/definitions/v1alpha2.Logger"
},
"maxReplicas": {
"description": "This is the up bound for autoscaler to scale to",
"type": "integer",
Expand Down Expand Up @@ -273,6 +281,19 @@
}
}
},
"v1alpha2.Logger": {
"description": "Logger provides optional payload logging for all endpoints",
"properties": {
"mode": {
"description": "What payloads to log",
"type": "string"
},
"url": {
"description": "URL to send request logging CloudEvents",
"type": "string"
}
}
},
"v1alpha2.ONNXSpec": {
"description": "ONNXSpec defines arguments for configuring ONNX model serving.",
"required": [
Expand Down Expand Up @@ -300,6 +321,10 @@
"description": "Spec for a custom predictor",
"$ref": "#/definitions/v1alpha2.CustomSpec"
},
"logger": {
"description": "Activate request/response logging",
"$ref": "#/definitions/v1alpha2.Logger"
},
"maxReplicas": {
"description": "This is the up bound for autoscaler to scale to",
"type": "integer",
Expand Down Expand Up @@ -448,6 +473,10 @@
"description": "Spec for a custom transformer",
"$ref": "#/definitions/v1alpha2.CustomSpec"
},
"logger": {
"description": "Activate request/response logging",
"$ref": "#/definitions/v1alpha2.Logger"
},
"maxReplicas": {
"description": "This is the up bound for autoscaler to scale to",
"type": "integer",
Expand Down
32 changes: 29 additions & 3 deletions pkg/apis/serving/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 180720e

Please sign in to comment.