Commit a8c7bd0
[Security Assistant] Fix Inference endpoint setup (elastic#219024)
## Summary
Fixes an issue introduced in version 8.18.0, where the system switched
to using the default inference endpoint and, as part of this change,
cleaned up the dedicated inference endpoint. However, `Index entries` in
the Knowledge Base might still reference the dedicated endpoint. This PR
addresses the problem by deleting the dedicated endpoint only when it is
no longer in use, and adds logic to recreate the endpoint if any `Index
entries` still point to it.
Additionally, a new `responseTimeout` parameter has been added to the
plugin configuration. This allows controlling the response timeout in
the Security Assistant, which can be useful when running local models.
Testing guideline:
1. Set up version `8.17.5` using
[QAF](https://docs.elastic.dev/appex-qa/qaf/getting-started)
```qaf deployments create --stack-version 8.17.5 --no-es-ssl --name upgrade-test-elser --bootstrap-password changeme```
2. Set up Knowledge base http://localhost:5601/app/management/kibana/securityAiAssistantManagement?tab=knowledge_base
3. Add custom index with `semantic_text` using `elastic-security-ai-assistant-elser2`
4. Add KB `Index entry` using this index
5. Upgrade to `8.18.0`
```qaf deployments upgrade upgrade-test-elser --stack-version 8.18.0
--full-cluster-restart```
6. Check if `elastic-security-ai-assistant-elser2` was deleted in
http://localhost:5601/app/ml/overview
7. Stop kibana
````qaf deployments stop-kibana upgrade-test-elser```
8. Run kibana on this branch https://github.com/patrykkopycinski/kibana/tree/fix/security-inference-endpoint-8-18
9. Check if `elastic-security-ai-assistant-elser2` was recreated http://localhost:5601/app/ml/overview1 parent c576530 commit a8c7bd0
File tree
35 files changed
+615
-459
lines changed- x-pack
- platform
- solutions/security/plugins/elastic_assistant/server
- __mocks__
- ai_assistant_data_clients/knowledge_base
- ai_assistant_service
- lib
- langchain
- executors
- graphs/default_assistant_graph
- nodes
- prompt
- routes
- chat
- evaluate
- test
- functional/es_archives/security_solution/attack_discovery_alerts
- security_solution_api_integration/test_suites/genai
- evaluations/trial_license_complete_tier
- knowledge_base/entries/utils
35 files changed
+615
-459
lines changedLines changed: 0 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
Lines changed: 1 addition & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 41 | | |
48 | 42 | | |
49 | 43 | | |
| |||
58 | 52 | | |
59 | 53 | | |
60 | 54 | | |
61 | | - | |
62 | 55 | | |
63 | 56 | | |
64 | 57 | | |
| |||
Lines changed: 1 addition & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 42 | | |
49 | 43 | | |
50 | 44 | | |
| |||
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
65 | | - | |
66 | 59 | | |
67 | 60 | | |
68 | 61 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| |||
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
40 | 48 | | |
41 | 49 | | |
42 | 50 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
| 71 | + | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
165 | 179 | | |
166 | 180 | | |
167 | 181 | | |
| |||
0 commit comments