Skip to content

ZEPPELIN-3106. User impersonation in SPARK is not working#2705

Closed
zjffdu wants to merge 2 commits into
apache:masterfrom
zjffdu:ZEPPELIN-3106
Closed

ZEPPELIN-3106. User impersonation in SPARK is not working#2705
zjffdu wants to merge 2 commits into
apache:masterfrom
zjffdu:ZEPPELIN-3106

Conversation

@zjffdu
Copy link
Copy Markdown
Contributor

@zjffdu zjffdu commented Dec 17, 2017

What is this PR for?

This PR is for trying to fix the impersonation of spark interpreter in master branch. For spark impersonation, we don't need to ssh, just adding --proxy-user is enough.

What type of PR is it?

[Bug Fix]

Todos

  • - Task

What is the Jira issue?

How should this be tested?

  • Manually verified.

Screenshots (if appropriate)

Questions:

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

@zjffdu
Copy link
Copy Markdown
Contributor Author

zjffdu commented Dec 18, 2017

@prabhjyotsingh Could you help review it ? Thanks

@prabhjyotsingh
Copy link
Copy Markdown
Contributor

Will try this for both spark and shell interpreter, and post my finding later today.

Comment thread bin/interpreter.sh
fi

if [[ -n "${SPARK_SUBMIT}" ]]; then
if [[ -n "$ZEPPELIN_IMPERSONATE_USER" ]] && [[ "$ZEPPELIN_IMPERSONATE_SPARK_PROXY_USER" != "false" ]]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

By removing this ZEPPELIN_IMPERSONATE_SPARK_PROXY_USER you disable the feature that was introduced with #1840 (# export ZEPPELIN_IMPERSONATE_SPARK_PROXY_USER #Optional, by default is true; can be set to false if you don't want to use --proxy-user option with Spark interpreter when impersonation enabled), is that intended? If so, we will need to update the doc.

@@ -196,10 +199,10 @@ private boolean isYarnMode() {
private String toShellFormat(String value) {
if (value.contains("\'") && value.contains("\"")) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"\'" -> "'"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread bin/interpreter.sh Outdated
if [[ -n "${SPARK_SUBMIT}" ]]; then
if [[ -n "$ZEPPELIN_IMPERSONATE_USER" ]] && [[ "$ZEPPELIN_IMPERSONATE_SPARK_PROXY_USER" != "false" ]]; then
INTERPRETER_RUN_COMMAND+=' '` echo ${SPARK_SUBMIT} --class ${ZEPPELIN_SERVER} --driver-class-path \"${ZEPPELIN_INTP_CLASSPATH_OVERRIDES}:${ZEPPELIN_INTP_CLASSPATH}\" --driver-java-options \"${JAVA_INTP_OPTS}\" ${SPARK_SUBMIT_OPTIONS} ${ZEPPELIN_SPARK_CONF} --proxy-user ${ZEPPELIN_IMPERSONATE_USER} ${SPARK_APP_JAR} ${CALLBACK_HOST} ${PORT} ${INTP_PORT}`
INTERPRETER_RUN_COMMAND+=' '` echo ${SPARK_SUBMIT} --class ${ZEPPELIN_SERVER} --driver-class-path \"${ZEPPELIN_INTP_CLASSPATH_OVERRIDES}:${ZEPPELIN_INTP_CLASSPATH}\" --driver-java-options \"${JAVA_INTP_OPTS}\" ${SPARK_SUBMIT_OPTIONS} ${ZEPPELIN_SPARK_CONF} ${SPARK_APP_JAR} ${CALLBACK_HOST} ${PORT} ${INTP_PORT}`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both if and else are same!

@zjffdu
Copy link
Copy Markdown
Contributor Author

zjffdu commented Dec 22, 2017

Thanks @prabhjyotsingh comments has been addressed. And CI passed

@prabhjyotsingh
Copy link
Copy Markdown
Contributor

Rest, looks good.

@zjffdu
Copy link
Copy Markdown
Contributor Author

zjffdu commented Dec 22, 2017

Thanks, Merge if no more comment

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.

3 participants