-
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
[ML] Adding space aware jobs #77916
[ML] Adding space aware jobs #77916
Conversation
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
…bana into adding-space-aware-jobs
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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.
Latest changes LGTM ⚡
If I disable Spaces, with |
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.
Left a question about the behaviour when spaces is disabled, but otherwise tested latest edits and LGTM.
I'm not doing anything special here if spaces is disabled. i'm still using the saved object client and these are the jobs it's returning. |
Yes this is intended behavior, and consistent with the way other saved objects behave today. It's not the best experience, but that's what we have. |
My plan was to finish my review on Monday, but I'm taking a sick day instead; I'll pick this back up as soon as possible. |
@elasticmachine merge upstream |
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.
LGTM
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.
Code LGTM 🥳
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
distributable file count
page load bundle size
Saved Objects .kibana field count
History
To update your PR or re-run it, just comment with: |
* [ML] Adding space aware jobs * adding mlClient * switching to type includes * adding additional job checks * fixing conflict * adding dfa checks * refactoring jobs in spaces checks * filtering calendars * adding initial job object status and repair endpoints * enabling repair endpoint * fixing listed jobs in status * adding datafeed repair * updating shared services * adding results job id check * fixing conflicts * don't remove SO on delete * fixing non-ml plugins * filtering job audit messages * fixing types * fixing tests * adding job ids wildcard support * removing empty migration test * fixing tests and disabling spaces test user * adding saved objects all permission * fixing calendars * updating job 404 * updating job wildcard search * renaming services * fixing conflicts * fixing log tests * disabling apm test * skipping more apm tests * optimzing repair * fixing types * updating apm test archive to include ML saved objects * enabling disabled test * removing comment * adding space assigning endpoints * adding saved object default permissions * removing commented code * loading all jobs for all spaces for status check * adding spaces list endpoint * adding job spaces to management page * adding trained model fltering * fixing trained model id check and job wildcard check * fixing types * fixing bug when adding new job to calendar * changes based on review * updating schema * changes based on review * fixing types * rolling back http service injection * fixing http service injection * adding errrors to repair endpoint response * updating api doc * improving types * disabling id check on ad get endpoints * fixing tests * fixing group requests * adding comments * using filter in saved object search * fixing fake request issue * removing console log * making job saved object hidden * removing acccidentally included file * renaming saved object client * updating apidoc * unhiding ml saved objects * moving route guard * improving error when SOC is null * fixing types after merge with master * fixing tests Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Adds saved objects to represent ML anomaly detection and data frame analytics jobs to allow for them to be assigned to spaces.
Related to #64172
The new saved object has the type
ml-job
, and is this shape:datafeed_id
will benull
for dataframe analytics jobs and anomaly detector jobs with no datafeed.type
will be eitheranomaly-detector
ordata-frame-analytics
Job id checks and filters have been added to all appropriate kibana ml endpoints.
For example:
will only return jobs in the current space.
Will return a
404
iffoo
is not in the current space.All anomaly results searches now use a new function
anomalySearch
which also requires the list a job ids.If any of the job ids listed does not exist or is not in the current space, a
404
will be returned.Things to note when testing:
assign_job_to_space
orremove_job_from_space
endpoints, the job must exist in the current space.When testing this PR, any pre-existing jobs will not have saved objects assigned to them and so will not appear in the UI.
These saved objects can be created by calling:
To move jobs between spaces:
jobType
can beanomaly-detector
anddata-frame-analytics
Job spaces are also listed in the management page:
For APM reviewers, I had to recreate the
apm_8.0.0
archive to add the ML saved objects to the snapshot.kibana
index.Follow up work for 7.11:
*
space for all existing jobs.Checklist
Delete any items that are not applicable to this PR.
Documentation was added for features that require explanation or tutorials
Unit or functional tests were updated or added to match the most common scenarios
This was checked for breaking API changes and was labeled appropriately