You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2018/10/10 02:30:07 UTC

zeppelin git commit: ZEPPELIN-3804. Separate log file for each interpreter process

Repository: zeppelin
Updated Branches:
  refs/heads/master fa271b9ca -> b183c7e06


ZEPPELIN-3804. Separate log file for each interpreter process

### What is this PR for?
This PR just separate log file for each interpreter process instead of putting them all in one log file.

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

### Todos
* [ ] - Task

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

### How should this be tested?
* set shell interpreter as isolated per note
* run shell interpreter in 2 note, and then check log files
* 2 log files are generated
** zeppelin-interpreter-sh--2D8U1YTJU-jzhang-HW12527.log
** zeppelin-interpreter-sh--2D9VN6VWT-jzhang-HW12527.log

### 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 <zj...@apache.org>

Closes #3200 from zjffdu/ZEPPELIN-3804 and squashes the following commits:

c9580748f [Jeff Zhang] ZEPPELIN-3804. Separate log file for each interpreter process


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/b183c7e0
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/b183c7e0
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/b183c7e0

Branch: refs/heads/master
Commit: b183c7e06c6e9b27f7ec916cb08bed357997a698
Parents: fa271b9
Author: Jeff Zhang <zj...@apache.org>
Authored: Mon Oct 1 17:09:36 2018 +0800
Committer: Jeff Zhang <zj...@apache.org>
Committed: Wed Oct 10 10:30:03 2018 +0800

----------------------------------------------------------------------
 bin/interpreter.sh                                               | 2 +-
 .../interpreter/launcher/StandardInterpreterLauncher.java        | 1 +
 .../interpreter/launcher/StandardInterpreterLauncherTest.java    | 4 ++--
 .../java/org/apache/zeppelin/interpreter/InterpreterSetting.java | 4 ++--
 4 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/b183c7e0/bin/interpreter.sh
----------------------------------------------------------------------
diff --git a/bin/interpreter.sh b/bin/interpreter.sh
index 4606ed3..febc708 100755
--- a/bin/interpreter.sh
+++ b/bin/interpreter.sh
@@ -93,7 +93,7 @@ ZEPPELIN_SERVER=org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer
 
 INTERPRETER_ID=$(basename "${INTERPRETER_DIR}")
 ZEPPELIN_PID="${ZEPPELIN_PID_DIR}/zeppelin-interpreter-${INTERPRETER_ID}-${ZEPPELIN_IDENT_STRING}-${HOSTNAME}-${PORT}.pid"
-ZEPPELIN_LOGFILE="${ZEPPELIN_LOG_DIR}/zeppelin-interpreter-${INTERPRETER_SETTING_NAME}-"
+ZEPPELIN_LOGFILE="${ZEPPELIN_LOG_DIR}/zeppelin-interpreter-${INTERPRETER_GROUP_ID}-"
 
 if [[ -z "$ZEPPELIN_IMPERSONATE_CMD" ]]; then
     if [[ "${INTERPRETER_ID}" != "spark" || "$ZEPPELIN_IMPERSONATE_SPARK_PROXY_USER" == "false" ]]; then

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/b183c7e0/zeppelin-plugins/launcher/standard/src/main/java/org/apache/zeppelin/interpreter/launcher/StandardInterpreterLauncher.java
----------------------------------------------------------------------
diff --git a/zeppelin-plugins/launcher/standard/src/main/java/org/apache/zeppelin/interpreter/launcher/StandardInterpreterLauncher.java b/zeppelin-plugins/launcher/standard/src/main/java/org/apache/zeppelin/interpreter/launcher/StandardInterpreterLauncher.java
index 9c7a0b2..47756c9 100644
--- a/zeppelin-plugins/launcher/standard/src/main/java/org/apache/zeppelin/interpreter/launcher/StandardInterpreterLauncher.java
+++ b/zeppelin-plugins/launcher/standard/src/main/java/org/apache/zeppelin/interpreter/launcher/StandardInterpreterLauncher.java
@@ -101,6 +101,7 @@ public class StandardInterpreterLauncher extends InterpreterLauncher {
         env.put("FLINK_LIB_DIR", flinkHome + "/lib");
       }
     }
+    env.put("INTERPRETER_GROUP_ID", context.getInterpreterGroupId());
     return env;
   }
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/b183c7e0/zeppelin-plugins/launcher/standard/src/test/java/org/apache/zeppelin/interpreter/launcher/StandardInterpreterLauncherTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-plugins/launcher/standard/src/test/java/org/apache/zeppelin/interpreter/launcher/StandardInterpreterLauncherTest.java b/zeppelin-plugins/launcher/standard/src/test/java/org/apache/zeppelin/interpreter/launcher/StandardInterpreterLauncherTest.java
index 1861636..60bf915 100644
--- a/zeppelin-plugins/launcher/standard/src/test/java/org/apache/zeppelin/interpreter/launcher/StandardInterpreterLauncherTest.java
+++ b/zeppelin-plugins/launcher/standard/src/test/java/org/apache/zeppelin/interpreter/launcher/StandardInterpreterLauncherTest.java
@@ -56,7 +56,7 @@ public class StandardInterpreterLauncherTest {
     assertEquals(ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_CONNECT_TIMEOUT.getIntValue(),
         interpreterProcess.getConnectTimeout());
     assertEquals(zConf.getInterpreterRemoteRunnerPath(), interpreterProcess.getInterpreterRunner());
-    assertEquals(1, interpreterProcess.getEnv().size());
+    assertEquals(2, interpreterProcess.getEnv().size());
     assertEquals("VALUE_1", interpreterProcess.getEnv().get("ENV_1"));
     assertEquals(true, interpreterProcess.isUserImpersonated());
   }
@@ -79,7 +79,7 @@ public class StandardInterpreterLauncherTest {
     assertEquals(".//local-repo/groupId", interpreterProcess.getLocalRepoDir());
     assertEquals(10000, interpreterProcess.getConnectTimeout());
     assertEquals(zConf.getInterpreterRemoteRunnerPath(), interpreterProcess.getInterpreterRunner());
-    assertEquals(0, interpreterProcess.getEnv().size());
+    assertEquals(1, interpreterProcess.getEnv().size());
     assertEquals(true, interpreterProcess.isUserImpersonated());
   }
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/b183c7e0/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
index 36fc1f1..1fc231c 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
@@ -381,13 +381,13 @@ public class InterpreterSetting {
     if (option.isExistingProcess) {
       key = Constants.EXISTING_PROCESS;
     } else if (getOption().isProcess()) {
-      key = (option.perUserIsolated() ? user : "") + ":" + (option.perNoteIsolated() ? noteId : "");
+      key = (option.perUserIsolated() ? user : "") + "-" + (option.perNoteIsolated() ? noteId : "");
     } else {
       key = SHARED_PROCESS;
     }
 
     //TODO(zjffdu) we encode interpreter setting id into groupId, this is not a good design
-    return id + ":" + key;
+    return id + "-" + key;
   }
 
   private String getInterpreterSessionId(String user, String noteId) {