-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add more granular config for model observability during deploym…
…ent (#619) <!-- Thanks for sending a pull request! Here are some tips for you: 1. Run unit tests and ensure that they are passing 2. If your change introduces any API changes, make sure to update the e2e tests 3. Make sure documentation is updated for your PR! --> # Description <!-- Briefly describe the motivation for the change. Please include illustrations where appropriate. --> Adding `model_observability` configuration that contains: * Enable -> Whether the model observability is enabled or not * Ground Truth Source -> The source for ground truth which later on will be use to ingest ground truth * Ground Truth Job -> The Job configuration to ingest ground truth * Prediction Log Ingestion Resource -> Resource configuration for observability publisher worker, currently we use default value that is set on platform level # Modifications <!-- Summarize the key code changes. --> * Modify swagger * Regenerate python client from modified swagger spec * Modify model_observability model * Update deployment of observability publisher worker * Update merlin sdk so user can supply `model_observability` config during deployment # Tests <!-- Besides the existing / updated automated tests, what specific scenarios should be tested? Consider the backward compatibility of the changes, whether corner cases are covered, etc. Please describe the tests and check the ones that have been completed. Eg: - [x] Deploying new and existing standard models - [ ] Deploying PyFunc models --> # Checklist - [x] Added PR label - [x] Added unit test, integration, and/or e2e tests - [ ] Tested locally - [ ] Updated documentation - [x] Update Swagger spec if the PR introduce API changes - [x] Regenerated Golang and Python client if the PR introduces API changes # Release Notes <!-- Does this PR introduce a user-facing change? If no, just write "NONE" in the release-note block below. If yes, a release note is required. Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". For more information about release notes, see kubernetes' guide here: http://git.k8s.io/community/contributors/guide/release-notes.md --> ```release-note ```
- Loading branch information
1 parent
2b0b062
commit 95d2e48
Showing
34 changed files
with
1,349 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package models | ||
|
||
import ( | ||
"database/sql/driver" | ||
"encoding/json" | ||
"errors" | ||
|
||
"k8s.io/apimachinery/pkg/api/resource" | ||
) | ||
|
||
// ModelObservability represents the configuration for model observability features. | ||
type ModelObservability struct { | ||
Enabled bool `json:"enabled"` | ||
GroundTruthSource *GroundTruthSource `json:"ground_truth_source"` | ||
GroundTruthJob *GroundTruthJob `json:"ground_truth_job"` | ||
PredictionLogIngestionResourceRequest *WorkerResourceRequest `json:"prediction_log_ingestion_resource_request"` | ||
} | ||
|
||
// GroundTruthSource represents the source configuration for ground truth data. | ||
type GroundTruthSource struct { | ||
TableURN string `json:"table_urn"` | ||
EventTimestampColumn string `json:"event_timestamp_column"` | ||
SourceProject string `json:"source_project"` | ||
} | ||
|
||
// GroundTruthJob represents the configuration for a scheduled job. | ||
type GroundTruthJob struct { | ||
CronSchedule string `json:"cron_schedule"` | ||
CPURequest string `json:"cpu_request"` | ||
CPULimit *string `json:"cpu_limit"` | ||
MemoryRequest string `json:"memory_request"` | ||
MemoryLimit *string `json:"memory_limit"` | ||
StartDayOffsetFromNow int `json:"start_day_offset_from_now"` | ||
EndDayOffsetFromNow int `json:"end_day_offset_from_now"` | ||
GracePeriodDay int `json:"grace_period_day"` | ||
ServiceAccountSecretName string `json:"service_account_secret_name"` | ||
} | ||
|
||
// WorkerResourceRequest represents the resource request for a worker (prediction log ingestion kafka consumer) deployment. | ||
type WorkerResourceRequest struct { | ||
CPURequest *resource.Quantity `json:"cpu_request"` | ||
MemoryRequest *resource.Quantity `json:"memory_request"` | ||
Replica int32 `json:"replica"` | ||
} | ||
|
||
func (mlob ModelObservability) Value() (driver.Value, error) { | ||
return json.Marshal(mlob) | ||
} | ||
|
||
func (mlob *ModelObservability) Scan(value interface{}) error { | ||
b, ok := value.([]byte) | ||
if !ok { | ||
return errors.New("type assertion to []byte failed") | ||
} | ||
|
||
return json.Unmarshal(b, &mlob) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.