mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[8.12] [Enterprise Search] Fix pipeline generation after deploying a model in place (#173872) (#173881)
# Backport This will backport the following commits from `main` to `8.12`: - [[Enterprise Search] Fix pipeline generation after deploying a model in place (#173872)](https://github.com/elastic/kibana/pull/173872) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Adam Demjen","email":"demjened@gmail.com"},"sourceCommit":{"committedDate":"2023-12-21T21:49:42Z","message":"[Enterprise Search] Fix pipeline generation after deploying a model in place (#173872)\n\n## Summary\r\n\r\nFix for a bug that occurs after deploying a curated ML model (ELSER/E5)\r\nand selecting it for an inference pipeline. The generated pipeline is\r\nempty and the create action fails. This PR fixes this issue.\r\n\r\nBefore\r\n\r\n\r\nd2e67a31
-814c-4b1c-aca7-92909f6c47e5\r\n\r\n\r\n### Checklist\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"13c1dfaaf588691523b327c4f298e3ddabce2711","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:EnterpriseSearch","v8.12.0","v8.12.1","v8.13.0"],"number":173872,"url":"https://github.com/elastic/kibana/pull/173872","mergeCommit":{"message":"[Enterprise Search] Fix pipeline generation after deploying a model in place (#173872)\n\n## Summary\r\n\r\nFix for a bug that occurs after deploying a curated ML model (ELSER/E5)\r\nand selecting it for an inference pipeline. The generated pipeline is\r\nempty and the create action fails. This PR fixes this issue.\r\n\r\nBefore\r\n\r\n\r\nd2e67a31
-814c-4b1c-aca7-92909f6c47e5\r\n\r\n\r\n### Checklist\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"13c1dfaaf588691523b327c4f298e3ddabce2711"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/173872","number":173872,"mergeCommit":{"message":"[Enterprise Search] Fix pipeline generation after deploying a model in place (#173872)\n\n## Summary\r\n\r\nFix for a bug that occurs after deploying a curated ML model (ELSER/E5)\r\nand selecting it for an inference pipeline. The generated pipeline is\r\nempty and the create action fails. This PR fixes this issue.\r\n\r\nBefore\r\n\r\n\r\nd2e67a31
-814c-4b1c-aca7-92909f6c47e5\r\n\r\n\r\n### Checklist\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"13c1dfaaf588691523b327c4f298e3ddabce2711"}}]}] BACKPORT--> Co-authored-by: Adam Demjen <demjened@gmail.com>
This commit is contained in:
parent
4e7566d534
commit
713f89fc20
2 changed files with 9 additions and 2 deletions
|
@ -639,7 +639,7 @@ describe('MlInferenceLogic', () => {
|
|||
AddInferencePipelineSteps.Fields
|
||||
);
|
||||
});
|
||||
it('triggers pipeline fetch when moving from configuration step', () => {
|
||||
it('triggers pipeline and model fetch when moving from configuration step', () => {
|
||||
MLInferenceLogic.actions.setInferencePipelineConfiguration({
|
||||
...MLInferenceLogic.values.addInferencePipelineModal.configuration,
|
||||
pipelineName: 'unit-test-pipeline',
|
||||
|
@ -647,12 +647,14 @@ describe('MlInferenceLogic', () => {
|
|||
existingPipeline: false,
|
||||
});
|
||||
jest.spyOn(MLInferenceLogic.actions, 'fetchPipelineByName');
|
||||
jest.spyOn(MLInferenceLogic.actions, 'makeMLModelsRequest');
|
||||
MLInferenceLogic.actions.onAddInferencePipelineStepChange(AddInferencePipelineSteps.Fields);
|
||||
expect(MLInferenceLogic.actions.fetchPipelineByName).toHaveBeenCalledWith({
|
||||
pipelineName: 'ml-inference-unit-test-pipeline',
|
||||
});
|
||||
expect(MLInferenceLogic.actions.makeMLModelsRequest).toHaveBeenCalledWith(undefined);
|
||||
});
|
||||
it('does not trigger pipeline fetch existing pipeline is selected', () => {
|
||||
it('does not trigger pipeline and model fetch existing pipeline is selected', () => {
|
||||
MLInferenceLogic.actions.setInferencePipelineConfiguration({
|
||||
...MLInferenceLogic.values.addInferencePipelineModal.configuration,
|
||||
pipelineName: 'unit-test-pipeline',
|
||||
|
@ -660,8 +662,10 @@ describe('MlInferenceLogic', () => {
|
|||
existingPipeline: true,
|
||||
});
|
||||
jest.spyOn(MLInferenceLogic.actions, 'fetchPipelineByName');
|
||||
jest.spyOn(MLInferenceLogic.actions, 'makeMLModelsRequest');
|
||||
MLInferenceLogic.actions.onAddInferencePipelineStepChange(AddInferencePipelineSteps.Fields);
|
||||
expect(MLInferenceLogic.actions.fetchPipelineByName).not.toHaveBeenCalled();
|
||||
expect(MLInferenceLogic.actions.makeMLModelsRequest).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
describe('fetchPipelineSuccess', () => {
|
||||
|
|
|
@ -361,6 +361,9 @@ export const MLInferenceLogic = kea<
|
|||
});
|
||||
// Continue to the next step so we don't have to save it to state, we will change
|
||||
// back to the Configuration step if we find a pipeline with the same name
|
||||
|
||||
// Re-fetch ML model list to include those that were deployed in this step
|
||||
actions.makeMLModelsRequest(undefined);
|
||||
}
|
||||
actions.setAddInferencePipelineStep(step);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue