-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[8.6][ML Inference] Add ML inference failure handler #142488
[8.6][ML Inference] Add ML inference failure handler #142488
Conversation
…jened/kibana into create-ml-inference-pipeline
…-ref HEAD~1..HEAD --fix'
…-ref HEAD~1..HEAD --fix'
…-ref HEAD~1..HEAD --fix'
…-ref HEAD~1..HEAD --fix'
…-ref HEAD~1..HEAD --fix'
expect(actualResult).toEqual( | ||
expect.objectContaining({ | ||
processors: expect.arrayContaining([ | ||
{ | ||
inference: expect.objectContaining({ | ||
field_map: { | ||
[sourceField]: modelInputField, | ||
}, | ||
}), | ||
}, | ||
]), | ||
}) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's unnecessary code duplication that we check the entire result object here - this is already covered in the "should return the pipeline body" test case. I modified the test to only look for the field that is different under the actual conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Good to know about these expcet.*Containing
functions 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it is quite easy to do unwanted side effects, we usually do a full object checks especially for the Redux/Kea states to make sure we only change the part where we want to change. I am curious if that would be useful here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, good point Efe. I'll update the code to work with full objects and assign()
the modified part that the test is focusing on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use destructuring as well.
i.e.
{
...EXPECTED_DEFAULTS,
only: {
the_changed: "parts"
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up using lodash merge()
since destructuring didn't work for changing a single array element's specific property while leaving everything else untouched. (Or maybe I just don't know how to do it 🙂)
value: [ | ||
{ | ||
pipeline: pipelineName, | ||
message: `Processor 'inference' in pipeline '${pipelineName}' failed with message '{{ _ingest.on_failure_message }}'`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I named this property message
instead of error
to make it semantically more extensible (e.g. for warnings).
expect(actualResult).toEqual( | ||
expect.objectContaining({ | ||
processors: expect.arrayContaining([ | ||
{ | ||
inference: expect.objectContaining({ | ||
field_map: { | ||
[sourceField]: modelInputField, | ||
}, | ||
}), | ||
}, | ||
]), | ||
}) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Good to know about these expcet.*Containing
functions 👍
17f3132
to
4e7f645
Compare
…-ref HEAD~1..HEAD --fix'
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
* Add ML Inference failure handler
* Add ML Inference failure handler
Summary
Parent issue: https://github.com/elastic/enterprise-search-team/issues/2680
This PR adds a default failure handler to Machine Learning Inference pipelines, specifically the
inference
processor. As a result, any errors occurring during ML inference are caught and appended to the_ingest.inference_errors
array as a rich object. This will help surface issues to the UI.Sample:
Checklist
Delete any items that are not applicable to this PR.