-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-30654][WebUI] Bootstrap4 WebUI upgrade #27370
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
Conversation
|
Probably a good idea, yes, but hard to evaluate indeed. Does this update jquery too? |
|
Jenkins test this please |
|
Test build #117485 has finished for PR 27370 at commit
|
…ster to this issue branch.
|
Thank you for taking a look. The intention with this patch is not to change any functionality. The goal is to just migrate Spark's WebUI onto a supported Bootstrap release. Due to Bootstrap changing some of their default CSS the font sizes, paddings, and margins did change. As a result, I made some overrides in the CSS and some minor changes to the HTML markup to try and maintain the existing feel, but there are still minor differences. It should be noted that the main navbar does collapse to a toggle button now for mobile devices. Previously when viewed on a mobile device or small browser window the top navbar would become partially cut off. jQuery was not modified as it was already on version 3.4.1, but dataTables.bootstrap.min.js was updated to the latest dataTables.bootstrap4.min.js and jquery.dataTables.1.10.18.min.js was updated to jquery.dataTables.min.js (version 1.10.20). This was mostly needed for compatibility with the latest Bootstrap 4 release. I noticed this afternoon my initial PR had an issue with my upstream merge so I've added a new commit to resolve it. I'll look into the reported license issue. |
|
Yeah, I do think we need to make a change like this at some point. Thanks for doing the legwork. My only hesitation about merging it soon is that we're about to be in 3.0 code freeze, and it sounds like this may need a little testing. On the one hand, we'll be doing some of that in the 3.0 QA period, so I'm not against it (if you can resolve merge conflicts and feel as confident as you can this works). We can also push back to consider post 3.0. |
|
I've updated the Bootstrap license to reflect the license change to MIT. I've also updated the dataTables license to reflect the updated date range. Finally, I had to update the dev/.rat-excludes to reflect the file name changes and additional files provided by the third party libraries. |
|
As far as when to merge it goes, while I'd like to see it merged as part of the 3.0 release I understand the concern regarding the risk it introduces so I'm good if you want to push it to after 3.0 is out the door. In either case I'll support merge conflicts and will try to resolve visual bug defects found. As far as my confidence level in the patch, I've tested it for the use cases and pages that I know of, but I'm sure there are areas that I don't know about or missed. I am confident though that any issues issues found can be quickly resolved. |
|
@clarkead Thanks for the work. I am +1 with the upgrade(actually it was in my backlog). |
| <div class="container-fluid"> | ||
| <table id="active-executors-table" class="table table-striped compact cell-border"> | ||
| <thead> | ||
| <table id="summary-execs-table" class="table table-striped compact cell-border" style="width: 100%"> |
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.
It seems that this file only removes the element <div class="container-fluid"> and add style="width: 100%"
Could you keep the other part of the file unchanged so that it is easier for review?
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.
Thank you for reviewing the PR. I just submitted a PR to review the indent formatting updates to make the review easier.
|
@clarkead I think we should keep the version in the |
| "Show Additional Metrics" + | ||
| "</a></div>" + | ||
| "<div class='container-fluid container-fluid-div' id='toggle-metrics' hidden>" + | ||
| "<div class='container-fluid-div ml-4 d-none' id='toggle-metrics'>" + |
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.
why do we need ml-4 d-none
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.
The ml-4 is needed to add the left margin on the set of checkboxes so that it is indented similarly to the original / current formatting. Without the ml-4 class the checkboxes are flush with the "Show Additional Metrics" arrow.
With regards to d-none, jQuery 1.8 deprecated .toggle() and jQuery 1.9 removed it so I had to change the JS for the "Show Additional Metrics" expand/collapse functionality. I decided to change it to the jQuery .toggleClass() method and use the Bootstrap provided d-none (display none) class to show and hide the div instead of creating a new custom class.
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 see. How about putting the margin-left into the CSS of container-fluid-div so that we don't need to write 'ml-4' every time.
| @@ -1,13 +1,22 @@ | |||
| Copyright 2013 Twitter, Inc. | |||
| The MIT License (MIT) | |||
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.
We need to update LICENSE-binary as well
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 just updated the license-binary files associated with bootstrap and datatables.
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.
We should also update here:
https://github.com/apache/spark/blob/master/LICENSE-binary#L419
| $("#showAdditionalMetrics").append( | ||
| "<div><a id='additionalMetrics'>" + | ||
| "<span class='expand-input-rate-arrow arrow-closed' id='arrowtoggle-optional-metrics'></span>" + | ||
| "<span class='expand-input-rate-arrow arrow-closed' id='arrowtoggle-optional-metrics'></span> " + |
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: this line seems only adding one space, we can avoid such changes.
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.
Agreed this is a little lame. I'll remove the space and use styling instead.
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.
The space was removed. It was originally added to make the arrow spacing consistent between the executor page and the other pages since the other pages rely on whitespace for the gap between the arrow and the expand / collapse text. Fixing all other occurrences would require many more code changes so I just reverted the space for now.
|
@clarkead I found some issues in the stage page. |
|
It appears I missed updating the .toggle() calls in the stagepage.js. It also affects the "Aggregated Metrics by Executor" toggle as well. I'll resolve that now. |
…(css) to include the version number as requested. Also discovered and fixed a table width formatting issue on the history page.
|
@gengliangwang I've added the version number to the dataTables js and css filenames as discussed. I also noticed while testing that the table on the first page of the history server was not displaying at 100% width as it currently does in master so I fixed that via a tweak to core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala (removed an unnecessary "row" class). |
|
Jenkins retest this please |
|
Jenkins test this please |
|
Test build #119593 has finished for PR 27370 at commit
|
|
@clarkead this PR is very close to being merged. |
|
@gengliangwang I'll take a look at this today and try to get a fix in. |
…ed for Bootstrap4
|
add to whitelist |
|
Jenkins test this please |
|
Test build #119688 has finished for PR 27370 at commit
|
|
retest this please. |
|
Test build #119696 has finished for PR 27370 at commit
|
|
retest this please |
|
Test build #119707 has finished for PR 27370 at commit
|
|
retest this please |
|
Test build #119723 has finished for PR 27370 at commit
|
gengliangwang
left a comment
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
|
I will merge this one if no one has other comments this Friday. |
|
Thanks for all the work, merging to master. |
|
@gengliangwang and @srowen Thank you for your time and help getting this merged in. Much appreciated. |
### What changes were proposed in this pull request? Spark's Web UI is using an older version of Bootstrap (v. 2.3.2) for the portal pages. Bootstrap 2.x was moved to EOL in Aug 2013 and Bootstrap 3.x was moved to EOL in July 2019 (https://github.com/twbs/release). Older versions of Bootstrap are also getting flagged in security scans for various CVEs: https://snyk.io/vuln/SNYK-JS-BOOTSTRAP-72889 https://snyk.io/vuln/SNYK-JS-BOOTSTRAP-173700 https://snyk.io/vuln/npm:bootstrap:20180529 https://snyk.io/vuln/npm:bootstrap:20160627 I haven't validated each CVE, but it would be nice to resolve any potential issues and get on a supported release. The bad news is that there have been quite a few changes between Bootstrap 2 and Bootstrap 4. I've tried updating the library, refactoring/tweaking the CSS and JS to maintain a similar appearance and functionality, and testing the UI for functionality and appearance. This is a fairly large change so I'm sure additional testing and fixes will be needed. ### How was this patch tested? This has been manually tested, but there is a ton of functionality and there are many pages and detail pages so it is very possible bugs introduced from the upgrade were missed. Additional testing and feedback is welcomed. If it appears a whole page was missed let me know and I'll take a pass at addressing that page/section. Closes apache#27370 from clarkead/bootstrap4-core-upgrade. Authored-by: Dale Clarke <[email protected]> Signed-off-by: Gengliang Wang <[email protected]>
…o longer used ### What changes were proposed in this pull request? This PR removes `bootstrap-tooltip.js` which is no longer used. That script is replaced with `bootstrap.bundle.min.js` in SPARK-30654 ( #27370 ). ### Why are the changes needed? For cleaning up repository.. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Manually checked whether tooltips are shown in the UI and no error message shown in the debug console. Closes #28515 from sarutak/remove-tooltipjs. Authored-by: Kousuke Saruta <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
|
Has this been put into a release? Looking at commit by @gengliangwang, it looks like it should be in 3.1.2, but when I look at the release notes for 3.1.2 on the main site or the jira site, I can't find the reference. I'm not familiar with the release process or how the notes are detailed, so my apologies if I missed something. Thank you |
|
The commit message above shows the commit it produces, and that it's in branch 3.1. The JIRA says 3.1.0 |




What changes were proposed in this pull request?
Spark's Web UI is using an older version of Bootstrap (v. 2.3.2) for the portal pages. Bootstrap 2.x was moved to EOL in Aug 2013 and Bootstrap 3.x was moved to EOL in July 2019 (https://github.com/twbs/release). Older versions of Bootstrap are also getting flagged in security scans for various CVEs:
https://snyk.io/vuln/SNYK-JS-BOOTSTRAP-72889
https://snyk.io/vuln/SNYK-JS-BOOTSTRAP-173700
https://snyk.io/vuln/npm:bootstrap:20180529
https://snyk.io/vuln/npm:bootstrap:20160627
I haven't validated each CVE, but it would be nice to resolve any potential issues and get on a supported release.
The bad news is that there have been quite a few changes between Bootstrap 2 and Bootstrap 4. I've tried updating the library, refactoring/tweaking the CSS and JS to maintain a similar appearance and functionality, and testing the UI for functionality and appearance. This is a fairly large change so I'm sure additional testing and fixes will be needed.
How was this patch tested?
This has been manually tested, but there is a ton of functionality and there are many pages and detail pages so it is very possible bugs introduced from the upgrade were missed. Additional testing and feedback is welcomed. If it appears a whole page was missed let me know and I'll take a pass at addressing that page/section.