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] Trained Models: fix NaN in a progress bar during the download task initialization #201221

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

darnautov
Copy link
Contributor

@darnautov darnautov commented Nov 21, 2024

Summary

When we request a status of the download task right after initializing a download, total_parts might be returned with a 0 value, hence dividing by 0 for the progress bar causing in NaN% value rendered. This PR adds a fallback to -1 for that, to make sure we render 0%.

Checklist

@darnautov darnautov added release_note:fix :ml v9.0.0 Feature:3rd Party Models ML 3rd party models Team:ML Team label for ML (also use :ml) v8.16.0 backport:version Backport to applied version labels v8.17.0 v8.18.0 labels Nov 21, 2024
@darnautov darnautov self-assigned this Nov 21, 2024
@darnautov darnautov requested a review from a team as a code owner November 21, 2024 15:28
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

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.

LGTM (not actually seen this in local testing, even with throttling enabled).

@elasticmachine
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
ml 4.7MB 4.7MB +6.0B

cc @darnautov

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

LGTM

@darnautov darnautov added v8.16.2 and removed v8.16.0 labels Nov 22, 2024
@darnautov darnautov merged commit 639c9b7 into elastic:main Nov 22, 2024
24 checks passed
@darnautov darnautov deleted the ml-fix-download-status-nan branch November 22, 2024 10:27
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.17, 8.x

