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

[ML] Additional job spaces initialization #83127

Merged

Conversation

jgowdyelastic
Copy link
Member

@jgowdyelastic jgowdyelastic commented Nov 10, 2020

Adds ability to allocate spaces for job when initialising existing jobs which do not have a saved object associated to them.
Normal behaviour is to put all existing jobs into the * space. However Logs jobs should be assigned to the space which exists in their job ID.

Adds an applyToAllSpaces override flag to the modules setup endpoint. This will place all jobs in the module into the * space.

Integrations

APM, Uptime and Security

module setup calls are passed the applyToAllSpaces flag so all jobs created will exist in the * space.
As long as the user pressing the button has permission to assign saved objects to the * space.

Logs

When creating ML jobs through the Logs UI, the jobs are created in whatever space is currently being used.
During initialisation, all existing jobs in the logs-ui group will be assigned to their correct space based on the job ID.
e.g. my_space space for kibana-logs-ui-my_space-default-log-entry-rate

Also fixes bug where an AD job and a DFA job cannot have the same ID.

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@jgowdyelastic jgowdyelastic requested review from a team and rylnd November 11, 2020 11:52
@botelastic botelastic bot added Team:APM - DEPRECATED Use Team:obs-ux-infra_services. Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability labels Nov 11, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

Copy link
Contributor

@smith smith left a comment

Choose a reason for hiding this comment

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

APM changes look good.

@jgowdyelastic jgowdyelastic requested review from a team as code owners November 12, 2020 10:03
Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested initialization of ML jobs (not including logs UI jobs) and LGTM

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jgowdyelastic
Copy link
Member Author

@elasticmachine merge upstream

@jgowdyelastic
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

LGTM uptime changes, we will discuss inside out team, if we also need to limit uptime anomaly jobs per space.

@weltenwort weltenwort self-requested a review November 16, 2020 11:47
Copy link
Member

@weltenwort weltenwort left a comment

Choose a reason for hiding this comment

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

Tested successfully with jobs from the Logs UI. Thanks for taking care of them!

The Metrics UI also has an ML integration patterned after the one in the Logs UI. Their jobs might require the same treatment. Since I'm not familiar with the implementation differences, though, I'd like to defer to @phillipb for an opinion. 😇

const { initSavedObjects } = repairFactory(client, jobSavedObjectService);
const { jobs } = await initSavedObjects();
const { jobs } = await initSavedObjects(false, jobSpaceOverrides);
mlLog.info(`${jobs.length} job saved objects initialized for * space`);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: now that the space can be overridden per job this message might be misleading.

Copy link
Member Author

@jgowdyelastic jgowdyelastic Nov 16, 2020

Choose a reason for hiding this comment

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

Updated in 663fa14

Copy link
Contributor

@FrankHassanabad FrankHassanabad left a comment

Choose a reason for hiding this comment

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

Thanks for this on our side! Good to see all of this coming together.

@phillipb
Copy link
Contributor

@weltenwort thanks for the heads up. From the looks of it, we would need basically the exact same treatment for job ids:

'k8s_memory_usage', 
'k8s_network_in',
'k8s_network_out',
'hosts_memory_usage',
'hosts_network_in',
'hosts_network_out',

@jgowdyelastic should that be apart of this PR?

@jgowdyelastic
Copy link
Member Author

@weltenwort thanks for the heads up. From the looks of it, we would need basically the exact same treatment for job ids:

'k8s_memory_usage', 
'k8s_network_in',
'k8s_network_out',
'hosts_memory_usage',
'hosts_network_in',
'hosts_network_out',

@jgowdyelastic should that be apart of this PR?

Ok thanks @phillipb , yes i'll add these now.

@jgowdyelastic
Copy link
Member Author

@phillipb metrics jobs added in 2ba8cf4

@apmmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

Security Solution changes LGTM 👍

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 7.9MB 7.9MB +22.0B
uptime 982.9KB 983.0KB +22.0B
total +44.0B

Distributable file count

id before after diff
default 42828 42834 +6

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jgowdyelastic jgowdyelastic merged commit 6a1cd73 into elastic:master Nov 16, 2020
@jgowdyelastic jgowdyelastic deleted the additional-job-space-initialization branch November 16, 2020 21:56
jgowdyelastic added a commit that referenced this pull request Nov 17, 2020
* [ML] Additional job spaces initialization

* adding logs test

* updating integrations

* updating test text

* fixing logs jobs error

* fix bug with duplicate ids

* updating initialization log text

* fixing initialization text

* adding metrics overrides

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Anomaly Detection ML anomaly detection Feature:Data Frame Analytics ML data frame analytics features :ml release_note:enhancement review Team:APM - DEPRECATED Use Team:obs-ux-infra_services. Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.