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] Jobs import and export #101037
[ML] Jobs import and export #101037
Conversation
@elasticmachine merge upstream |
…na into job-import-and-export
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
merge conflict between base and head |
@elasticmachine merge upstream |
@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.
Still seeing the same 400 error dest index must be empty
when trying to start an imported DFA job even when destination index was edited in the import flyout. Looks like the destination index isn't actually getting updated before the job is imported.
What do you think about having the help text in the dest index editor let the user know that the job start will fail if they don't change the destination index?
cf29161 fixes the dest index not being saved.
What do you think about having the help text in the dest index editor let the user know that the job start will fail if they don't change the destination index?
This is not what the help text lead me to believe in the DFA wizard. The warning text I'm showing is copied from the DFA wizard and is purposefully not an invalid state in the importer.
Do you think this needs to change and if a destination index already exists it should stop the user from importing?
The exists check could check to see if the index is empty too. This change would need to go into the DFA wizard too.
...l/public/application/components/import_export_jobs/export_jobs_flyout/export_jobs_flyout.tsx
Outdated
Show resolved
Hide resolved
...l/public/application/components/import_export_jobs/export_jobs_flyout/export_jobs_flyout.tsx
Outdated
Show resolved
Hide resolved
const blob = new Blob([JSON.stringify(configsForExport, null, 2)], { | ||
type: 'application/json', | ||
}); | ||
saveAs(blob, 'ml_jobs.json'); |
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.
nit: I think it might be convenient to have jobs type, stack version, and date in the file name, something like anomaly_detection_ml_jobs_7.14.0_20210808
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.
Yeah this is a good idea to give these files a more specific name.
I've made a change here 330129a so the files are now either anomaly_detection_jobs.json
or data_frame_analytics_jobs.json
.
There are problems with adding the version to the file name as it may be coming from a mixed version cluster.
For now I think these names are definitely an improvement and we can make changes later on if we decide we should add more information.
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. I reckon it's worth adding some telemetry for this feature in a follow-up.
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.
Tested latest changes and LGTM.
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Any counts in public APIs
Async chunks
Public APIs missing exports
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment 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.
Latest changes LGTM ⚡
* [ML] Jobs import and export * adding dfa job import/export * job id validation * fixing conflicts * adding index pattern validation * updates to job list * validation changes * refactoring job id editing * validating check * file read error * translation ids * duplicate translation id * small fix * updating route and schema * code clean up * catching and displaying job creation errors * useMemo for notifications * small refactor * cleaning up types * adding job import success toast * adding exporting toast * small changes based on review * adding loading spinner * changing util files to services * code changes baased on review * adding missing bind change * file rename * adding confirm for tab changes * adding destination index checks * grouping import errors * fixing translation ids * fixing dest index update * small changes based on review * renaming exported file name Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
* [ML] Jobs import and export * adding dfa job import/export * job id validation * fixing conflicts * adding index pattern validation * updates to job list * validation changes * refactoring job id editing * validating check * file read error * translation ids * duplicate translation id * small fix * updating route and schema * code clean up * catching and displaying job creation errors * useMemo for notifications * small refactor * cleaning up types * adding job import success toast * adding exporting toast * small changes based on review * adding loading spinner * changing util files to services * code changes baased on review * adding missing bind change * file rename * adding confirm for tab changes * adding destination index checks * grouping import errors * fixing translation ids * fixing dest index update * small changes based on review * renaming exported file name Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: James Gowdy <jgowdy@elastic.co>
Adding export and import of anomaly detection and data frame analytics jobs to the ML section of the Stack Management page.
An exported job file contains a single or array of job configs. In the case of anomaly detector jobs, a wrapping object is used to contain the job and datafeed e.g.
Export
Import
When an anomaly detection file has been selected, the indices in the datafeed are checked to ensure that matching index patterns exist. This is based on a requirement of the new job wizards where index patterns need to exist in order to clone a job.
Selecting a file which does not contain valid ML jobs or contains a mixture of anomaly detection and data frame analytic jobs will cause an error:
Also adds a new bulk create endpoint for anomaly detection jobs which takes the same shaped payload as the exported file format.
Checklist
Delete any items that are not applicable to this PR.
For maintainers