https://github.com/elastic/kibana/actions/runs/11970833950

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 22, 2024
…task initialization (elastic#201221)

## Summary

When we request a status of the download task right after initializing a
download, `total_parts` might be returned with a `0` value, hence
dividing by 0 for the progress bar causing in `NaN%` value rendered.
This PR adds a fallback to `-1` for that, to make sure we render 0%.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 639c9b7)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 22, 2024
…task initialization (elastic#201221)

## Summary

When we request a status of the download task right after initializing a
download, `total_parts` might be returned with a `0` value, hence
dividing by 0 for the progress bar causing in `NaN%` value rendered.
This PR adds a fallback to `-1` for that, to make sure we render 0%.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 639c9b7)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 22, 2024
…task initialization (elastic#201221)

## Summary

When we request a status of the download task right after initializing a
download, `total_parts` might be returned with a `0` value, hence
dividing by 0 for the progress bar causing in `NaN%` value rendered.
This PR adds a fallback to `-1` for that, to make sure we render 0%.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 639c9b7)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.16
8.17
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 22, 2024
…load task initialization (#201221) (#201341)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[ML] Trained Models: fix `NaN` in a progress bar during the
download task initialization
(#201221)](#201221)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dima
Arnautov","email":"dmitrii.arnautov@elastic.co"},"sourceCommit":{"committedDate":"2024-11-22T10:26:56Z","message":"[ML]
Trained Models: fix `NaN` in a progress bar during the download task
initialization (#201221)\n\n## Summary\r\n\r\nWhen we request a status
of the download task right after initializing a\r\ndownload,
`total_parts` might be returned with a `0` value, hence\r\ndividing by 0
for the progress bar causing in `NaN%` value rendered.\r\nThis PR adds a
fallback to `-1` for that, to make sure we render 0%.\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"639c9b7505020baf5dc5d31122d8924b301a77fc","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","v9.0.0","Feature:3rd
Party
Models","Team:ML","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[ML]
Trained Models: fix `NaN` in a progress bar during the download task
initialization
","number":201221,"url":"https://github.com/elastic/kibana/pull/201221","mergeCommit":{"message":"[ML]
Trained Models: fix `NaN` in a progress bar during the download task
initialization (#201221)\n\n## Summary\r\n\r\nWhen we request a status
of the download task right after initializing a\r\ndownload,
`total_parts` might be returned with a `0` value, hence\r\ndividing by 0
for the progress bar causing in `NaN%` value rendered.\r\nThis PR adds a
fallback to `-1` for that, to make sure we render 0%.\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"639c9b7505020baf5dc5d31122d8924b301a77fc"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201221","number":201221,"mergeCommit":{"message":"[ML]
Trained Models: fix `NaN` in a progress bar during the download task
initialization (#201221)\n\n## Summary\r\n\r\nWhen we request a status
of the download task right after initializing a\r\ndownload,
`total_parts` might be returned with a `0` value, hence\r\ndividing by 0
for the progress bar causing in `NaN%` value rendered.\r\nThis PR adds a
fallback to `-1` for that, to make sure we render 0%.\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"639c9b7505020baf5dc5d31122d8924b301a77fc"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
kibanamachine added a commit that referenced this pull request Nov 22, 2024
…load task initialization (#201221) (#201342)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[ML] Trained Models: fix &#x60;NaN&#x60; in a progress bar during the
download task initialization
(#201221)](#201221)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dima
Arnautov","email":"dmitrii.arnautov@elastic.co"},"sourceCommit":{"committedDate":"2024-11-22T10:26:56Z","message":"[ML]
Trained Models: fix `NaN` in a progress bar during the download task
initialization (#201221)\n\n## Summary\r\n\r\nWhen we request a status
of the download task right after initializing a\r\ndownload,
`total_parts` might be returned with a `0` value, hence\r\ndividing by 0
for the progress bar causing in `NaN%` value rendered.\r\nThis PR adds a
fallback to `-1` for that, to make sure we render 0%.\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"639c9b7505020baf5dc5d31122d8924b301a77fc","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","v9.0.0","Feature:3rd
Party
Models","Team:ML","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[ML]
Trained Models: fix `NaN` in a progress bar during the download task
initialization
","number":201221,"url":"https://github.com/elastic/kibana/pull/201221","mergeCommit":{"message":"[ML]
Trained Models: fix `NaN` in a progress bar during the download task
initialization (#201221)\n\n## Summary\r\n\r\nWhen we request a status
of the download task right after initializing a\r\ndownload,
`total_parts` might be returned with a `0` value, hence\r\ndividing by 0
for the progress bar causing in `NaN%` value rendered.\r\nThis PR adds a
fallback to `-1` for that, to make sure we render 0%.\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"639c9b7505020baf5dc5d31122d8924b301a77fc"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201221","number":201221,"mergeCommit":{"message":"[ML]
Trained Models: fix `NaN` in a progress bar during the download task
initialization (#201221)\n\n## Summary\r\n\r\nWhen we request a status
of the download task right after initializing a\r\ndownload,
`total_parts` might be returned with a `0` value, hence\r\ndividing by 0
for the progress bar causing in `NaN%` value rendered.\r\nThis PR adds a
fallback to `-1` for that, to make sure we render 0%.\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"639c9b7505020baf5dc5d31122d8924b301a77fc"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
kibanamachine added a commit that referenced this pull request Nov 25, 2024
…oad task initialization (#201221) (#201343)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ML] Trained Models: fix &#x60;NaN&#x60; in a progress bar during the
download task initialization
(#201221)](#201221)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dima
Arnautov","email":"dmitrii.arnautov@elastic.co"},"sourceCommit":{"committedDate":"2024-11-22T10:26:56Z","message":"[ML]
Trained Models: fix `NaN` in a progress bar during the download task
initialization (#201221)\n\n## Summary\r\n\r\nWhen we request a status
of the download task right after initializing a\r\ndownload,
`total_parts` might be returned with a `0` value, hence\r\ndividing by 0
for the progress bar causing in `NaN%` value rendered.\r\nThis PR adds a
fallback to `-1` for that, to make sure we render 0%.\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"639c9b7505020baf5dc5d31122d8924b301a77fc","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","v9.0.0","Feature:3rd
Party
Models","Team:ML","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[ML]
Trained Models: fix `NaN` in a progress bar during the download task
initialization
","number":201221,"url":"https://github.com/elastic/kibana/pull/201221","mergeCommit":{"message":"[ML]
Trained Models: fix `NaN` in a progress bar during the download task
initialization (#201221)\n\n## Summary\r\n\r\nWhen we request a status
of the download task right after initializing a\r\ndownload,
`total_parts` might be returned with a `0` value, hence\r\ndividing by 0
for the progress bar causing in `NaN%` value rendered.\r\nThis PR adds a
fallback to `-1` for that, to make sure we render 0%.\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"639c9b7505020baf5dc5d31122d8924b301a77fc"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201221","number":201221,"mergeCommit":{"message":"[ML]
Trained Models: fix `NaN` in a progress bar during the download task
initialization (#201221)\n\n## Summary\r\n\r\nWhen we request a status
of the download task right after initializing a\r\ndownload,
`total_parts` might be returned with a `0` value, hence\r\ndividing by 0
for the progress bar causing in `NaN%` value rendered.\r\nThis PR adds a
fallback to `-1` for that, to make sure we render 0%.\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"639c9b7505020baf5dc5d31122d8924b301a77fc"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Nov 26, 2024
…task initialization (elastic#201221)

## Summary

When we request a status of the download task right after initializing a
download, `total_parts` might be returned with a `0` value, hence
dividing by 0 for the progress bar causing in `NaN%` value rendered.
This PR adds a fallback to `-1` for that, to make sure we render 0%.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…task initialization (elastic#201221)

## Summary

When we request a status of the download task right after initializing a
download, `total_parts` might be returned with a `0` value, hence
dividing by 0 for the progress bar causing in `NaN%` value rendered.
This PR adds a fallback to `-1` for that, to make sure we render 0%.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:3rd Party Models ML 3rd party models :ml release_note:fix Team:ML Team label for ML (also use :ml) v8.16.2 v8.17.0 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants