-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-20044][UI] Support Spark UI behind front-end reverse proxy using a path prefix Revert proxy url #29820
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
|
This PR is to take over #17455. |
|
Test build #128938 has finished for PR 29820 at commit
|
|
Test build #128946 has finished for PR 29820 at commit
|
|
the jira for this is resolved as won't fix, if we are working on it can you reopen the jira. |
|
@tgravescs Thanks for the reminder. I will update the JIRA after investigation. |
|
What is the status of this PR? |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
98687de to
ba05ca0
Compare
|
Test build #130168 has finished for PR 29820 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
ba05ca0 to
a38c1d4
Compare
|
Test build #130274 has finished for PR 29820 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
This is now ready for review. |
|
Test build #130331 has finished for PR 29820 at commit
|
|
cc @srowen @HeartSaVioR @cloud-fan as well |
| // if reverseProxyUrl is not set, then we continue to generate relative URLs | ||
| // starting with "/" throughout the UI and do not use activeMasterWebUiUrl | ||
| val proxyUrl = conf.get(UI_REVERSE_PROXY_URL.key, "").stripSuffix("/") | ||
| System.setProperty("spark.ui.proxyBase", proxyUrl) |
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.
shall we mention that the /proxy/... will be added in UIUtils.makeHref?
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Test build #130498 has finished for PR 29820 at commit
|
|
Merging to master |
|
I don't understand this statement:
In an HA Spark Standalone setup, there are always two Spark Masters, and config files are all static, because that is the model. Workers switch from one master to the other during a failover. So how can they be expected to contain a static reference to one or the other master in their static config? I expose both Spark Masters in my Nginx config (/spark-master.0/, /spark-master.1/), and I'm struggling to figure out how to roll out this change. |
|
@drauschenbach We can treat the prefix as the ID of one cluster. For example, let's say the prefix is "cluster1" and the reverse proxy is nginx, and both master 0 and master 1 are configurated with the prefix "/cluster1". |
What changes were proposed in this pull request?
Allow to run the Spark web UI behind a reverse proxy with URLs prefixed by a context root, like www.mydomain.com/spark. In particular, this allows to access multiple Spark clusters through the same virtual host, only distinguishing them by context root, like www.mydomain.com/cluster1, www.mydomain.com/cluster2, and it allows to run the Spark UI in a common cookie domain (for SSO) with other services.
Why are the changes needed?
This PR is to take over #17455.
After changes, Spark allows showing customized prefix URL in all the
hreflinks of the HTML pages.Does this PR introduce any user-facing change?
Yes, all the links of UI pages will be contains the value of
spark.ui.reverseProxyUrlif it is configurated.How was this patch tested?
New HTML Unit tests in MasterSuite
Manual UI testing for master, worker and app UI with an nginx proxy
Spark config:
nginx config: