This is an automated email from the ASF dual-hosted git repository.
zjffdu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push:
new 51bcc94 [ZEPPELIN-5465] SERVICE_DOMAIN may be null while Zeppelin
server is running outside k8s
51bcc94 is described below
commit 51bcc94bbe1ad5fba595f7541361cbc2952cec93
Author: rick <[email protected]>
AuthorDate: Wed Jul 21 18:10:00 2021 +0800
[ZEPPELIN-5465] SERVICE_DOMAIN may be null while Zeppelin server is running
outside k8s
### What is this PR for?
The function `sparkUiWebUrlFromTemplate` needs to use the variable
`SERVICE_DOMAIN` to bind the `jinjava` template, which sets the environment
variable `SERVICE_DOMAIN` as the default value.
However, user may not set the environment variable when Zeppelin server is
running outside of k8s, and it will get a NullPointerExcepetion:
```
NullPointerException: null value in entry: SERVICE_DOMAIN=null
```
When the user does not care about `zeppelin.spark.uiWebUrl`, he does not
need to set the `SERVICE_DOMAIN` environment.
So this PR change the default value of `SERVICE_DOMAIN` to
`local.zeppelin-project.org` if `System.getenv(ENV_SERVICE_DOMAIN) == null` to
avoid the potential NullPointerExcepetion.
### What type of PR is it?
[Improvement]
### Todos
* [ ] - Task
### What is the Jira issue?
* <https://issues.apache.org/jira/browse/ZEPPELIN-5465>
### How should this be tested?
* CI pass and manually tested
### 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: rick <[email protected]>
Closes #4184 from rickchengx/ZEPPELIN-5465 and squashes the following
commits:
11c9f17408 [rick] [ZEPPELIN-5465] SERVICE_DOMAIN may be null while Zeppelin
server is running outside k8s
---
.../zeppelin/interpreter/launcher/K8sRemoteInterpreterProcess.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/zeppelin-plugins/launcher/k8s-standard/src/main/java/org/apache/zeppelin/interpreter/launcher/K8sRemoteInterpreterProcess.java
b/zeppelin-plugins/launcher/k8s-standard/src/main/java/org/apache/zeppelin/interpreter/launcher/K8sRemoteInterpreterProcess.java
index 19ff56f..912c6b1 100644
---
a/zeppelin-plugins/launcher/k8s-standard/src/main/java/org/apache/zeppelin/interpreter/launcher/K8sRemoteInterpreterProcess.java
+++
b/zeppelin-plugins/launcher/k8s-standard/src/main/java/org/apache/zeppelin/interpreter/launcher/K8sRemoteInterpreterProcess.java
@@ -293,7 +293,7 @@ public class K8sRemoteInterpreterProcess extends
RemoteInterpreterManagedProcess
}
Map<String, String> k8sEnv = new HashMap<>(getEnv());
// environment variables
- k8sEnv.put(ENV_SERVICE_DOMAIN, getEnv().getOrDefault(ENV_SERVICE_DOMAIN,
System.getenv(ENV_SERVICE_DOMAIN)));
+ k8sEnv.put(ENV_SERVICE_DOMAIN, getEnv().getOrDefault(ENV_SERVICE_DOMAIN,
System.getenv(ENV_SERVICE_DOMAIN) == null ? "local.zeppelin-project.org" :
System.getenv(ENV_SERVICE_DOMAIN)));
k8sEnv.put(ENV_ZEPPELIN_HOME, getEnv().getOrDefault(ENV_ZEPPELIN_HOME,
System.getenv(ENV_ZEPPELIN_HOME)));
if (isSpark()) {