### What is this PR for?
This PR is for the purpose of recover running interpreter process when zeppelin server is restarted. This would be useful when restarting zeppelin without interrupt current running interpreter processes, should be useful when admin do maintenance or upgrading.
Interface `RecoveryStorage` is used for storing the information of running interpreter process.
Currently it only has one implementation `FileSystemRecoveryStorage`, other implementation could be done later (such as zookeeper based). `InterpreterLauncher` is the component where to recover the running interpreter process.
Test:
* RecoveryTest.java
* FileSystemRecoveryStorageTest.java
Design Doc:
https://docs.google.com/document/d/1Plm3Hd40aGdNaXmjdsoY4ek3f-gTijTMGMkNjAZN39Y/edit?usp=sharing
### What type of PR is it?
[Feature]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-3051
### How should this be tested?
Unit test & Integration Test is added. Also 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
Author: Jeff Zhang <zjffdu@apache.org>
Closes#2668 from zjffdu/ZEPPELIN-3051 and squashes the following commits:
a4c9b9c [Jeff Zhang] address comments
575b7b9 [Jeff Zhang] fix the pid of interpreter process id
02b118f [Jeff Zhang] address comments
da7cbb9 [Jeff Zhang] ZEPPELIN-3051. Support Interpreter Process Recovery
### What is this PR for?
Zeppelin's interpreter setting is shared by all the users and notes, if you want to have different setting you have to create new interpreter, e.g. you can create `spark_jar1` for running spark with dependency jar1 and `spark_jar2` for running spark with dependency jar2.
This approach works, but not so convenient. `ConfInterpreter` can provide more fine-grained control on interpreter setting and more flexibility.
`ConfInterpreter` is a generic interpreter that could be used by any interpreters. The input format should be property file format.
In the first paragraph, we use ConfInterpreter to make custom configuration of spark interpreter (set app name, yarn-client mode & add spark-csv dependencies). Then you can run the second paragraph which use spark-csv.

It can be used to make custom setting for any interpreter. `ConfInterpreter` would run in the zeppelin server side, it would update the interpreter properties before you launch the interpreter process, so it needs to run before interpreter process launched. And when interpreter process is launched is determined by interpreter mode setting. So users needs to understand the interpreter mode setting of zeppelin and be aware when interpreter process is launched. E.g. If we set spark interpreter setting as isolated per note. Under this setting, each note will launch one interpreter process. In this scenario, user need to put `ConfInterpreter` as the first paragraph as the above example. Otherwise the customized setting can not be applied (The paragraph using ConfInterpreter will report ERROR).
### What type of PR is it?
[Feature | Documentation]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-3085
### How should this be tested?
* Unit test, System test is added, also manually verified it.
### 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 <zjffdu@apache.org>
Closes#2692 from zjffdu/ZEPPELIN-3085 and squashes the following commits:
87ce20f [Jeff Zhang] ZEPPELIN-3085. Introduce generic ConfInterpreter for more fine-grained control of interpreter setting
- Pull the latest changes when the notebook page loads in the browser
- After commiting the changes, pull the latest changes from the remote repo then push the latest changes to the remote repo
### What is this PR for?
In some deployment scenarios it is necessary to increase jetty.request.header.size, which default value is 8192. This will reduce the chance of HTTP Error 413 Request entity too large.
There should be a mechanism to configure this setting.
### What type of PR is it?
[Feature]
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-3037
### How should this be tested?
* There is an integration test (automated unit test included) for testing this feature.
* To test manually, after increasing setting, make any http request to zeppelin with a request header bigger than 8K , you should not get an HTTP Error 413 Request entity too large.
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? Yes.
Author: byamthev <byamthev@gmail.com>
Closes#2663 from byamthev/zeppelin3037 and squashes the following commits:
8ff2620 [byamthev] [ZEPPELIN-3037] Configure Http Request Header Size Limit for Jetty
### What is this PR for?
Added dynamic forms for Note. All paragraphs has access to note forms.
### What type of PR is it?
[Feature]
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1363
### How should this be tested?
Create global interpreter JDBC and Spark. Create note with 2 paragraphs
```
%pyspark
print("Textbox paragraph " + z.textbox('input', 'default'))
print("Textbox note " + z.noteTextbox('note_input', 'default_note'))
print("Select paragraph " + z.select("sel", [("1","opt1"), ("2","opt2"), ("3","opt3")]))
print("Select note " + z.noteSelect("sel_note", [("1","noteOpt1"), ("2","noteOpt2"), ("3","noteOpt3")]))
options = [("key1","Name1"), ("key2","Name2")]
print("Checkbox paragraph "+ " and ".join(z.checkbox("chk", options, ["key1"])))
print("Checkbox note "+ " and ".join(z.noteCheckbox("chk_note", options, ["key1","key2"])))
```
```
%jdbc
select '$${checkbox:chk_note=key1|key2,key1|key2} $${note_input} ${note_input=sameName}'
```
### Screenshots (if appropriate)
1) native forms

2) remove

