Skip to content

Conversation

@zjffdu
Copy link
Contributor

@zjffdu zjffdu commented Apr 1, 2020

What is this PR for?

This is for injecting appId into custom spark url. Currently we allow user to set zeppelin.spark.uiWebUrl for a custom spark ui link. But we didn't inject appId into it. this make it less flexible for some cases. So this PR is to allow inject application id into custom spark url. e.g.
url_prefix/{{applicationId}}

What type of PR is it?

[Improvement]

Todos

  • - Task

What is the Jira issue?

How should this be tested?

  • Unit test added

Screenshots (if appropriate)

Questions:

  • Does the licenses files need update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

Comment on lines 240 to 241
val webUiUrl = properties.getProperty("zeppelin.spark.uiWebUrl");
if (!StringUtils.isBlank(webUiUrl)) {
this.sparkUrl = webUiUrl.replace("{{applicationId}}", sc.applicationId);
} else {
useYarnProxyURLIfNeeded()
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I would move this into a separate function to remove duplicates.
Another issue - we need to make safe value from sc.applicationId, so we couldn't get any security problem...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion @alexott , I have removed the code duplicated. What do you mean security problem ? spark appId is generated by spark resource manager ? I don't see security problem

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, that was my concern - if we can say that applicationId is safely generated, and not provided by user, then I'm ok...

@asfgit asfgit closed this in ec16666 Apr 8, 2020
asfgit pushed a commit that referenced this pull request Apr 8, 2020
### What is this PR for?
 This is for injecting appId into custom spark url. Currently we allow user to set `zeppelin.spark.uiWebUrl` for a custom spark ui link. But we didn't inject appId into it. this make it less flexible for some cases. So this PR is to allow inject application id into custom spark url. e.g.
`url_prefix/{{applicationId}}`

### What type of PR is it?
[Improvement]

### Todos
* [ ] - Task

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-4710

### How should this be tested?
* Unit test added

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Jeff Zhang <[email protected]>

Closes #3711 from zjffdu/ZEPPELIN-4710 and squashes the following commits:

a887199 [Jeff Zhang] remove code duplicate
68fceec [Jeff Zhang] [ZEPPELIN-4710]. Allow to inject application id into custom spark url

(cherry picked from commit ec16666)
Signed-off-by: Jeff Zhang <[email protected]>
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.

2 participants