Skip to content

Commit

Permalink
[Model Monitoring] Fix default sampling_percentage on serving deplo…
Browse files Browse the repository at this point in the history
…yment when monitoring is disabled (mlrun#7053)

When a user deploys a serving func without mm, the model endpoint is
generated with `monitoring mode` set to `disabled`. However, in this
case, the serving func has no `sampling_percentage` configuration, which
led to a bug during mep creation. This PR fixes this issue by setting a
default `sampling_percentage` value of 100 when it is not specified in
the serving spec.

https://iguazio.atlassian.net/browse/ML-8997
  • Loading branch information
Eyal-Danieli authored Jan 5, 2025
1 parent c51dd1a commit e6c1738
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/py/services/api/crud/model_monitoring/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1309,9 +1309,9 @@ async def create_model_endpoints(self, function: dict, function_name: str):
function_tag=function.metadata.tag,
track_models=function.spec.track_models,
graph=function.spec.graph,
sampling_percentage=function.spec.parameters[
mm_constants.EventFieldType.SAMPLING_PERCENTAGE
],
sampling_percentage=function.spec.parameters.get(
mm_constants.EventFieldType.SAMPLING_PERCENTAGE, 100
),
) # model endpoint, creation strategy, model path
router_model_endpoints_instructions: list[
tuple[
Expand Down

0 comments on commit e6c1738

Please sign in to comment.