3) simple forms

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no
Author: tinkoff-dwh <tinkoff.dwh@gmail.com>
Closes#2641 from tinkoff-dwh/ZEPPELIN-1363 and squashes the following commits:
3ee4826 [tinkoff-dwh] [ZEPPELIN-1363] autosave textbox
f30033a [tinkoff-dwh] Merge remote-tracking branch 'upstream/master' into ZEPPELIN-1363
29eaca2 [tinkoff-dwh] [ZEPPELIN-1363] fix tests
bf8194e [tinkoff-dwh] Merge remote-tracking branch 'upstream/master' into ZEPPELIN-1363
9b2f3e9 [tinkoff-dwh] [ZEPPELIN-1363] button to remove form
c566462 [tinkoff-dwh] [ZEPPELIN-1363] note dynamic forms (simple; native: spark, python)
### What is this PR for?
Sometimes need to see the difference between versions and to switch to another version and look for changes are not convenient (the page reloaded). This feature allows you to compare any two versions of the notebook.
### What type of PR is it?
Feature
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2813
### How should this be tested?
1 make some commits. Сchange the contents of paragraphs (delete, add, edit)
2 open Revisions comparator
3 compare revisions and check diff
### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? yes (updated)
* Is there breaking changes for older versions? no
* Does this needs documentation? no
Author: tinkoff-dwh <tinkoff.dwh@gmail.com>
Author: Tinkoff DWH <tinkoff.dwh@gmail.com>
Closes#2506 from tinkoff-dwh/ZEPPELIN-2813 and squashes the following commits:
acc624f [tinkoff-dwh] Merge remote-tracking branch 'upstream/master' into ZEPPELIN-2813
2fd89a8 [tinkoff-dwh] Merge remote-tracking branch 'origin/master' into ZEPPELIN-2813
8b8afcc [tinkoff-dwh] Docs edit
efa7ce2 [tinkoff-dwh] Merge branch 'master' into ZEPPELIN-2813
f530524 [tinkoff-dwh] zep-2813 anim off
0e866b2 [tinkoff-dwh] zep_2813 color change
310760e [tinkoff-dwh] zep_2813 UI for REVISIONS COMPARATOR.
3d4f86c [tinkoff-dwh] Merge branch 'master' into ZEPPELIN-2813_refactoring_2
dc67f8f [tinkoff-dwh] [ZEPPELIN-2813] refactoring
514b3f5 [tinkoff-dwh] small fixes, added documentation
4ce5286 [tinkoff-dwh] Merge remote-tracking branch 'origin/master' into ZEPPELIN-2813
b949814 [Tinkoff DWH] [ZEPPELIN-2813] license
a192b95 [Tinkoff DWH] [ZEPPELIN-2813] revisions comparator for note
### What is this PR for?
Before this PR, each time when paragraph use interpreter, it would parse the text to get the interpreter component which is inefficient. This PR would do it when `setText` is called.
### What type of PR is it?
[ Improvement | Refactoring]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-3013
### How should this be tested?
* Unit test is 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 <zjffdu@apache.org>
Closes#2635 from zjffdu/ZEPPELIN-3013 and squashes the following commits:
71c7edf [Jeff Zhang] minor change
c33d4ce [Jeff Zhang] ZEPPELIN-3013. Only parse paragraph text when text is updated
### What is this PR for?
This PR change the "run all paragraphs" to be sequentially running.
### What type of PR is it?
[Improvement]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2368
### How should this be tested?
* First time? Setup Travis CI as described on https://zeppelin.apache.org/contribution/contributions.html#continuous-integration
* Strongly recommended: add automated unit tests for any new or changed behavior
* Outline any manual steps to test the PR here.
### 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 <zjffdu@apache.org>
Closes#2627 from zjffdu/ZEPPELIN-2368 and squashes the following commits:
f701d5b [Jeff Zhang] [ZEPPELIN-2368]. Option to run all paragraphs *sequentially*
### What is this PR for?
This PR implement the lifecycle manager. There're 2 implementions.
* NullLifecycleManager. Nothing is done as before. User has to start/stop interpreter explicitly in UI.
* TimeoutLifecycleManager. Interpreter will be closed after idle for one threshold of time. By default it is 1 hour.
### What type of PR is it?
[ Feature]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2197
### How should this be tested?
Unit test is added.
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Author: Jeff Zhang <zjffdu@apache.org>
Closes#2631 from zjffdu/ZEPPELIN-2197 and squashes the following commits:
8b4c6ce [Jeff Zhang] Add one more test
00d0183 [Jeff Zhang] ZEPPELIN-2197. Interpreter Lifecycle Manager
### What is this PR for?
Trivial fix for matplotlib fail in `IPythonInterpreter`. Besides that, I also make some minor changes on zeppelin code to improve logging.
### What type of PR is it?
[Bug Fix]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2990
### How should this be tested?
UT is 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 <zjffdu@apache.org>
Closes#2622 from zjffdu/ZEPPELIN-2990 and squashes the following commits:
55e6f88 [Jeff Zhang] fix unit test
1e57afe [Jeff Zhang] ZEPPELIN-2990. Matplotlib sometimes fails in IPythonInterpreter
### What is this PR for?
Follow up of #2577. Main changes on Interpreter
* Add throw `InterpreterException` which is checked exception for the abstract methods of `Interpreter`, this would enforce the interpreter implementation to throw `InterpreterException`.
* field name refactoring.
* `property` -> `properties`
* `getProperty()` --> `getProperties()`
* Introduce launcher layer for interpreter launching. Currently we only use shell script to launch interpreter, but it could be any other service or component to launch interpreter, such as livy server , other 3rd party tools or even we may create a separate module for interpreter launcher
* abstract cass `InterpreterLauncher`
* For now, only 2 implementation: `ShellScriptLauncher` & `SparkInterpreterLauncher`. We could add method in class `Interpreter` to allow interpreter to specify its own launcher class, but it could be future work.
### What type of PR is it?
[Improvement | Refactoring]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2685
### How should this be tested?
Unit test is covered. `ShellScriptLauncherTest` & `SparkInterpreterLauncherTest`
### 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 <zjffdu@apache.org>
Closes#2592 from zjffdu/ZEPPELIN-2685 and squashes the following commits:
17dc2f1 [Jeff Zhang] address comments
e545cc3 [Jeff Zhang] ZEPPELIN-2685. Improvement on Interpreter class
### What is this PR for?
Support updating paragraph text/title via REST API
https://issues.apache.org/jira/browse/ZEPPELIN-1897
### What type of PR is it?
Improvement
### Todos
### What is the Jira issue?
[ZEPPELIN-1897]
### How should this be tested?
1. Create a note and paragraph
2. Hit REST API to update the paragraph, e.g. `curl -X PUT http://localhost:8080/api/notebook/NOTE_ID/paragraph/PARAGRAPH_ID -d '{"text": "some updated text"}'`
### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? Yes, doc update included in the change.
Author: chilang <chilang@gmail.com>
Closes#2604 from chilang/master and squashes the following commits:
9cc86de [chilang] ZEPPELIN-1897 REST API - Update paragraph
### What is this PR for?
Support encrypting passwords using a private key
### What type of PR is it?
Improvement
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2952
### How should this be tested?
- Set the env variable `ZEPPELIN_CREDENTIALS_ENCRYPT_KEY=something`
- Save a few credentials
- Check that the `credentials.json` file is storing encrypted passwords
- Restart server using the same env variable for `ZEPPELIN_CREDENTIALS_ENCRYPT_KEY`
- The credentials should still be decryptable
### Questions:
* Does the licenses files need update?
No
* Is there breaking changes for older versions?
No
* Does this needs documentation?
Yes
Author: Herval Freire <hfreire@twitter.com>
Closes#2599 from herval/encrypt-credentials and squashes the following commits:
e5857d8 [Herval Freire] missing license
1d4bc04 [Herval Freire] documentation....?
82ae8f4 [Herval Freire] added license
c3e0ead [Herval Freire] encrypt credentials.json with AES
### What is this PR for?
This actually fetches the user's LDAP roles, when using the LdapRealm, so they're accessible on Zeppelin (via the `SecurityUtils`).
As I debugged through it, I found some weird replacement code, so I wrote some tests around the `LdapRealm` and fixed what I believe was wrong there. Eg.: `expandTemplate` would expand, for instance, `uid={0}` into `uid={0}yourusername`.
In order to make the actual LDAP calls for roles, I exposed the `queryForAuthorizationInfo` method and used it on `SecurityUtils`.
### What type of PR is it?
Bug Fix / Improvement
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2796
### How should this be tested?
I tested this in our LDAP environment. My shiro.ini looked more or less like this:
```
[main]
ldapRealm = org.apache.zeppelin.realm.LdapRealm
ldapRealm.contextFactory.url = ldap://ldap.foo
ldapRealm.contextFactory.authenticationMechanism = simple
ldapRealm.userDnTemplate = uid={0},cn=users,dc=ods,dc=foo
ldapRealm.searchBase = dc=ods,dc=foo,dc=corp
ldapRealm.userSearchBase = cn=users,dc=ods,dc=foo
ldapRealm.groupSearchBase = cn=groups,dc=ods,dc=foo
ldapRealm.authorizationEnabled = true
ldapRealm.groupObjectClass = posixGroup
ldapRealm.memberAttribute = memberUid
ldapRealm.userObjectClass = posixAccount
ldapRealm.memberOfAttribute = memberOf
ldapReal.groupSearchFilter = '(memberUid={0})'
securityManager.realms = $ldapRealm
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
securityManager.sessionManager = $sessionManager
securityManager.sessionManager.globalSessionTimeout = 86400000
shiro.loginUrl = /api/login
[urls]
/api/version = anon
/api/metrics = anon
/api/interpreter/repository/** = authc
/api/configurations/** = authc
/api/credential/** = authc
/api/notebook-repositories = authc
# /** = anon
/** = authc
```
you can tell the role fetching worked inspecting the web call to `/ticker`, which will now return the full roles list
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update?
* Is there breaking changes for older versions?
* Does this needs documentation?
Author: Herval Freire <hfreire@twitter.com>
Closes#2498 from herval/ldap-roles and squashes the following commits:
cfab47c [Herval Freire] fix test
9f2f5a0 [Herval Freire] add license/fix test
4d3ed58 [Herval Freire] expose roles from ldap + fix substitution code
ed1b0f8 [Herval Freire] expose roles from ldap + fix substitution code
### What is this PR for?
CI is failing on selenium test profile.
This hot fix tries to fix it.
### What type of PR is it?
Hot Fix
### Todos
* [x] - Fix selenium test
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2962
### How should this be tested?
CI becomes green
### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no
Author: Lee moon soo <moon@apache.org>
Closes#2603 from Leemoonsoo/make_ci_green and squashes the following commits:
3d818c3 [Lee moon soo] comment issue number
6f9326a [Lee moon soo] comment out extensions
63f1157 [Lee moon soo] make pip quiet
### What is this PR for?
Before this change, it was not allowed to remove the last paragraph which would not make the notebook look clean.
After this change, it will be allowed to remove the last paragraph.
- Whenever there will be only one paragraph in the notebook, remove paragraph option will be hidden so that user will not able to make the notebook empty.
### What type of PR is it?
[Improvement]
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2922
### How should this be tested?
1. Build: mvn clean package -Denforcer.skip -DskipTests -Drat.skip
2. Create paragraphs in a notebook and try to remove it
3. You can delete any paragraphs(even last paragraphs), but when there will be only one paragraph, remove button will be hidden
### Screenshots (if appropriate)
After:

### Questions:
* Does the licenses files need an update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? May be
Author: Malay Majithia <malay.majithia@gmail.com>
Closes#2579 from malayhm/ZEPPELIN-2922 and squashes the following commits:
7c815ce [Malay Majithia] Removed unwanted line
1220f13 [Malay Majithia] Merge branch 'master' into ZEPPELIN-2922
73fd065 [Malay Majithia] ZEPPELIN-2922 Allow removing last paragraph
### What is this PR for?
When OIDC is enabled, user's roles/permissions/tokens are sent to Zeppelin's client via websocket and appears in the web browser when running a paragraph in a notebook.
### What type of PR is it?
[Bug Fix]
### What is the Jira issue?
* [ZEPPELIN-2880](https://issues.apache.org/jira/browse/ZEPPELIN-2880)
### How should this be tested?
Enable OIDC , login to Zeppelin and run a paragraph. Check the text "Last updated by".
### Questions:
* Does the licenses files need update? N/A
* Is there breaking changes for older versions? N/A
* Does this needs documentation? N/A
Author: byamthev <byamthev@gmail.com>
Closes#2551 from byamthev/zeppelin_2880 and squashes the following commits:
cb6ec70 [byamthev] [ZEPPELIN-2880] - Fix username output when OIDC is enabled
11d0729 [byamthev] [ZEPPELIN-2880] - Fix username output when OIDC is enabled
7263689 [byamthev] [ZEPPELIN-2880] - Fix username output when OIDC is enabled
### What is this PR for?
This is the first version for supporting yarn-cluster of `SparkInterpreter`. I just delegate all the function to `spark-submit` as yarn-cluster is natively supported by spark, we don't need to reinvent the wheel. But there's still improvement to be done in future, e.g. I put some spark specific logic in `InterpreterSetting` which is not a good practise. I plan to improve it when I refactor the `Interpreter` class (ZEPPELIN-2685).
Besides that, I also add `MiniHadoopCluster` & `MiniZeppelin` which help for the integration test of yarn-client & yarn-cluster mode, otherwise I have to manually verify yarn-client & yarn-cluster mode which would easily cause regression issue in future.
To be noticed:
* SPARK_HOME must be specified for yarn-cluster mode
* HADOOP_CONF_DIR must be specified for yarn-cluster mode
### What type of PR is it?
[Feature]
### Todos
* [ ] - Task
### What is the Jira issue?
https://github.com/zjffdu/zeppelin/tree/ZEPPELIN-2898
### How should this be tested?
System test is added in `SparkInterpreterIT`.
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Author: Jeff Zhang <zjffdu@apache.org>
Closes#2577 from zjffdu/ZEPPELIN-2898 and squashes the following commits:
9da7c4b [Jeff Zhang] ZEPPELIN-2898. Support Yarn-Cluster for Spark Interpreter
### What is this PR for?
Show user list/suggestions in the notebook permission form when using Shiro and JDBC Realm.
### What type of PR is it?
Bug Fix
### What is the Jira issue?
[ZEPPELIN-2894](https://issues.apache.org/jira/browse/ZEPPELIN-2894)
### How should this be tested?
- Shiro with JDBC Realm (e.g. PostgreSQL JDBC Driver)
- Login to any account
- Open Notebook permission form
- Try to get any user suggestion in the dropdown menu by typing an existing name
### Screenshots
**After:**

**Before:**

### Questions:
* Does the licenses files need update?
No.
* Is there breaking changes for older versions?
No.
* Does this needs documentation?
No.
Author: janusd <js.c.dyb@gmail.com>
Closes#2559 from janusd/master and squashes the following commits:
ab84a5ca8 [janusd] [ZEPPELIN-2894] Show user list in notebook permission using Shiro JDBC Realm
### What is this PR for?
This PR fixed a JDBC connection leak on `GetUserList.getUserList` when the Shiro Realm is a JdbcRealm. After a while, it's not possible to even login into zeppelin.
### What type of PR is it?
Bug Fix
### Todos
N/A
### What is the Jira issue?
[ZEPPELIN-2900](https://issues.apache.org/jira/browse/ZEPPELIN-2900)
### How should this be tested?
In order to reproduce the bug follow this steps:
1. Configure zeppelin to use a JdbcRealm for authentication with a low number of connections in the connection pool.
2. Login into zeppelin and open a notebook.
3. Open the permissions form of the notebook.
4. Try to add several users to the owners list (more than the number of connections of the connection pool.
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update? No.
* Is there breaking changes for older versions? No that I'm aware.
* Does this needs documentation? No.
Author: Luis Vicente <langel.vicente@gmail.com>
Closes#2567 from lvicentesanchez/bugfix/zeppelin-2900 and squashes the following commits:
ad5bb9b [Luis Vicente] [ZEPPELIN-2900] Close connection on getUserList
### What is this PR for?
HTTP Response Headers were being added multiple times. Replacing addHeader method with setHeader overrides the Response Header value with new/existing value instead of adding another duplicate response Header.
### What type of PR is it?
[Bug Fix]
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2896
### How should this be tested?
Open the Zeppelin URL in Chrome Browser. Select "More Tools" -> "Developer Tools" from the right-side menu. Under Network Section, select the request with name "localhost" and check for "Response Headers". You should see response headers appearing only once.

Author: krishna-pandey <krish.pandey21@gmail.com>
Closes#2564 from krishna-pandey/ZEPPELIN-2896 and squashes the following commits:
66aa3b229 [krishna-pandey] Fixing test cases in CorsFilterTest.java
89a3fdcd3 [krishna-pandey] replacing addHeader with setHeader
What is this PR for?
I didn't intended to make such large change at the beginning, but found many things are coupled together that I have to make such large change. Several suggestions for you how to review and read it.
I move the interpreter package from zeppelin-zengine to zeppelin-interpreter, this is needed for this refactoring.
The overall change is the same as I described in the design doc. I would suggest you to read the unit test first. These unit test is very readable and easy to understand what the code is doing now. `InterpreterFactoryTest`, `InterpreterGroupTest`, `InterpreterSettingTest`, `InterpreterSettingManagerTest`, `RemoteInterpreterTest`.
Remove the referent counting logic. Now I will kill the interpreter process as long as all the sessions in the same interpreter group is closed. (I plan to add another kind of policy for the interpreter process lifecycle control, ZEPPELIN-2197)
The RemoteFunction I introduced is for reducing code duplicates when we use RPC.
The changes in `Job.java` and `RemoteScheduler` is for fixing the race issue bug. This bug cause the flaky test we see often in `ZeppelinSparkClusterTest.pySparkTest`
What type of PR is it?
[Bug Fix | Refactoring]
Todos
- Task
What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2627
How should this be tested?
Unit test is 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 <zjffdu@apache.org>
Closes#2554 from zjffdu/ZEPPELIN-2627-2 and squashes the following commits:
fa0d435 [Jeff Zhang] minor update
74bcb91 [Jeff Zhang] [ZEPPELIN-2627] Interpreter Component Refactoring
### What is this PR for?
The idea of this PR is to provide a new kind of user : Runner.
Basically, what it does is that it just removes write authorization and allow user to read and run note.
### What type of PR is it?
[Feature]
### Todos
* [ ] - Task
### What is the Jira issue?
[ZEPPELIN-2848] https://issues.apache.org/jira/browse/ZEPPELIN-2848
### How should this be tested?
- Log in as admin
- Create new notebook and create a paragraph with the interpreter you want
- Assign runner right to user1
- Log in as user1
- Try to run the paragraph (should work)
- Try to modify the paragraph (should fail)
- Log in as user2
- Try to run the paragraph (should fail)
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? Yes
* Does this needs documentation? No
Author: Paolo Genissel <paolo.genissel-monsallier@1000mercis.com>
Author: gfalcone <paologenissel@gmail.com>
Author: Paolo Genissel <paologenissel@gmail.com>
Closes#2526 from gfalcone/new_type_runner and squashes the following commits:
96bba66 [gfalcone] Fix typo on notebook_authorization.md
8ab4512 [gfalcone] Update notebook_authorization.md
22a1eb3 [Paolo Genissel] Fixed typo
d621792 [Paolo Genissel] Fix NotebookSecurityRestApiTest
a67af0f [Paolo Genissel] Fix test
5c43ca9 [Paolo Genissel] Added new type of user
This reverts commit 8d4902e717.
### What is this PR for?
Just revert ZEPPELIN-2627
### What type of PR is it?
[Refactoring]
### Todos
* [ ] - Task
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2627
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Author: Jeff Zhang <zjffdu@apache.org>
Closes#2553 from zjffdu/Revert_2627 and squashes the following commits:
222d957 [Jeff Zhang] Revert "[ZEPPELIN-2627] Interpreter refactor"
### What is this PR for?
I didn't intended to make such large change at the beginning, but found many things are coupled together that I have to make such large change. Several suggestions for you how to review and read it.
* I move the interpreter package from zeppelin-zengine to zeppelin-interpreter, this is needed for this refactoring.
* The overall change is the same as I described in the design doc. I would suggest you to read the unit test first. These unit test is very readable and easy to understand what the code is doing now. `InterpreterFactoryTest`, `InterpreterGroupTest`, `InterpreterSettingTest`, `InterpreterSettingManagerTest`, `RemoteInterpreterTest`.
* Remove the referent counting logic. Now I will kill the interpreter process as long as all the sessions in the same interpreter group is closed. (I plan to add another kind of policy for the interpreter process lifecycle control, ZEPPELIN-2197)
* The `RemoteFunction` I introduced is for reducing code duplicates when we use RPC.
* The changes in Job.java and RemoteScheduler is for fixing the race issue bug. This bug cause the flaky test we see often in `ZeppelinSparkClusterTest.pySparkTest`
### What type of PR is it?
[Bug Fix | Refactoring]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2627
### How should this be tested?
Unit test is 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 <zjffdu@apache.org>
Closes#2422 from zjffdu/interpreter_refactor and squashes the following commits:
4724c98 [Jeff Zhang] [ZEPPELIN-2627] Interpreter Component Refactoring
### What is this PR for?
This is the first step for implement IPython Interpreter in Zeppelin. I just use the jupyter_client to create and manage the ipython kernel. We don't need to care about python compilation and execution, all the things are delegated to ipython kernel. Ideally all the features of ipython should be available in Zeppelin as well.
For now, user can use %python.ipython for IPython Interpreter. And if ipython is available, the default python interpreter will use ipython. But user can still set `zeppelin.python.useIPython` as false to enforce to use the old implementation of python interpreter.
Main features:
* IPython interpreter support
** All the ipython features are available, including visualization, ipython magics.
* ZeppelinContext support
* Streaming output support
* Support Ipython in PySpark
Regarding the visualization, ideally all the visualization libraries work in jupyter should also work here.
In unit test, I only verify the following 3 popular visualization library. could add more later.
* matplotlib
* bokeh
* ggplot
### What type of PR is it?
[Feature ]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2753
### How should this be tested?
Unit test is added.
### Screenshots (if appropriate)
Verify bokeh in IPython Interpreter

Verify matplotlib

Verify ZeppelinContext

Verify Streaming

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Author: Jeff Zhang <zjffdu@apache.org>
Closes#2474 from zjffdu/ZEPPELIN-2753 and squashes the following commits:
e869f31 [Jeff Zhang] address comments
b0b5c95 [Jeff Zhang] [ZEPPELIN-2753] Basic Implementation of IPython Interpreter
### What is this PR for?
This is to test the new feature that was brought in with ZEPPELIN-2825 (org.apache.zeppelin.utils.AnyOfRolesAuthorizationFilter)
### What type of PR is it?
[Improvement]
### What is the Jira issue?
* [ZEPPELIN-2846](https://issues.apache.org/jira/browse/ZEPPELIN-2846)
### How should this be tested?
CI should be green
### Questions:
* Does the licenses files need update? N/A
* Is there breaking changes for older versions? N/A
* Does this needs documentation? N/A
Author: Prabhjyot Singh <prabhjyotsingh@gmail.com>
Closes#2524 from prabhjyotsingh/ZEPPELIN-2846 and squashes the following commits:
e2a7ad548 [Prabhjyot Singh] add selenium test case for AnyOfRolesAuthorizationFilter
### What is this PR for?
Notebook content doesn't get saved if there is a flaky network, and at times user's paragraph content also gets lost in this process.
### What type of PR is it?
[Bug Fix]
### What is the Jira issue?
* [ZEPPELIN-2823](https://issues.apache.org/jira/browse/ZEPPELIN-2823)
### How should this be tested?
Steps to re-produce:
- create a new notebook
- in the first paragraph enter text, say "version1"
- now disconnect the network (say by removing LAN cable)
- update this paragraph again with text "version2"
- reconnect network
- now observe the on the WebSocket reconnect, the content of this paragraph will go back to "version1"
### Screenshots (if appropriate)
Before

After

### Questions:
* Does the licenses files need an update? N/A
* Is there breaking changes for older versions? N/A
* Does this needs documentation? N/A
Author: Prabhjyot Singh <prabhjyotsingh@gmail.com>
Closes#2512 from prabhjyotsingh/ZEPPELIN-2823 and squashes the following commits:
5f693ab93 [Prabhjyot Singh] - replace _.forEach with .map - extract BootstrapDialog.show outside of the for loop
db30f479b [Prabhjyot Singh] alter text to `Changes that you have made will not be saved`
947be70b4 [Prabhjyot Singh] check if noteId exists in session or take it from fromMessage
8b8c2f974 [Prabhjyot Singh] check for empty originalText
d2a835f77 [Prabhjyot Singh] wait for server confirmation before updating stats of notebook
### What is this PR for?
This PR adds support for such a configuration which can give access to user who belongs to "any of" the roles defined in Shiro configuration. By default, as per Shiro implementation, user is allowed only when he/she belongs to "all" the roles defined.
This PR fixes the problem for static users/roles in Shiro as well as Active Directory and/or LDAP based user-group-roles mapping.
### What type of PR is it?
Improvement
### TODO
* [x] - Add documentation
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2825
### How should this be tested?
Add the following in shiro.ini:
[main]
...
anyofroles = org.apache.zeppelin.utils.AnyOfRolesAuthorizationFilter
[urls]
...
/api/interpreter/** = authc, **anyofroles**[admin, role1]
/api/configurations/** = authc, roles[admin]
/api/credential/** = authc, roles[admin]
### Screenshots (if appropriate)
Not applicable
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? Yes
Author: Vipin Rathor <v.rathor@gmail.com>
Closes#2515 from VipinRathor/ZEPPELIN-2825 and squashes the following commits:
01deb25b0 [Vipin Rathor] ZEPPELIN-2825 - Added license header
2105810f7 [Vipin Rathor] ZEPPELIN-2825 - Fix formatting for doc changes
95a9b4f41 [Vipin Rathor] ZEPPELIN-2825 - Fix formatting in doc changes
3f49d8413 [Vipin Rathor] ZEPPELIN-2825 - Add documentation for supporting any of the Shiro roles
c5fc9deac [Vipin Rathor] ZEPPELIN-2825 - Fix Zeppelin to support any of the Shiro roles
### What is this PR for?
The HTTP Strict-Transport-Security response header (often abbreviated as HSTS) is a security feature that lets a web site tell browsers that it should only be communicated with using HTTPS, instead of using HTTP.
Note: The Strict-Transport-Security header is ignored by the browser when your site is accessed using HTTP; this is because an attacker may intercept HTTP connections and inject the header or remove it. When your site is accessed over HTTPS with no certificate errors, the browser knows your site is HTTPS capable and will honor the Strict-Transport-Security header.
The HTTP X-XSS-Protection response header is a feature of Internet Explorer, Chrome and Safari that stops pages from loading when they detect reflected cross-site scripting (XSS) attacks.
### What type of PR is it?
[Bug Fix | Improvement ]
### What is the Jira issue?
* [ZEPPELIN-2775](https://issues.apache.org/jira/browse/ZEPPELIN-2775)
### How should this be tested?
Make a curl call to Zeppelin? Go to Chrome Browser and select "More Tools" -> "Developer Tools" from the right-side menu. Under Network Section, select any request and check for "Response Headers". You should see below headers along with existing ones.
> strict-transport-security:max-age=631138519
> x-xss-protection:1; mode=block
<img width="1436" alt="screen shot 2017-07-14 at 8 19 14 pm" src="https://user-images.githubusercontent.com/6433184/28217231-16ce6cee-68d2-11e7-91aa-77ad083612c7.png">
### Questions:
* Does this needs documentation?
Author: krishna-pandey <krish.pandey21@gmail.com>
Closes#2492 from krishna-pandey/ZEPPELIN-2775 and squashes the following commits:
7d9978e49 [krishna-pandey] Modified Documentation as per review.
6733289ed [krishna-pandey] Adding documentation for HTTP Security Headers
754d2d71e [krishna-pandey] Supplying String instead of Int (required for Response Header)
468231cc6 [krishna-pandey] Added configurable Strict-Transport-Security and X-XSS-Protection Headers
### What is this PR for?
This PR tries to address https://issues.apache.org/jira/browse/ZEPPELIN-2724.
### What type of PR is it?
Bug Fix
### Todos
* [x] - Move NotebookSocket.send() out of synchronized block
* [x] - Waits for verification this actually fixes the problem
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2724
### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no
Author: Lee moon soo <moon@apache.org>
Closes#2465 from Leemoonsoo/ZEPPELIN-2724 and squashes the following commits:
a20a57b [Lee moon soo] initialize with empty list
c01246c [Lee moon soo] Move NotebookSocket.send() out of synchronized block
### What is this PR for?
Fixing bug on enabling Helium plugins (artifact is empty, not null) when sending curl command.
After noticing out-of-date documentation, I updated it
Also noticed issues on missing try/catch expressions and missing info messages on enable/disable packages.
### What type of PR is it?
[Bug Fix | Documentation | Refactoring]
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2699
### How should this be tested?
Run "curl -X POST http://localhost:8080/api/helium/enable/{packageName}"
Check that the package gets enabled
### Questions:
* Does the licenses files need update? N
* Is there breaking changes for older versions? N
* Does this needs documentation? Y (Done)
Author: Nelson Costa <nelson.costa85@gmail.com>
Closes#2446 from necosta/zeppelin2699 and squashes the following commits:
473f9b43 [Nelson Costa] [ZEPPELIN-2699] Fixed initialization issue
45b77513 [Nelson Costa] [ZEPPELIN-2699] More corrections
c8230218 [Nelson Costa] [ZEPPELIN-2699] Bug-fix on gathering package info
2b1ff8ae [Nelson Costa] [ZEPPELIN-2699] Changes after code review
a71b9fb9 [Nelson Costa] [ZEPPELIN-2699] Changes after code-review
5d179218 [Nelson Costa] [ZEPPELIN-2699] Helium REST API bug-fixes. Also updated documentation
### What is this PR for?
This is due to the custom TypeAdapter for Paragraph. I don't know why we introduce it. To me it is not necessary. So I remove this in this PR. And the spark UI still can be accessed in frontend.
### What type of PR is it?
[Bug Fix]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2758
### How should this be tested?
Unit test is updated 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: Jeff Zhang <zjffdu@apache.org>
Closes#2485 from zjffdu/ZEPPELIN-2758 and squashes the following commits:
74f8488 [Jeff Zhang] reset runtimeInfos
b51d566 [Jeff Zhang] [ZEPPELIN-2758]. NumberFormatException on importing notebook
### What is this PR for?
Prevent SQL injection for ```GetUserList.getUserList```.
### What type of PR is it?
Improvement
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2769
Author: Yanbo Liang <ybliang8@gmail.com>
Closes#2487 from yanboliang/zeppelin-2769 and squashes the following commits:
d1a7ff9b [Yanbo Liang] Prevent SQL injection for GetUserList.getUserList.
### What is this PR for?
We have improved zeppelin-web, but some parts are still messy. As part of keeping zeppelin-web module healthy ([ZEPPELIN-2725](https://issues.apache.org/jira/browse/ZEPPELIN-2725)), I suggest having these file structure. (Refer the screenshot section)
Here are few reasons.
- unified directory, file name helps us to recognize, find which part we should modify / fix
* Let's say we need to modify the resize feature of paragraph, where the developer can find it? currently, it's under `component/resizable` not under `paragraph/resizeable` and also it's not the shareable component. There is no reason to keep that files in `component/**`
- [this structure](https://github.com/toddmotto/angularjs-styleguide#file-naming-conventions) is what the angularjs community has verified for few years. so newly joined developers can feel more comfortable.
- this is necessary for [Modular archiecture](https://issues.apache.org/jira/browse/ZEPPELIN-2750) and it eventually helps us to make a smooth transition toward next technologies (even whatever we will use)
Additionally,
- This is not the meaningless refactoring PR and doesn't block developing new features / fixes (Please refer the `Some Details` section)
- I will handle conflicts for few days would be brought by other WIPs
For your information,
- https://github.com/toddmotto/angularjs-styleguide#file-naming-conventions
- https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#naming
#### How to Review This PR?
Please follow the commits. I modified submodules by splitting commits. Thus commit message includes what has been done in that PR. For example,

#### Some Details
- Didn't change the widely used variable names not to make many conflicts. For example, `websocketMsgSrv`, `arrayOrderingSrv`
- Since there are helium packages already published, didn't change the HTML file names like `pivot_setting.html` (it's better to use `pivot-setting.html` if we following the rule)
### What type of PR is it?
[Improvement | Refactoring]
### Todos
Please refer the commit message.
### What is the Jira issue?
[ZEPPELIN-2749](https://issues.apache.org/jira/browse/ZEPPELIN-2749)
### How should this be tested?
**All functionalities must work** as like before, CI will test it.
### Screenshots (if appropriate)
#### Before: messy, mixed directory structure

#### After: only the shared components will be placed under `components/`

### Questions:
* Does the licenses files need update? - NO
* Is there breaking changes for older versions? - NO
* Does this needs documentation? - NO
Author: 1ambda <1amb4a@gmail.com>
Closes#2472 from 1ambda/ZEPPELIN-2749/use-scalable-file-structure-for-zeppelin-web and squashes the following commits:
22e6bf95 [1ambda] fix: AuthenticationIT, InterpreterModeActionsIT
e31f0bc8 [1ambda] fix: AbstractZeppelinIT
102e5443 [1ambda] paragraph-parameterized-query-form: Rename
74e0af41 [1ambda] paragraph-progress-bar: Rename
0029d6b7 [1ambda] job-progress-bar: Rename
af420a41 [1ambda] helium: Move helium related files into app/helium
285a6462 [1ambda] notebook-repository: Rename injected ctrl name
147572f1 [1ambda] notebook-repository: Rename files, funcs
4f66b642 [1ambda] ng-*: Rename files, funcs
f25d981e [1ambda] interpreter: Move interpreter specific directives into interpreter/
4a0602f7 [1ambda] array-ordering: Rename files
1e4ba709 [1ambda] code-editor: Move paragraph specific directive into paragraph/code-editor
31dcf6a3 [1ambda] base-url: Rename file
1afb2d03 [1ambda] note-name-filter: Rename files
ec046683 [1ambda] dropdown-input: Move notebook specific directive into notebook/dropdown-input
81fa2d44 [1ambda] elastic-input: Move notebook specific ctrl into notebook/elastic-input
657d0638 [1ambda] note-rename: Add prefix note-
47ac45d1 [1ambda] expand-collapse: Move navbar specific directive into navbar/
8bc78124 [1ambda] login: Remove invalid attr in login
b2bf91b0 [1ambda] note-import: Rename to noteImportCtrl
07b1f3ff [1ambda] note-create: Rename to noteCreateModal
568149ed [1ambda] note-create: Rename injected controller
c3402449 [1ambda] note-create: Rename files
e17c7ee7 [1ambda] note-create: Remove useless dialog postfix
b0a36a7e [1ambda] note-import: Remove meaningless postfix dialog
abf6869d [1ambda] note-import: Rename files
a40ea23c [1ambda] search: Move search specific service into serach/
7a094841 [1ambda] browser-detect: move save-as specific service into save-as/
40f62e3c [1ambda] rename: Modify injected service name
e993133a [1ambda] rename: Rename funcs
1f950943 [1ambda] note-action: Rename injected service name
d3da2d45 [1ambda] note-action: Rename files, funcs
b9f3c178 [1ambda] note-list-elem: Rename
d3132e9a [1ambda] note-list: Remove useless middle word Data
b5dff142 [1ambda] resizable: Move para specific directive into paragraph/
bfcd6b85 [1ambda] resizable: Rename funcs
40643997 [1ambda] fix: Remove useless postfix and rename files, funcs
0611aff5 [1ambda] websocket: Rename funcs
a2527530 [1ambda] fix: Remove meaningless postfix from searchService
c21a1237 [1ambda] move: paragraph specific ctrl into paragraph/
ad99c04b [1ambda] move: note specific dialog into notebook/
701f4432 [1ambda] move: note specific service into notebook/
3f02c503 [1ambda] fix: Remove unused saveAsService from paragraph ctrl
d7d7434a [1ambda] move: note specific service saveAsService into notebook/
4e7f6d9c [1ambda] fix: Move repository-create into interpreter/
a9a6368a [1ambda] fix: remove useless dir interpreter-create
c1c210de [1ambda] rename: repository-dialog -> repository-create
### What is this PR for?
The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame> or <iframe>. Sites can use this to avoid Clickjacking attacks, by ensuring that their content is not embedded into other sites. Set the X-Frame-Options header for all responses containing HTML content. The possible values are "DENY", "SAMEORIGIN", or "ALLOW-FROM uri"
### What type of PR is it?
[Bug Fix | Improvement ]
### What is the Jira issue?
* [ZEPPELIN-2765](https://issues.apache.org/jira/browse/ZEPPELIN-2765)
### How should this be tested?
The application (Zeppelin) loads in iframe. Put below code in a html file and open in browser:
<iframe src="{http_proto}://{zeppelin_host}:{zeppelin_port}/#/" width="100%" height="600"></iframe>
Author: krishna-pandey <krish.pandey21@gmail.com>
Closes#2482 from krishna-pandey/ZEPPELIN-2765 and squashes the following commits:
948d9c0e9 [krishna-pandey] Removed hyphen from the value
518f1a4a2 [krishna-pandey] Configurable X-FRAME-OPTIONS for Zeppelin
…cationQuery
### What is this PR for?
GetUserList with JDBCRealm should read field authenticationQuery but not DEFAULT_AUTHENTICATION_QUERY,
or it will assume that the query must be "select password from users where username = ?"
### What type of PR is it?
[Bug Fix]
### Todos
None
### What is the Jira issue?
* https://issues.apache.org/jira/projects/ZEPPELIN/issues/ZEPPELIN-2731
### How should this be tested?
1. In shiro.ini config the JDBCRealm like:
ds = org.apache.commons.dbcp2.BasicDataSource
ds.driverClassName = com.mysql.jdbc.Driver
ds.url= jdbc:mysql://localhost:3306/shiro
ds.username = root
ds.password = 123456
jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm
jdbcRealm.dataSource = $ds
jdbcRealm.permissionsLookupEnabled = false
jdbcRealm.authenticationQuery = SELECT password FROM user WHERE name = ?
jdbcRealm.userRolesQuery = SELECT role_name FROM user_roles WHERE name = ?
jdbcRealm.permissionsQuery = SELECT permission FROM roles_permissions WHERE role_name = ?
2. login and request the rest
Get /security/userlist/youruser
### 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: lichenyang <lichenyang@cmss.chinamobile.com>
Closes#2466 from reminia/zeppelin-2731 and squashes the following commits:
84b3fde [lichenyang] [ZEPPELIN-2731] GetUserList with JDBCRealm should read field authenticationQuery
### What is this PR for?
When "spark.ui.enabled" property is set to "false" we should not show the Spark UI button.
We keep the same behaviour when this property does not exist or when it exists and it's set to true.
### What type of PR is it?
[ Improvement]
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-2714
### How should this be tested?
1. Open Zeppelin, go to Interpreter > Spark
1. Click spark ui > msg: "No spark application running"
1. Go to a paragraph, run "sc.parallelize(1 to 100).count()", check "SPARK JOB" button
1. Go to Interpreter > Spark > Set "spark.ui.enabled" to "false"
1. Rerun paragraph > "SPARK JOB" button not visible
1. Go to Interpreter > Spark > "spark ui" button not visible
Also, test with "spark.ui.enabled"="true" and other workflow combinations
### Questions:
* Does the licenses files need update? N
* Is there breaking changes for older versions? N
* Does this needs documentation? N
Author: Nelson Costa <nelson.costa85@gmail.com>
Closes#2456 from necosta/zeppelin2714 and squashes the following commits:
278a23e [Nelson Costa] [ZEPPELIN-2714] Fixed broken unit-test
edf29cc [Nelson Costa] [ZEPPELIN-2714] Minor final fix
294dea8 [Nelson Costa] [ZEPPELIN-2714] Improvements to change request
a85864c [Nelson Costa] [ZEPPELIN-2714] Soft-code Spark UI button visualization