-
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
[EPM] /packages/{package} endpoint to support upgrades #63629
[EPM] /packages/{package} endpoint to support upgrades #63629
Conversation
Pinging @elastic/ingest-management (Feature:EPM) |
33d457d
to
fc41fa7
Compare
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 made some comments on names and exported types that I'd like to see , but good to ship as-is from me.
@@ -256,10 +256,32 @@ export enum DefaultPackages { | |||
endpoint = 'endpoint', | |||
} | |||
|
|||
export interface Mappings { |
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.
Could we make these more specific? IndexTemplateMapping(s)
, perhaps?
indexTemplate: IndexTemplate; | ||
} | ||
|
||
export interface CurrentIndex { |
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.
Can you move this to x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts
? I think that's the only place it's used and I don't initially see how CurrentIndex
is a top-level concept in EPM.
@@ -235,9 +241,10 @@ function getBaseTemplate(type: string, templateName: string, mappings: Mappings) | |||
}, | |||
mappings: { | |||
// To be filled with interesting information about this specific index | |||
/* |
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.
Is this intentional? If so, can we delete this and the comment above?
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.
+1 on removing this for now. We can add meta data again if we need it later.
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.
Did not check the code in detail but I'm good with getting this in based on your description.
I'm thinking it will simplify things if in the future we can
- Install all new assets
- Remove old assets which are not needed anymore
I would hope this also helps failure recovery but will require us to keep old and new state. Lets iterate on it.
@neptunian I think we should also have some docs on the exact behaviour on what happens on upgrade.
@@ -235,9 +241,10 @@ function getBaseTemplate(type: string, templateName: string, mappings: Mappings) | |||
}, | |||
mappings: { | |||
// To be filled with interesting information about this specific index | |||
/* |
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.
+1 on removing this for now. We can add meta data again if we need it later.
@elasticmachine merge upstream |
type: string; | ||
properties?: Record<string, Mapping>; | ||
export interface IndexTemplateMappings { | ||
properties: any; |
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.
Is this really any? e.g. number, string, etc?
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 actually just renamed Mappings to IndexTemplateMappings that @skh created. Trying to type all the mappings and settings is going to be pretty time consuming.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* install template after pipeline creation * return installed pkg if this pkg version is already installed * remove pipelines after templates are updated * remove kibana saved objects assets before installing * update current write indices * add back removal of merging previous references lost in rebase * improve some typing names, consolidate, fix bad merges * update query to use aggregate on _index Co-authored-by: Elastic Machine <[email protected]>
@neptunian Could you make sure we have a follow up issue where we can track the open issues around upgrade? |
* master: (29 commits) [Dashboard] Deangularize navbar, attempt nr. 2 (elastic#61611) refactor action filter creation utils (elastic#62969) Refresh index pattern list before redirecting (elastic#63329) [APM]fixing custom link unit tests (elastic#64045) [Ingest] EPM & Fleet are enabled when Ingest is enabled (elastic#64103) [Alerting] Fixed bug with no possibility to edit the index name after adding (elastic#64033) [Maps] Map settings: min and max zoom (elastic#63714) [kbn-storybook] Use raw loader for text files (elastic#64108) [EPM] /packages/{package} endpoint to support upgrades (elastic#63629) [SIEM] New Platform Saved Objects Registration (elastic#64029) [Endpoint] Hook to handle events needing navigation via Router (elastic#63863) Fixed small issue in clone functionality (elastic#64085) [Endpoint]EMT-146: use ingest agent for status info (elastic#63921) [SIEM] Server NP Followup (elastic#64010) Register uiSettings on New Platform (elastic#64015) [Reporting] Integration polling config with client code (elastic#63754) [Docs]7.7 SIEM doc updates (elastic#63951) [SIEM] [Cases] Tags suggestions (elastic#63878) Include datasource UUID in agent config yaml, adjust overflow height of yaml view (elastic#64027) [DOCS] Add file size setting for Data Visualizer (elastic#64006) ...
* install template after pipeline creation * return installed pkg if this pkg version is already installed * remove pipelines after templates are updated * remove kibana saved objects assets before installing * update current write indices * add back removal of merging previous references lost in rebase * improve some typing names, consolidate, fix bad merges * update query to use aggregate on _index Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
…ana into task-manager/cancel-logging * 'task-manager/cancel-logging' of github.com:gmmorris/kibana: (28 commits) [Dashboard] Deangularize navbar, attempt nr. 2 (elastic#61611) refactor action filter creation utils (elastic#62969) Refresh index pattern list before redirecting (elastic#63329) [APM]fixing custom link unit tests (elastic#64045) [Ingest] EPM & Fleet are enabled when Ingest is enabled (elastic#64103) [Alerting] Fixed bug with no possibility to edit the index name after adding (elastic#64033) [Maps] Map settings: min and max zoom (elastic#63714) [kbn-storybook] Use raw loader for text files (elastic#64108) [EPM] /packages/{package} endpoint to support upgrades (elastic#63629) [SIEM] New Platform Saved Objects Registration (elastic#64029) [Endpoint] Hook to handle events needing navigation via Router (elastic#63863) Fixed small issue in clone functionality (elastic#64085) [Endpoint]EMT-146: use ingest agent for status info (elastic#63921) [SIEM] Server NP Followup (elastic#64010) Register uiSettings on New Platform (elastic#64015) [Reporting] Integration polling config with client code (elastic#63754) [Docs]7.7 SIEM doc updates (elastic#63951) [SIEM] [Cases] Tags suggestions (elastic#63878) Include datasource UUID in agent config yaml, adjust overflow height of yaml view (elastic#64027) [DOCS] Add file size setting for Data Visualizer (elastic#64006) ...
Implements updating to a compatible package working by changing the order in which items are installed and now, updated. this can be found here #59910
What this PR does not do
Test
I think we need a test package to test more uses cases and know what to look for, but system can be used at the moment.
http://localhost:5601/ssg/api/saved_objects/_find?fields=title&fields=type&fields=version&per_page=10000&type=epm-package
Before updating
GET _template/logs-system.auth
After Updating (because pipeline does not exist in 0.9.0)

GET _template/logs-system.auth
This is also reflected in the saved objects for epm package where the ingest pipelines are no longer part of the installed assets