Skip to content

Conversation

@gurvindersingh
Copy link

What changes were proposed in this pull request?

This pull request adds the functionality to enable accessing worker and application UI through master UI itself. Thus helps in accessing SparkUI when running spark cluster in closed networks e.g. Kubernetes. Cluster admin needs to expose only spark master UI and rest of the UIs can be in the private network, master UI will reverse proxy the connection request to corresponding resource. It adds the path for workers/application UIs as

WorkerUI: <http/https>://master-publicIP:/target/workerID/
ApplicationUI: <http/https>://master-publicIP:/target/appID/

This makes it easy for users to easily protect the Spark master cluster access by putting some reverse proxy e.g. https://github.com/bitly/oauth2_proxy

How was this patch tested?

The functionality has been tested manually and there is a unit test too for testing access to worker UI with reverse proxy address.

@pwendell @bomeng @BryanCutler can you please review it, thanks.

@ajbozarth
Copy link
Member

This looks good and I really like this added functionality, I'll check out your code and give it a test run as soon as I have time.

<li><strong>
{
if (parent.master.reverseProxy) {
<a href={"/target/" + app.id + "/"}>Application Detail UI</a>
Copy link

Choose a reason for hiding this comment

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

Should the "/target/" be a literal or a configuration value?

Copy link
Author

Choose a reason for hiding this comment

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

By all means it can be a configuration value, but there were already some literal conventions eg. "app" so I thought of having it this way. But if community prefer the configured value, then I will add that.

@gurvindersingh
Copy link
Author

@ajbozarth what are the steps ahead in terms of moving this pr closer to being merged.

@ajbozarth
Copy link
Member

@srowen @zsxwing @tgravescs What do you guys think of @gurvindersingh proposal?

<tr>
<td><code>spark.ui.reverseProxyUrl</code></td>
<td>http://localhost:8080</td>
<td>
Copy link
Contributor

Choose a reason for hiding this comment

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

includeing -> including

@tgravescs
Copy link
Contributor

overall proposal seems fine to me if its only affecting standalone mode where things are going through the master. It would be similar to the hadoop Yarn RM proxy although that was mostly for security reasons. You do need to make sure all the authentication and authorization stuff still applies

@gurvindersingh
Copy link
Author

@tgravescs Yeah the proposal is only for standalone mode where worker & application UI is accessed through master UI now. Looking at the authn/z settings for standalone, I don't see this patch interfere with any of those. The addFilters() function set the ui.filters for '/*' path so it will apply for this case too. Beyond this let me know if I miss anything.

@gurvindersingh
Copy link
Author

@tgravescs @ajbozarth any update on this PR ?

@ajbozarth
Copy link
Member

I'll try and take a look at this tomorrow

@ajbozarth
Copy link
Member

I think changing /target/ to /proxy/ would make a clearer url.
@tgravescs what does the yarn proxy url look like? I don't use yarn outside of testing.

Overall LGTM though

@gurvindersingh
Copy link
Author

Changed the path from target to proxy Let me know if there is anything else before this PR can be merged.

@gurvindersingh
Copy link
Author

@ajbozarth ping on this..

@ajbozarth
Copy link
Member

LGTM, @tgravescs this ready to merge?

@gurvindersingh
Copy link
Author

@ajbozarth it seems @tgravescs is busy, is anybody else then who you think could help us in merging this.

@chandru-ops
Copy link

I'm trying to have nginx as reverse proxy for Spark dashboards which doesn't support app/driver logs now. Thank you @gurvindersingh . I will try this.

@ajbozarth
Copy link
Member

@srowen @JoshRosen could we get some traction on this? Thanks!

@vanzin
Copy link
Contributor

vanzin commented Aug 4, 2016

ok to test

@SparkQA
Copy link

SparkQA commented Aug 4, 2016

Test build #63232 has finished for PR 13950 at commit 22f77c9.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

<artifactId>jetty-servlet</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
Copy link
Contributor

Choose a reason for hiding this comment

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

These new dependencies need to be added to the copy-dependencies invocation later in this file.

@SparkQA
Copy link

SparkQA commented Aug 26, 2016

Test build #64490 has finished for PR 13950 at commit a524a8b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gurvindersingh
Copy link
Author

@ajbozarth @vanzin @JoshRosen it seems to be stalled, any update ?

Copy link
Contributor

Choose a reason for hiding this comment

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

val

@vanzin
Copy link
Contributor

vanzin commented Sep 7, 2016

A few minor things. Looks ok, but I'd still like from someone who's more active in maintaining standalone mode to take a look.

If there's no comments in a few days I'll push it after the comments are addressed.

Copy link
Member

Choose a reason for hiding this comment

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

Could you add a test for encoded string in the url, such as %2F, %F0%9F%98%84 (the 😄 emoji) ?

@gurvindersingh
Copy link
Author

@vanzin addressed all your comments and added two extra checks too in test as requested. Let me know if there are any more comments.

@SparkQA
Copy link

SparkQA commented Sep 8, 2016

Test build #65099 has finished for PR 13950 at commit 407c1a0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

Choose a reason for hiding this comment

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

nit: private[this]

@zsxwing
Copy link
Member

zsxwing commented Sep 8, 2016

LGTM expect one nit!

@SparkQA
Copy link

SparkQA commented Sep 8, 2016

Test build #65112 has finished for PR 13950 at commit 9f6862e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@zsxwing
Copy link
Member

zsxwing commented Sep 9, 2016

LGTM. Merging to master! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants