Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure request is chained before payload is logged #4301

Merged
merged 3 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions executor/licenses/dep.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ github.com/jstemmer/go-junit-report
github.com/jtolds/gls
github.com/julienschmidt/httprouter
github.com/jung-kurt/gofpdf
github.com/kedacore/keda
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this from a missed license run from a different PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that way. Either that, or some subdep got updated. The linter failed within the GH Action, and re-generating the licenses file locally fixed it.

github.com/kedacore/keda/v2
github.com/kelseyhightower/envconfig
github.com/kisielk/errcheck
Expand Down Expand Up @@ -401,7 +400,6 @@ google.golang.org/protobuf
gopkg.in/alecthomas/kingpin.v2
gopkg.in/check.v1
gopkg.in/errgo.v2
gopkg.in/evanphx/json-patch.v4
gopkg.in/fsnotify.v1
gopkg.in/inf.v0
gopkg.in/ini.v1
Expand Down
9 changes: 5 additions & 4 deletions executor/predictor/predictor_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ func (p *PredictorProcess) transformInput(node *v1.PredictiveUnit, msg payload.S
modelName := p.getModelName(node)

if callModel || callTransformInput {
msg, err := p.Client.Chain(p.Ctx, modelName, msg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, also for the Tensorflow protocol - thinking it may be worth also implementing this for the transformOutput method?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here if the chain function fails and throws an error, the message will not be logged, is that a concern?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot @axsaucedo , just added the same for transformOutput.

@SachinVarghese that's a good point. Although if the chaining fails, the request will also fail. Should we log the request if we know it's gonna fail?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look at this again, current behavior seems to be good.

if err != nil {
return nil, err
}

//Log Request
if node.Logger != nil && (node.Logger.Mode == v1.LogRequest || node.Logger.Mode == v1.LogAll) {
err := p.logPayload(node.Name, node.Logger, payloadLogger.InferenceRequest, msg, puid)
Expand All @@ -108,10 +113,6 @@ func (p *PredictorProcess) transformInput(node *v1.PredictiveUnit, msg payload.S
}
}

msg, err := p.Client.Chain(p.Ctx, modelName, msg)
if err != nil {
return nil, err
}
p.RoutingMutex.Lock()
p.Routing[node.Name] = -1
p.RoutingMutex.Unlock()
Expand Down