Commit graph

576 commits

Author SHA1 Message Date
Lee moon soo
850fd81a51 [ZEPPELIN-212] Multiple paragraph results
### What is this PR for?
Currently a paragraph can display only a single type of result.
For example
```
print("""
%text textout
%html htmlout
""")
```

will display only last display system detected, "htmlout".

This pr implements multiple results supports, so not only the last, but also all the display systems in a paragraph outputs can be displayed.

To do that, Note.json format need to be changed. from

```
   paragraph : [
      {
          result : {
              code: "",
              type: "",
              msg: ""
          },
          config : {
             graph : {},
             ...
          },
          ...
      },
      ...
   ],
   ...
```

to

```
   paragraph : [
      {
          results : {
             {
                code: "",
                msg: [
                   {
                        type: "",
                        data: ""
                    },
                    {
                        type: "",
                        data: ""
                     },
                     ...
                ]
          },
          config : {
             results : [
                {
                    graph : {},
                },
                {
                    graph : {},
                },
                ...
             ]
          },
          ...
      },
      ...
   ],
   ...
```

### What type of PR is it?
Improvement

### Todos
* [x] - Make InterpreterResult and InterpreterOutput support multiple display system
* [x] - Automatic migration old format to new format
* [x] - Render multiple results in front-end
* [x] - Take care Importing old notebook format
* [x] - Make helium framework support multiple results

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

### How should this be tested?

run following code in a single spark paragraph.
```
%spark
// default output is text
(1 to 3).foreach{i=>
  println(new java.util.Date())
  Thread.sleep(1000)
}

// print something in html
println(s"""%html <h3><font style="color:blue">Some HTML</font></h3>""")

// create table
println(s"""%table key\tvalue
sun\t100
moon\t200

""")

// display text again
println("""%text""")
(1 to 3).foreach{i=>
  println(new java.util.Date())
  Thread.sleep(1000)
}

// another table
Thread.sleep(1000)
println(s"""%table key\tvalue
apple\t100
banana\t200
""")
```

### Screenshots (if appropriate)
![multipleout](https://cloud.githubusercontent.com/assets/1540981/20465902/23379948-af1d-11e6-85cf-4d70597fb94e.gif)

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

Author: Lee moon soo <moon@apache.org>

Closes #1658 from Leemoonsoo/ZEPPELIN-212 and squashes the following commits:

0c6a13c [Lee moon soo] Merge remote-tracking branch 'origin/master' into ZEPPELIN-212
519cf23 [Lee moon soo] Update PythonInterpreterPandasSqlTest
e6268ac [Lee moon soo] Update PythonInterpreterMatplotlibTest.java
f5034b8 [Lee moon soo] Merge remote-tracking branch 'origin/master' into ZEPPELIN-212
d5981d5 [Lee moon soo] Merge remote-tracking branch 'origin/master' into ZEPPELIN-212
a1fe729 [Lee moon soo] document note format change
282504e [Lee moon soo] Merge remote-tracking branch 'origin/master' into ZEPPELIN-212
7ab6679 [Lee moon soo] update selenium test
6a897a5 [Lee moon soo] Update rest-api doc
cbbd58a [Lee moon soo] update unittest
e89c9b8 [Lee moon soo] restore tutoral note
3ba37b7 [Lee moon soo] Let old version import note without error
d09e03f [Lee moon soo] enable helium only in the last result
6682908 [Lee moon soo] Remove unnecessary listener method
0f1d28f [Lee moon soo] Merge branch 'master' into ZEPPELIN-212
73b3a81 [Lee moon soo] update selenium test
e69f1a1 [Lee moon soo] update test
f12230f [Lee moon soo] Remove unnecessary newline in test
26e201a [Lee moon soo] Update testcase
b01d70f [Lee moon soo] Make helium app work
0a5b4d1 [Lee moon soo] Update HeliumApplicationFactoryTest
d8ca07f [Lee moon soo] update NotebookTest
aaf9778 [Lee moon soo] fix r test
3e43df4 [Lee moon soo] make zeppelin-web test pass
1d6fd3e [Lee moon soo] fix compile errors
0156ffc [Lee moon soo] take care angular object
804768d [Lee moon soo] Take care output streaming
57d6b2f [Lee moon soo] Render multiple results
95b6037 [Lee moon soo] Multiple results
2016-11-30 17:23:57 -08:00
CloverHearts
9db840c655 [ZEPPELIN-1665] Z.run with external note executable and access resource for zeppelin in each interpreter
### What is this PR for?
Currently, the z.run command is restricted.
Only paragraphs in a single note can be executed.
I have modified this to allow you to freely execute paragraphs of other notes.
This PR provides the basis for the freeful use of Zeppelin's resources at each Interpreter implementation.

### What type of PR is it?
Improvement, Feature

### Todos
- [x] extends z.run
- [x] run all paragraph in external note
- [x] run paragraph for external note.
- [x] get resource for zeppelin in each interpreter.
- [x] improve test case.
- [x] how to use docuement

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

### How should this be tested?
Currently under development.

run paragraph in same note
```
%spark
z.run("paragraphID")
```

run paragraph with external note
```
z.run("noteid", "paragraphid");
```

all note run
```
z.runNote("noteid");
```

### Screenshots (if appropriate)
- paragraph run
![zrun](https://cloud.githubusercontent.com/assets/10525473/20304857/ca056300-ab75-11e6-8276-0fe0667a5a24.gif)

- noterun
![runnote](https://cloud.githubusercontent.com/assets/10525473/20472104/527cd8de-affa-11e6-9587-0438140e264f.gif)

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

Author: CloverHearts <cloverheartsdev@gmail.com>

Closes #1637 from cloverhearts/extends-zrun-remote-transaction and squashes the following commits:

41fa9d7 [CloverHearts] restore unless changed and import
113b475 [CloverHearts] Merge branch 'master' into extends-zrun-remote-transaction
03a3a2b [CloverHearts] testcase change z.run(2, context) to z.run(2)
2a2c173 [CloverHearts] Merge branch 'master' into extends-zrun-remote-transaction
f2e3bcf [CloverHearts] fix TestCase
5a80a5a [CloverHearts] last test case time check to print string
e6cd82c [CloverHearts] Merge branch 'master' into extends-zrun-remote-transaction
3862166 [CloverHearts] regenerate thrfit class
5ec4640 [CloverHearts] change defined protocol for thrift
7562535 [CloverHearts] remove unused import and asterisk import
8a54917 [CloverHearts] Merge branch 'master' into extends-zrun-remote-transaction
342752d [CloverHearts] add document for extends z.run and z.runNote
292319a [CloverHearts] add test case for extends z.run and z.runNote
10c2a47 [CloverHearts] Implement runNote and re implement run method
f9661c8 [CloverHearts] Merge branch 'master' into extends-zrun-remote-transaction
9ab05af [CloverHearts] Change structure and remove remoteWorksManager
8cbe46c [CloverHearts] remote remoteworksController in interpreter.java
8d42c16 [CloverHearts] Merge branch 'master' into extends-zrun-remote-transaction
f11fed4 [CloverHearts] Merge branch 'workflow' into extends-zrun-remote-transaction
c074f07 [CloverHearts] fix sio support
4b1ef08 [CloverHearts] fix thrift interface
2628a20 [CloverHearts] fix thrift
6fbe08a [CloverHearts] Merge branch 'master' into workflow
3f75bd5 [CloverHearts] support scald
55e8704 [CloverHearts] support spark r
5a7886f [CloverHearts] fix sio support
afb9db7 [CloverHearts] Merge branch 'master' into workflow
3ed556c [CloverHearts] remove debug console message.
3d34f9e [CloverHearts] Implement getParagraphRunner transaction.
2523238 [CloverHearts] Implement eventForWait class
0570ae8 [CloverHearts] add remote works controller class and include interpreter factory
6e1f219 [CloverHearts] code base workflow for remote zeppelin server control default thrift transaction.
2016-11-29 08:07:15 -08:00
Anthony Corbacho
33e2dab37e [ZEPPELIN-1690] - ZeppelinHubNotebookRepo multy user handling
### What is this PR for?
 This PR bring multi user handling to ZeppelinHubNotebookRepo.

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

### What is the Jira issue?
 * [ZEPPELIN-1690](https://issues.apache.org/jira/browse/ZEPPELIN-1690)

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

Author: Anthony Corbacho <corbacho.anthony@gmail.com>

Closes #1635 from anthonycorbacho/feat/ZeppelinHubRepoMultiUser and squashes the following commits:

d9e0036 [Anthony Corbacho] Move code location
d8989aa [Anthony Corbacho] Handle invalid subject
aef6e00 [Anthony Corbacho] Fix check style
edb9e8c [Anthony Corbacho] Desactivate ws :: we will need to refactor this part
e884203 [Anthony Corbacho] Refactor :: remove 'async' on every http call
dbb8ebd [Anthony Corbacho] Fix test
25f6215 [Anthony Corbacho] pass user token to zeppelinhub rest api handler
674fb93 [Anthony Corbacho] Refactor ZeppelinHub rest API handler  - Now takes a token on every http request
3fbfcfa [Anthony Corbacho] Add new login on how user can get his token at runtime
a8aeb51 [Anthony Corbacho] add comment in zeppelinhubRealm about saving user session in a singleton map
5931ab6 [Anthony Corbacho] Fix check style
67051a0 [Anthony Corbacho] Add ZeppelinHub instance model
e3e5a15 [Anthony Corbacho] Add userTiket in AuthenticationInfo on OnMessage method in notebookServer
7a0c959 [Anthony Corbacho] Add zeppelinhub user session to userSession container after login throght zeppelinhubRealm
0729f51 [Anthony Corbacho] Add zeppelinhub session container
2016-11-24 20:56:17 +09:00
1ambda
3389e8cfcb [ZEPPELIN-1666] DON'T share mutable deps, options between interpreters in each group (bug)
### What is this PR for?

Every interpreter shares their `List<Dependency>` and `InterpreterOption` object with other interpreters in the same group since these objects are mutable and just returned from `InterpreterSettingRef` in InterpreterFactory.

I attached GIF

### What type of PR is it?
[Bug Fix]

### Todos

Nothing

### What is the Jira issue?

[ZEPPELIN-1666](https://issues.apache.org/jira/browse/ZEPPELIN-1666)

### How should this be tested?

I included unit test for it in `InterpreterRestApiTest.testCreatedInterpreterDependencies`.
You can reproduce and debug this by checking out commit 3acde56 and run the unit test.

If you try to debug, you can see the length of `List<Dependency>` in `md` `InterpreterSettingRef` is increased whenever creating a new interpreter setting. But it shouldn't be.

### Screenshots (if appropriate)

![duplicated_interpreter_params](https://cloud.githubusercontent.com/assets/4968473/20308094/ceeeae70-ab85-11e6-9a8e-da5bb539a03b.gif)

### 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 #1638 from 1ambda/fix/do-not-share-deps-in-same-group and squashes the following commits:

e95297c [1ambda] fix: Styling issue in zengine
7825108 [1ambda] fix: mutable object problems in InterpreterSetting
5460241 [1ambda] fix: Return immutable objects
3acde56 [1ambda] test: Add failing test
2016-11-24 18:33:15 +09:00
1ambda
abe03a866f [ZEPPELIN-1667] Fix maven options while updating node, npm packages
### What is this PR for?

Update maven plugin, node vesion, npm package and fix tests to make #1639 pass CI

### What is the Jira issue?

Sub issue of #1639

### Questions:

Does the licenses files need update? NO
Is there breaking changes for older versions? YES (front-end build tool usage changed)
Does this needs documentation? YES (front-end build tool usage changed)

Author: 1ambda <1amb4a@gmail.com>

Closes #1659 from 1ambda/pr/1639 and squashes the following commits:

e5b414b [1ambda] docs: Add a package installation command
d8c9d36 [1ambda] docs: Update zeppelin-web/README.md
f0fcdff [1ambda] feat: Add start script to package.json
a2aab1f [1ambda] fix: Remove useless script
5cdd813 [1ambda] fix: Print warn, error log only while packing
5e1e746 [1ambda] fix: Caching npm, bower, node directories
ac40b56 [1ambda] test: fix test for jasmine-core 2.x
ded1f2c [1ambda] chore: Update karma, phantom related package version
6bb52cc [1ambda] chore: Add slient option to bower (show error only)
ca2359c [1ambda] fix: Restore bower install option
4c26211 [1ambda] chore: Update node, npm version to avoid proxy error
e085809 [1ambda] chore: Remove bower install root option
488092a [1ambda] chore: fix travis maven option
668a687 [1ambda] chore: Set maven option using mavenrc
f42531a [1ambda] chore: Update assembly plugin version
532f1e6 [1ambda] fix(web): npm tasks in pom.xml
6568960 [1ambda] chore: Add test, build task to npm
314dcd8 [1ambda] chore: Update frontend plugin version
2016-11-23 20:58:08 +09:00
Mina Lee
4dd36bfa31 [ZEPPELIN-1623] Fix flaky test - testEditOnDoubleClick
### What is this PR for?
#1657 is merged, but CI failure still exists on master. Check [this link](https://issues.apache.org/jira/browse/ZEPPELIN-1623) to see the test failure.
I will trigger this PR 5 times and attach CI link on comments if all of them pass to be sure that the issue is gone.

### What type of PR is it?
Hot Fix

### What is the Jira issue?
[ZEPPELIN-1623](https://issues.apache.org/jira/browse/ZEPPELIN-1623)

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

Author: Mina Lee <minalee@apache.org>

Closes #1667 from minahlee/ZEPPELIN-1623 and squashes the following commits:

ba750a4 [Mina Lee] Fix testEditOnDoubleClick flaky test
2016-11-22 15:04:24 +01:00
karuppayya
1375379a28 ZEPPELIN-1653: Make UI responsive
### What is this PR for?
When we do the following operations, the entire notebook is transmitted back to client.
1) Insert paragraph
2) Remove paragraph
3) Update paragraph
4) Paragraph status update
5) commit paragraph
When the json becomes larger(which happens when large  output is stored in the json), the time to transfer the notebook to client is directly proportional.(we can check this in chrome browser-> dev console-> select ws request-> on the right pane that opens, select frames tab and observe the length column)

And since the UI update is based on this new transmitted json, the UI seems unresponsive/laggy.
In this PR, Making the updates selective.(Not sending the complete json back to client)

### What type of PR is it?
Improvement

### Todos
NA

### What is the Jira issue?
ZEPPELIN-1653

### How should this be tested?

-In chrome browser-> dev console-> select ws request-> on the right pane that opens, select frames tab and observe  *NOTE* message.
We should not see the message for the above mentioned operations except when the notebook is loaded is for first time
-    We should not see *GET_NOTE* log message for above operations.

### Screenshots
NA

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

Author: karuppayya <karuppayya1990@gmail.com>
Author: Karup <karuppayya@outlook.com>

Closes #1624 from karup1990/ZEPPELIN-1653 and squashes the following commits:

bbdfc9a [karuppayya] Address review comments
4cd9dcd [karuppayya] fix lookandfeel config
c99383a [Karup] Refactor code , dont broadcast note
2016-11-21 08:30:15 -08:00
Lee moon soo
f6995738af [ZEPPELIN-1623] Fix flaky test - ParagraphActionsIT.testEditOnDoubleClick
### What is this PR for?
Fix flaky test - ParagraphActionsIT.testEditOnDoubleClick

Before send the keyevent, make sure textarea is displayed.

### What type of PR is it?
Bug Fix

### Todos
* [x] - wait for textarea ready

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

### 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 #1657 from Leemoonsoo/ZEPPELIN-1623 and squashes the following commits:

6ff9d44 [Lee moon soo] Wait until textarea available
2016-11-21 08:27:56 -08:00
gss2002
8aad9ea392 ZEPPELIN-1472 - Create new LdapRealm based on Apache Knox LdapRealm: Provides LdapRealm Functionality similar to Apache Knox
### What is this PR for?
ZEPPELIN-1472 - Create new LdapRealm based on Apache Knox LdapRealm: Provides LdapRealm Functionality similar to what Apache Knox provides. This is critical as in large enterprise environments Active Directory Global Catalogs are used for lookup with samAccountName and using a DN Template is not an option as their are multiple OUs. Also searching on "userPrincipalName" is risky in an AD environment since the explicit UPN vs Implicit UPN can be different this is definitely the case with environments using Office 365. And the LDAP userPrincipalName attribute is the explicit UPN which can be defined by the directory administrator to any value and it can be duplicated. SamAccountName is unique per domain and Microsoft states best practice is to not allow duplicate samAccountName's across the forest.

In addition to the above changes I have adjusted and moved the LdapGroupRealm and ActiveDirectoryGroupRealm into the org.apache.zeppelin.realm package structure to make all Realm's consistent.

The LdapRealm class also works with role to group mapping for usage within Zeppelin for notebook authorization.

I have adjusted SecurityUtils to use ClassName vs realmName in determining what to use as you may have companies that decide to use their own custom realmname in shiro.ini and may not realize you cannot so using className is much safer.

Example - SecurityUtils
        String name = realm.getClass().getName();
        if (name.equals("org.apache.shiro.realm.text.IniRealm")) {
          allRoles = ((IniRealm) realm).getIni().get("roles");
          break;
        } else if (name.equals("org.apache.zeppelin.realm.LdapRealm")) {
          allRoles = ((LdapRealm) realm).getListRoles();
          break;
        }

Example - SecurityRestApi:
          String name = realm.getClass().getName();
          if (LOG.isDebugEnabled()) {
            LOG.debug("RealmClass.getName: " + name);
          }
          if (name.equals("org.apache.shiro.realm.text.IniRealm")) {
            usersList.addAll(getUserListObj.getUserList((IniRealm) realm));
            rolesList.addAll(getUserListObj.getRolesList((IniRealm) realm));
          } else if (name.equals("org.apache.zeppelin.realm.LdapGroupRealm")) {
            usersList.addAll(getUserListObj.getUserList((JndiLdapRealm) realm, searchText));
          } else if (name.equals("org.apache.zeppelin.realm.LdapRealm")) {
            usersList.addAll(getUserListObj.getUserList((LdapRealm) realm, searchText));
            rolesList.addAll(getUserListObj.getRolesList((LdapRealm) realm));
          } else if (name.equals("org.apache.zeppelin.realm.ActiveDirectoryGroupRealm")) {
            usersList.addAll(getUserListObj.getUserList((ActiveDirectoryGroupRealm) realm,
                searchText));
          } else if (name.equals("org.apache.shiro.realm.jdbc.JdbcRealm")) {
            usersList.addAll(getUserListObj.getUserList((JdbcRealm) realm));
          }

Please see feedback from previous PRs related to this JIRA:
https://github.com/apache/zeppelin/pull/1513

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

### Todos
* [ ] - Task

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

### How should this be tested?
Update shiro.ini to use configuration similar to below:
# Sample LDAP configuration, for user Authentication, currently tested for single Realm
[main]
ldapADGCRealm = org.apache.zeppelin.realm.LdapRealm
ldapADGCRealm.contextFactory.systemUsername = CN=hdplookup,OU=hadoop,DC=hdpusr,DC=senia,DC=org
ldapADGCRealm.contextFactory.systemPassword = ldapBindPassword
ldapADGCRealm.searchBase = dc=hdpusr,dc=senia,dc=org
ldapADGCRealm.userSearchBase = dc=hdpusr,dc=senia,dc=org
ldapADGCRealm.groupSearchBase = dc=hdpusr,dc=senia,dc=org
ldapADGCRealm.authorizationEnabled = true
ldapADGCRealm.contextFactory.url = ldap://seniadc1.hdpusr.senia.org:3268
ldapADGCRealm.userSearchAttributeName = sAMAccountName
ldapADGCRealm.contextFactory.authenticationMechanism = simple
ldapADGCRealm.groupObjectClass = group
ldapADGCRealm.memberAttribute = member
ldapADGCRealm.rolesByGroup = hdpeng: admin, \
 hadoopusers: user

securityManager.realms = $ldapADGCRealm

sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager

### If caching of user is required then uncomment below lines
#cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
#securityManager.cacheManager = $cacheManager

securityManager.sessionManager = $sessionManager
# 86,400,000 milliseconds = 24 hour
securityManager.sessionManager.globalSessionTimeout = 86400000
shiro.loginUrl = /api/login

[roles]
# 'admin' role has all permissions, indicated by the wildcard '*'
admin = *
user = *

[urls]
# anon means the access is anonymous.
# authcBasic means Basic Auth Security
# authc means Form based Auth Security
# To enfore security, comment the line below and uncomment the next one
#/api/version = anon
#/** = anon
/api/interpreter/** = authc, roles[admin]
/api/configurations/** = authc, roles[admin]
/api/credential/** = authc, roles[admin]
/api/login = authc
/api/login/logout = authc
/api/security/ticket = authc
/** = authc, roles[admin, user]

### Screenshots (if appropriate)

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

merge latest commits

Author: gss2002 <greg@senia.org>
Author: gss2002 <gsenia@apache.org>

Closes #1614 from gss2002/ZEPPELIN-1472 and squashes the following commits:

d6a7cea [gss2002] ZEPPELIN-1472 - LdapRealm Additions based on Knox LdapRealm and support of using roles with LdapRealms. Also adjusted to use className and not actual name of the realm in shiro.ini. As using realmName in code could cause problems for people who want to use alternate names. Also migrated the LdapGroupRealm and ActiveDirectoryRealm to org.apache.zeppelin.realm packages per a recommendation.
1702cc5 [gss2002] Merge pull request #1 from apache/master
2016-11-20 23:21:04 +01:00
Mina Lee
85c50a8aba [ZEPPELIN-1622] Remove %dep interpreter deprecated message
### What is this PR for?
%dep interpreter was going to be deprecated, but we had feedback from many users that this feature provide different advantage over dependency loading via GUI so we want to keep supporting it. This PR remove deprecated message when users use %dep interpreter.

### Todos
- [x] Fix test

### What type of PR is it?
Documentation

### What is the Jira issue?
[ZEPPELIN-1622](https://issues.apache.org/jira/browse/ZEPPELIN-1622)

### How should this be tested?
Run %dep interpreter such as `z.load('/your/library.jar)` and see if deprecated message is gone.

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

Author: Mina Lee <minalee@apache.org>

Closes #1605 from minahlee/ZEPPELIN-1622 and squashes the following commits:

b604c4c [Mina Lee] Add %dep z.load integration test
e3ae4c8 [Mina Lee] Remove %dep interpreter deprecated message
2016-11-20 08:13:25 -08:00
1ambda
e33be25256 [ZEPPELIN-1684] Add GET /interpreter/setting/id REST API
### What is this PR for?

Due to the lack of this missing API, some front-end code retrieve all settings. This is inefficient.
We can modify those codes by adding this API.

Also, i refactored the whole `InterpreterRestApiTest`

### What type of PR is it?
[Feature | Documentation | Refactoring]

### What is the Jira issue?
[ZEPPELIN-1684](https://issues.apache.org/jira/browse/ZEPPELIN-1684)

### How should this be tested?

You can run unit test `InterpreterRestApiTest`

### Screenshots (if appropriate)

Updated doc screenshots

<img width="900" alt="new_api_doc" src="https://cloud.githubusercontent.com/assets/4968473/20423419/74eeb2a0-adb3-11e6-9a69-58e33457d514.png">

### Questions:
* Does the licenses files need update? - NO
* Is there breaking changes for older versions? - NO
* Does this needs documentation? - YES, but done.

Author: 1ambda <1amb4a@gmail.com>

Closes #1655 from 1ambda/feat/create-interpreter-get-api and squashes the following commits:

89ff7fd [1ambda] style: Apply zeppelin checkstyle xml
c901287 [1ambda] docs: Add new api to rest-interpreter.html
2641a73 [1ambda] refactor: InterpreterRestApiTest
e63c80e [1ambda] refactor: testSettingsCRUD
9bc24fd [1ambda] feat: Add /interpreter/setting/id API and test
2016-11-20 08:02:12 -08:00
Anthony Corbacho
5e85e6ea6f [ZEPPELIN-1610] - Add notebook watcher
### What is this PR for?
Add a Simple way to switch a websocket connection to a new state; watcher.
A websocket watcher is a special connection that will watch most of the web socket even in Zeppelin, this cam be used to monitor zeppelin server activity.

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

### Todos
* [x] - Add watcher Queue
* [x] - Add endpoint to switch from regular client to watcher
* [x] - Add a way to generate a uniq key when zeppelin server restart
* [x] - Add example on how to use watcher.

### What is the Jira issue?
* [ZEPPELIN-1610](https://issues.apache.org/jira/browse/ZEPPELIN-1610)

### How should this be tested?
You will have to create your own websocket client and provide a valid http header (`X-Watcher-Key`) when you connect to zeppelin ws
 something like
```
private Session openWatcherSession() {
    ClientUpgradeRequest request = new ClientUpgradeRequest();
    request.setHeader(WatcherSecurityKey.HTTP_HEADER, WatcherSecurityKey.getKey());
    WatcherWebsocket socket = WatcherWebsocket.createInstace();
    Future<Session> future = null;
    Session session = null;
    try {
      future = wsClient.connect(socket, zeppelinWebsocketUrl, request);
      session = future.get();
    } catch (IOException | InterruptedException | ExecutionException e) {
      LOG.error("Couldn't establish websocket connection to Zeppelin ", e);
      return session;
    }
    return session;
  }
```

### Screenshots (if appropriate)

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

Author: Anthony Corbacho <corbacho.anthony@gmail.com>

Closes #1588 from anthonycorbacho/feat/updateWebsocketInZeppelinHubRepo and squashes the following commits:

26cf53f [Anthony Corbacho] Move broadcastToWatcher
8413e9b [Anthony Corbacho] Remove redundant broadcast
fb2c260 [Anthony Corbacho] Remove TODO in socket/Message
716c92c [Anthony Corbacho] Fix checkstyle
a10ba13 [Anthony Corbacho] Add remove connection from note back in test
89d70f2 [Anthony Corbacho] fix test
092791e [Anthony Corbacho] Light refactoring :: add missing header, add comment, refacto some methods
8f7e1b3 [Anthony Corbacho] Add X-Watcher-Key in request header for watcher client
e2d3053 [Anthony Corbacho] Add simple check for ws before switching ws client to watcher, client should provide a header X-Watcher-Key with a valid key (generated at runtime), if key invalid client wont be accepted
e25ea1e [Anthony Corbacho] Add simple Key generation for Watcher ws client
4affe25 [Anthony Corbacho] Handle remoing wssession from notebook map once the session is close :: avoiding socket connection to be ide
c32192a [Anthony Corbacho] rework watcher creation and ws session with notes
3bd3482 [Anthony Corbacho] Reorder import :: Google check style
bde5db4 [Anthony Corbacho] Update ping routine
ede1f18 [Anthony Corbacho] make private field public for accessibility
aa55a5a [Anthony Corbacho] Strting to rework ZeppelinClient
e5b3a1d [Anthony Corbacho] Add zeppelinhub notebook watcher
9d6c93f [Anthony Corbacho] Add new OP watcher
0d7f493 [Anthony Corbacho] Added new WS queue called watcher, watcher will be abler to listen to almost every note action performed in zeppelin notebook websocket server
45849ce [Anthony Corbacho] Add new message type :: Watcher message, this class will wrapp zeppelin ws message and add extra information such as noteId and user
2016-11-16 13:30:42 -08:00
1ambda
ab2cdfd384 [ZEPPELIN-1614] Remove markdown4j dep
### What is this PR for?

Remove unmanaged, old library markdown4j dep which exists just for Websequence and YUML plugins.
(related to https://github.com/apache/zeppelin/pull/1384)

By adding Websequence and YUML plugins to pegdown

- Removing markdown4j dependency which is unmanaged library currently.
- Addtionally, we can remove `markdown.parser.type` options in **markdown interpreter**
- Fixing some bugs in Websequence and YUML plugins
- Enable others to add more plugins using pegdown sytnax.

### What type of PR is it?

Improvement

### Todos

Nothing

### What is the Jira issue?

[JIRA - ZEPPELIN-1614](https://issues.apache.org/jira/browse/ZEPPELIN-1614)

### How should this be tested?

Some functional tests are included.

### Screenshots (if appropriate)

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

Author: 1ambda <1amb4a@gmail.com>

Closes #1594 from 1ambda/feat/remove-markdown4j-dep and squashes the following commits:

5af1607 [1ambda] fix: Failed tests in InterpreterRestApiTest
c57fdcb [1ambda] docs: Update markdown.md
5c62236 [1ambda] docs: Update upgrade.md for '%md'
a1e779d [1ambda] style: Use zeppelin checkstyle.xml
13e0dc4 [1ambda] Update: interpreter setting and docs
de3549d [1ambda] chore: Cleanup duplicated markdown4j license
7c5d41e [1ambda] fix: Parse style param optionally in webseq
8831ca1 [1ambda] fix: Wrap exceptions in catch stmt
9268695 [1ambda] Revert "fix: Cleanup unused Markdown4j Parser"
33fb800 [1ambda] Revert "docs: Remove markdown.parser.type option"
fddc459 [1ambda] Revert "chore: Remove markdown4j dep and update license"
a59ebbd [1ambda] Revert "fix: Set {} to avoid 503"
4e48933 [1ambda] Revert "fix: Parse style param optionally in webseq"
8cfb2c8 [1ambda] Revert "fix: style and misspell in docs"
73956e0 [1ambda] Revert "fix: Propagate exception in YUML plugin"
1b7787f [1ambda] fix: Propagate exception in YUML plugin
c656d08 [1ambda] fix: style and misspell in docs
dc4f110 [1ambda] fix: Parse style param optionally in webseq
b43e14e [1ambda] fix: Set {} to avoid 503
c48cc53 [1ambda] chore: Remove markdown4j dep and update license
81fdfcc [1ambda] docs: Remove markdown.parser.type option
cf19f0b [1ambda] fix: Cleanup unused Markdown4j Parser
98b2809 [1ambda] fix: Add missing docs
3e9716d [1ambda] feat: Yuml markdown plugin
3247c67 [1ambda] feat: Support webseq markdown plugin
2016-11-16 05:31:45 +01:00
karuppayya
96ca84da15 ZEPPELIN-1643:Make spark web UI accesible from interpreters page
### What is this PR for?
Make spark web UI accesible from interpreters page

### What type of PR is it?
Improvement

### Todos
NA

### What is the Jira issue?
ZEPPELIN-1643

### How should this be tested?
Start sparkcontext.
Goto interpreters page. Corresponding to the spark interpreter used in notebook, there will be *spark ui* button.
Clicking the button should open a new tab with the application's spark web UI.

### Screenshots (if appropriate)
![zscpr58qdi](https://cloud.githubusercontent.com/assets/5082742/20110797/c6852202-a60b-11e6-8264-93437a58f752.gif)

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

Author: karuppayya <karuppayya1990@gmail.com>
Author: Karup <karuppayya@outlook.com>

Closes #1613 from karup1990/ZEPPELIN-1643 and squashes the following commits:

29e9812 [karuppayya] Fix checkstyle
350d665 [karuppayya] Fix coding err
42dde76 [Karup] Fix typo
5cfed2a [karuppayya] Fix test failure
55c45c9 [karuppayya] Address feedback
4d97196 [karuppayya] Remove comments
a1304a2 [karuppayya] Change to make spark web UI accesible from interpreters page
2016-11-15 08:41:59 -08:00
Khalid Huseynov
6069a083af [ZEPPELIN-1647] Save roles and use for broadcasting note list per user
### What is this PR for?
So far roles have been accessible only from SecurityUtils for Rest api or from websocket message field. However sometimes it's required to access roles in websocket server even without receiving message, say for broadcasting note list per user. More details in issue.

### What type of PR is it?
Bug Fix | Improvement

### Todos
* [x] - add roles in NotebookAuthorization
* [x] - assign roles on login
* [x] - use roles on broadcast
* [x] - test

### What is the Jira issue?
[ZEPPELIN-1647](https://issues.apache.org/jira/browse/ZEPPELIN-1647)

### How should this be tested?
login as user1, and user2 at same time and each user should have own workbench (based on notebook permissions)

### Screenshots (if appropriate)
TBD

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

Author: Khalid Huseynov <khalidhnv@gmail.com>

Closes #1619 from khalidhuseynov/fix/apply-correct-roles-broadcast and squashes the following commits:

490c4d0 [Khalid Huseynov] add roles functionality test
260adbb [Khalid Huseynov] remove unused import
d7df363 [Khalid Huseynov] bugfix: pass userAndRoles instead of roles
85be8b7 [Khalid Huseynov] change arg HashSet -> Set
1baa549 [Khalid Huseynov] set roles on login
83dd249 [Khalid Huseynov] use correct roles in broadcast
4bd7169 [Khalid Huseynov] add roles in NotebookAuthorization
2016-11-14 11:05:06 -08:00
Jun
c1254f7b0d [ZEPPELIN-1628] Enable renaming note from the main page
### What is this PR for?
Now users can rename a note from the main page! This new feature will improve UX.

I divided [ZEPPELIN-1598](https://issues.apache.org/jira/browse/ZEPPELIN-1598) into sub-tasks since renaming folder gonna be huge. I will open PR for [ZEPPELIN-1629](https://issues.apache.org/jira/browse/ZEPPELIN-1629) after merging this PR.

By the way, I have a question! Does a `writer` can rename a note? Currently, only an owner can rename a note.

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

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

### Screenshots (if appropriate)
![rename_note](https://cloud.githubusercontent.com/assets/8201019/20057051/a16b221c-a52c-11e6-900e-f88031ff1246.gif)

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

Author: Jun <i2r.jun@gmail.com>

Closes #1609 from tae-jun/ZEPPELIN-1628 and squashes the following commits:

7d3f7bb [Jun] Fix factory/noteList.js test errors.
54bae60 [Jun] Add rename modal input validation
3eadcd8 [Jun] Add folder id
fb8b35f [Jun] Correct indent to pass style check
c019b9e [Jun] Rename a note from the main page
2016-11-13 06:55:10 -08:00
Mina Lee
24187b0a75 [ZEPPELIN-1029] Add rest api for paragraph config update
### What is this PR for?
This PR adds new end point for updating paragraph configuration

### What type of PR is it?
Improvement | Documentation

### What is the Jira issue?
[ZEPPELIN-1029](https://issues.apache.org/jira/browse/ZEPPELIN-1029)

### How should this be tested?
Outline the steps to test the PR here.

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

Author: Mina Lee <minalee@apache.org>

Closes #1592 from minahlee/ZEPPELIN-1029 and squashes the following commits:

c8357ca [Mina Lee] Add rest api for paragraph config update
2016-11-09 10:04:32 -08:00
hkropp
f866d234a1 [Zeppelin-1611] - Support PAM (System User) Authentication
### What is this PR for?
This PR adds [PAM](https://en.wikipedia.org/wiki/Pluggable_authentication_module) authentication support based on the introduced Shiro security implementation. With PAM support system users have immediate access to a secured Zeppelin instance.

### What type of PR is it?
Feature

### Todos
* [x] - Create PAM realm
* [x] - Create test for PAM authentication
* [x] - Test with running Zeppelin instance

### What is the Jira issue?
[ZEPPELIN-1611](https://issues.apache.org/jira/browse/ZEPPELIN-1611])

### How should this be tested?
`PamRealmTest` executes an automated test if the environment variables `PAM_USER` and `PAM_PASS` are set. This should be set to system username and password.
The test also includes a main function to manually execute the test. Setting the environment variables for example on MacOS for your IDE use `launchctl setenv PAM_USER user` and `launchctl setenv PAM_PASS xxxxx`, the test can then be run from your IDE.

### Screenshots (if appropriate)

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

Author: hkropp <hkropp@hortonworks.com>

Closes #1589 from hkropp/ZEPPELIN-1611 and squashes the following commits:

bc01862 [hkropp] [Zeppelin-1611] - Support PAM (System User) Authentication
2016-11-08 07:21:36 -08:00
Anthony Corbacho
cb175032a2 [HOT-FIX] - Prevent double injection of cross-origin headers from rest api
### What is this PR for?
Prevent error `XMLHttpRequest cannot load http://localhost:8080/api/version. The 'Access-Control-Allow-Origin' header contains multiple values 'http://localhost:9000, http://localhost:9000', but only one is allowed. Origin 'http://localhost:9000' is therefore not allowed access`

### What type of PR is it?
[Hot Fix]

Author: Anthony Corbacho <corbacho.anthony@gmail.com>

Closes #1604 from anthonycorbacho/fix/DoubleOriginInjectionInResponseHeader and squashes the following commits:

b898f85 [Anthony Corbacho] Prevent double injection of cross-origin headers from rest api
2016-11-05 16:26:13 +09:00
Mina Lee
dd20e7bf8b [ZEPPELIN-1564] Enable note deletion and paragraph output clear from main page
### What is this PR for?
- Enables removing note and clear all paragraph's output from Zeppelin main page.
- Add rest api for clearing all paragraph output

Next possible improvement can be removing notes in folder level and rename folder.

### What type of PR is it?
Improvement

### Todos
* [x] - Merge #1567 and apply security to `clearAllParagraphOutput` rest api method

### What is the Jira issue?

[ZEPPELIN-1564](https://issues.apache.org/jira/browse/ZEPPELIN-1564)
### Screenshots (if appropriate)

![oct-27-2016 18-26-03](https://cloud.githubusercontent.com/assets/8503346/19761938/e013ea02-9c72-11e6-9a08-0a70aca145d2.gif)
### Questions:
- Does the licenses files need update? no
- Is there breaking changes for older versions? no
- Does this needs documentation? yes

Author: Mina Lee <minalee@apache.org>

Closes #1565 from minahlee/ZEPPELIN-1564 and squashes the following commits:

749aebe [Mina Lee] Merge branch 'master' of https://github.com/apache/zeppelin into ZEPPELIN-1564
1393ee9 [Mina Lee] Rename class name from UnauthorizedException to ForbiddenException Update clear output rest api doc response code
2ee452e [Mina Lee] Add auth check before clearing all paragraph
fb7e6ae [Mina Lee] Merge branch 'master' of https://github.com/apache/zeppelin into ZEPPELIN-1564
f349dbf [Mina Lee] Change post to put
7eb3521 [Mina Lee] Give writer permission to clear output
dea3ef6 [Mina Lee] Remove unused import
d66600c [Mina Lee] Add rest api endpoint for clear paragraph result to document
3d19141 [Mina Lee] Add rest api for clear all paragraph result and add test
98d7604 [Mina Lee] Add clearAllParagraphOutput unit test
4adddb4 [Mina Lee] Clear all paragraphs and remove note from main page
2016-11-05 13:41:11 +09:00
Anthony Corbacho
0e087455af [ZEPPELIN-1615] - Zeppelin should be able to run without Shiro
### What is this PR for?
Right now, Zeppelin use Shiro by default even if you dont need it.
(It will use shiro.ini.template file if it doenst find shiro.ini), this behaviors is a little flacky and we should start zeppelin without shiro context if user doenst want to use it.

### What type of PR is it?
[Bug Fix | Improvement ]

### Todos
* [x] - Update configuration - Return empty if shiro file not found
* [x] - refactor Rest Api handler, if shiro.ini not found start a handler without shiro context
* [x] - refactor SecurityUtils to handle the case of shiro is disabled.

### What is the Jira issue?
 * [ZEPPELIN-1615](https://issues.apache.org/jira/browse/ZEPPELIN-1615)

### How should this be tested?
Start zeppelin without shiro.ini

### 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: Anthony Corbacho <corbacho.anthony@gmail.com>

Closes #1595 from anthonycorbacho/fix/ShiroTempleteLoginRequired and squashes the following commits:

c163bd8 [Anthony Corbacho] Handle the case of user already have a shiro ini :: backup current ini and perform tests then restaure
608e718 [Anthony Corbacho] Fix AuthenticationIT Test by creating shiro.ini file in conf.
73ce69a [Anthony Corbacho] Fix SecurityRestApiTest test
4c67e8f [Anthony Corbacho] Handle SecurityUtils, if shiro is disabled then script all the getPrincipla and shiro check and return anon or empty collections in certain case
f67f82e [Anthony Corbacho] Handle the case of user want to start zeppelin without Shiro  - Refactor handler, if not shiro ini foundm start zeppelin wihtout shiro
09387ce [Anthony Corbacho] Rework getShiroIni in zeppelinConfiguration, if shiro.ini file is not found, then return empty instead of shiro.ini.template path
2016-11-05 12:48:10 +09:00
Kavin
f1e9c52087 [Zeppelin-53] Broken newly created Notebook if there is no permissions to mkdir on disk
### What is this PR for?

Error message should be shown to the user when there is permission issue with the 'notebook' storage folder.
### What type of PR is it?

Bug Fix
### Todos

NA
### What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-53
### How should this be tested?
- Create the notebook storage folder (i.e zeppelin/notebook) with only read and execute permission
- Try to create a notebook from UI
- The below error message as in the screenshot should be rendered
### Screenshots (if appropriate)

![zeppelin-53](https://cloud.githubusercontent.com/assets/20789766/19468248/f394f0b8-9532-11e6-86d9-89a63fa6106a.png)
### Questions:
- Does the licenses files need update? No
- Is there breaking changes for older versions? No
- Does this needs documentation? No

Author: Kavin <kavin.kumar@imaginea.com>

Closes #1535 from kavinkumarks/zeppelin-53-create-notebook-mkdir-issue and squashes the following commits:

de7c937 [Kavin] Show error message to the user when there is permission issue on creating notebook.
2016-11-03 09:44:55 -07:00
CloverHearts
55de3fba71 [hotfix] does not showing notebooklist on navbar
### What is this PR for?
Currently, if you enabled for shiro then
not showing notebook list on navbar.
(If you refresh, it's well viewwing.)
i resolve this problem.

### What type of PR is it?
Bug Fix

### Todos
- [x] fixed a bug ( navbar.controller.js)
- [x] added testcase

### How should this be tested?
1. endabled shiro (per user login)
2. login.
3. on click to notebook menu on navbar.

### Screenshots (if appropriate)
#### before
![navbar_pr](https://cloud.githubusercontent.com/assets/10525473/19957865/b112d8c4-a1dd-11e6-9f0c-363919b321d8.png)

#### resolve after (on this pr)
![correct](https://cloud.githubusercontent.com/assets/10525473/19957885/d487ad16-a1dd-11e6-81b0-ebd210bd6f98.png)

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

Author: CloverHearts <cloverheartsdev@gmail.com>

Closes #1586 from cloverhearts/ZEPPELIN-NOTEBOOKLIST-SHIRO and squashes the following commits:

1a9aec9 [CloverHearts] remove console log
0378d76 [CloverHearts] fixed test case throws exception
72ff950 [CloverHearts] fixed notebook list count testcase in AuthIT
27451a4 [CloverHearts] bug fixed can't load for notebook list when enabled shiro
2016-11-03 18:37:27 +09:00
Anthony Corbacho
32fe23f2e2 [ZEPPELIN-1586] Add security check in NotebookRestApi
### What is this PR for?

Bring some security check in `NotebookRestApi`.
### What type of PR is it?

[Bug Fix | Improvement | Refactoring]
### Todos
- [x] - Create a proper way to throw webapp error
- [x] - Add in `NotebookAuthorization` some method to check if user is owner, reader or writer
- [x] - Add Authorization check in `NotebookRestapi`
- [x] - Add New test for security in notebook rest api

### What is the Jira issue?
- [ZEPPELIN-1586](https://issues.apache.org/jira/browse/ZEPPELIN-1586)
### How should this be tested?

First, force Zeppelin to use auth.
- In `conf/zeppelin-site.xml` change `zeppelin.anonymous.allowed` to **false**

  ```
  <property>
  <name>zeppelin.anonymous.allowed</name>
  <value>false</value>
  <description>Anonymous user allowed by default</description>
  </property>
  ```
- In `conf/shiro.ini` set Shiro to use `Auth` at the end of the file

  ```
  #/** = anon
  /** = authc
  ```
- Start Zeppelin, login and set some permission to a note
- try to get a note from Zeppelin Rest Api `http://localhost:8080/api/notebook/{noteId}` (you can use your browser or curl (if you use curl please add shiro token to curl cookie))
### Screenshots (if appropriate)

![note_permission_rest_api](https://cloud.githubusercontent.com/assets/3139557/19827600/ffd68a06-9dea-11e6-8dd5-43f3bd401011.gif)
### Questions:
- Does the licenses files need update? No
- Is there breaking changes for older versions? No
- Does this needs documentation? Maybe

Author: Anthony Corbacho <corbacho.anthony@gmail.com>

Closes #1567 from anthonycorbacho/fix/ZEPPELIN-1586 and squashes the following commits:

6615935 [Anthony Corbacho] Clean anonymous allowed property when shutting down zeppelin server
30815c1 [Anthony Corbacho] Fix typo
bab7e60 [Anthony Corbacho] Rewording
decd1e9 [Anthony Corbacho] Simple implementation of notebook test with shiro (security)
b412266 [Anthony Corbacho] Refactored Abstract rest api test to also handle the case of tests with shiro (security), I also added some utility http method to do action with authenticated user
db0c39c [Anthony Corbacho] Adress review and fix typos
eacfa8e [Anthony Corbacho] Fix typo and bad copy paste for isOwner
c8c42b2 [Anthony Corbacho] Change cxf version from 2.7.7 to 2.7.8 to avoid method not found where throw WebAppException
ed404a4 [Anthony Corbacho] Rename permission check note :: be more meaningful
6030776 [Anthony Corbacho] Handle security check
fe380ab [Anthony Corbacho] Add webapp exception handler :)
21f9288 [Anthony Corbacho] Replace check of aninonimous by method
0e4cc3c [Anthony Corbacho] Add new method to check if user and roles are member of the note (at least owner, reader, writer)
da3415f [Anthony Corbacho] Add new method to help to determinate if user is part of writer and/or owner for the given note
4a43b07 [Anthony Corbacho] Add new method on ZeppelinConfiguration to get is zeppelin is running on anonimous mode or not
2016-11-03 15:16:14 +09:00
Mina Lee
28adacb9c8 [ZEPPELIN-1461] Doesn't display "description" value in interpreter creation page
### What is this PR for?
#1522 tried to fix same issue by making as least change as possible, but fixing it in backend side looks like more proper approach as https://github.com/apache/zeppelin/pull/1522#issuecomment-255109922.

This PR fixes ZEPPELIN-1461 by changing `properties` field of `InterpreterSetting` class from `Properties` -> `Object`.
### What type of PR is it?

Bug Fix
### What is the Jira issue?

[ZEPPELIN-1461](https://issues.apache.org/jira/browse/ZEPPELIN-1461)
### Screenshots (if appropriate)

Before
![screen shot 2016-10-24 at 8 42 02 pm](https://cloud.githubusercontent.com/assets/8503346/19644395/5d20a864-9a2a-11e6-806a-8a44e44a108a.png)

After
![screen shot 2016-10-24 at 8 37 17 pm](https://cloud.githubusercontent.com/assets/8503346/19644281/d72be1ce-9a29-11e6-9b67-6d5de263b0de.png)
### Questions:
- Does the licenses files need update? no
- Is there breaking changes for older versions? no
- Does this needs documentation? no

Author: Mina Lee <minalee@apache.org>

Closes #1559 from minahlee/ZEPPELIN-1461 and squashes the following commits:

4a278f0 [Mina Lee] Add test checking InterpreterProperty class
14a6300 [Mina Lee] Add selenium test for display description on interpreter create
4eba177 [Mina Lee] Fix order of properties in ui and java code style
1a2a41d [Mina Lee] Show description when create new interpreter
2016-11-02 13:27:03 +09:00
Kavin
0f56337ce3 [ZEPPELIN-1061] Select default interpreter while creating note
### What is this PR for?

This handles setting the default interpreter on creating a note through the zeppelin UI.
### What type of PR is it?

Feature
### Todos

NA
### What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-1061
### How should this be tested?
- Go to the 'Create Note' dialog and provide the name with the default interpreter selected.After clicking on the Create button, the selected interpreter should be shown properly in the interpreter binding section.
- If there is no interpreter selected, then the system default will be used.
### Screenshots (if appropriate)

![zeppelin-1061](https://cloud.githubusercontent.com/assets/20789766/19378611/200d9d50-920b-11e6-930a-6fdcf67c5215.png)
### Questions:
- Does the licenses files need update? No
- Is there breaking changes for older versions? No
- Does this needs documentation? No

Author: Kavin <kavin.kumar@imaginea.com>

Closes #1520 from kavinkumarks/zeppelin-1061-create-note-default-interpreter and squashes the following commits:

adfcd85 [Kavin] Fixing the new test case failure with recent changes from master.
b086f77 [Kavin] Reset the dropdown selected value for the previous action.
a88a1d2 [Kavin] Added option to select the default interpreter on creating a note and added websocket APIs to get interpreter settings for the former.Added test cases too.
2016-11-01 15:02:43 +09:00
Jan Hentschel
99b975f5c5 [ZEPPELIN-429] Replaced explicit types with diamonds
### What is this PR for?

Changed all occurrences of explicit types to diamonds in the different modules.
### What type of PR is it?

Improvement
### Todos
##
### What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-429
### How should this be tested?

Run the normal Maven build process.
### 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: Jan Hentschel <jan.hentschel@ultratendency.com>

Closes #1551 from HorizonNet/ZEPPELIN-429 and squashes the following commits:

7bde50e [Jan Hentschel] [ZEPPELIN-429] Incorporated latest changes
58a94ac [Jan Hentschel] Merge branch 'master' of https://github.com/apache/zeppelin into ZEPPELIN-429
b56bf24 [Jan Hentschel] [ZEPPELIN-429] Replaced explicit types with diamonds
2016-11-01 11:59:22 +09:00
astroshim
5991a35774 [ZEPPELIN-1306] Interpreter restarts on a note.
### What is this PR for?

This PR is for usability of restarting interpreter.
### What type of PR is it?

Improvement
### What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-1306
### How should this be tested?

You can restart interpreter on the interpreter binding page on a note.
and can only restart `scoped` and `isolated` interpreter.
Please refer to screen shot.
### Screenshots (if appropriate)

![restartintp](https://cloud.githubusercontent.com/assets/3348133/17474018/b2739462-5d8e-11e6-81bb-da15544547a5.gif)
### Questions:
- Does the licenses files need update? no
- Is there breaking changes for older versions? no
- Does this needs documentation? no

Author: astroshim <hsshim@nflabs.com>

Closes #1302 from astroshim/ZEPPELIN-1306 and squashes the following commits:

186a361 [astroshim] rollback noteId check null
f38231c [astroshim] noteId Preconditions
af8a2d8 [astroshim] modify null check to Preconditions
72f3e4f [astroshim] fix testcase.
4dda64b [astroshim] rebase
a626188 [astroshim] rebase and fixing testcase
fc1c819 [astroshim] Merge branch 'ZEPPELIN-1306' of https://github.com/astroshim/zeppelin into ZEPPELIN-1306
499aa6b [astroshim] add PySparkInterpreter testcase
e8e0c17 [astroshim] rebase
36f5642 [astroshim] add InterpreterForNote testcase
fa45bb5 [astroshim] remove debug log
5c4b32a [astroshim] Merge branch 'master' into ZEPPELIN-1306
4c4339f [astroshim] Merge branch 'master' into ZEPPELIN-1306
72a2259 [astroshim] add testcase and fix the doc.
3127154 [astroshim] Merge branch 'master' into ZEPPELIN-1306
0453402 [astroshim] Merge branch 'master' into ZEPPELIN-1306
ecfa7fb [astroshim] remove dud code.
78fdd74 [astroshim] update alert message.
aa30b39 [astroshim] inactive link when interpreter is not selected.
123882d [astroshim] change button to icon
a980500 [astroshim] update html
f9ea386 [astroshim] fix code style
2cea65b [astroshim] change method name
50c6acf [astroshim] delete unnecessary code
29966a0 [astroshim] change UI and restart interpreter process
322d427 [astroshim] Merge branch 'master' into ZEPPELIN-1306
e698e6f [astroshim] change method name
03bdd05 [astroshim] Merge branch 'master' into ZEPPELIN-1306
4dbe05a [astroshim] change argument string to boolean
439b361 [astroshim] fix js code style.
5ad4503 [astroshim] Interpreter restarts on a note.
2016-10-31 14:07:36 +09:00
Mina Lee
60089f0f58 [ZEPPELIN-1566] Make paragraph editable with double click
### What is this PR for?
This PR enables edit on double click for markdown/angular paragraph.  Users can change `editOnDblClick` field to be `false` by editting `interpreter/md/interpreter-setting.json` or  `conf/interpreter.json`. In the same context, users can set other type paragraphs to be editable on double click by setting `editOnDblClick` to be true.

This PR also fixes bug that syntax highlight doesn't work on pasted code.

### What type of PR is it?
Feature

### Todos
* [x] Create test
* [x] Update docs

### What is the Jira issue?
[ZEPPELIN-1566](https://issues.apache.org/jira/browse/ZEPPELIN-1566)

### How should this be tested?
1. Create new markdown interpreter
2. Create notebook and run markdown paragraph
3. Double click markdown paragraph to edit

### Screenshots (if appropriate)

**Edit on double click and hide editor on paragraph run**
![oct-20-2016 12-28-54](https://cloud.githubusercontent.com/assets/8503346/19545401/ca2a69a8-96c0-11e6-9e70-ca930fd7cc8e.gif)

**Syntax highlight on paste**

Before
![oct-20-2016 12-24-54](https://cloud.githubusercontent.com/assets/8503346/19545333/46a2f2a8-96c0-11e6-910a-2a216da5603b.gif)

After
![oct-20-2016 12-25-06](https://cloud.githubusercontent.com/assets/8503346/19545338/4d3bb852-96c0-11e6-8dc4-ff839234876a.gif)

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

Author: Mina Lee <minalee@apache.org>

Closes #1540 from minahlee/ZEPPELIN-1566 and squashes the following commits:

89ea628 [Mina Lee] Remove redundant code
4ffc446 [Mina Lee] Enable focus first paragraph on note reload
c566706 [Mina Lee] Check null condition of editor setting and return default setting
38d5e35 [Mina Lee] Update document about how to make paragraph editable on double click
b42039e [Mina Lee] Add integration test for editOnDblClick
0a26207 [Mina Lee] Add editOnDblClick field in interpreter-setting.json
93abe6a [Mina Lee] Make paragraph editable on doubleclick if editOnDblClick set true in interpreter-setting.json
359dc0b [Mina Lee] Split getAndSetEditorSetting method into getEditorSetting and setEditorLanguage method
2016-10-29 10:30:22 +09:00
Anthony Corbacho
824fd955fb [ZEPPELIN-1575] Notebook Repo settings UI
### What is this PR for?
The idea behind this feature is to bring flexibility to the user to let him configure his repo via UI without restarting Apache Zeppelin.
This is flexible enough to handle most of the basic needs, but more complex case can be added in the future. I will not implement all NotebookRepo, this should be done in different PR since it will depend on special needs. I will just provide a simple example with VFS notebook repo.

***NB***: this scope of the PR doesn't include save change in the configuration file of zeppelin as well as implementation of every notebook repo, git, s3 etcetc, this will be added later if needed.

### What type of PR is it?
 * **Improvement**

### Todos
* [x] - Implement backend.
* [x] - Implement frontend.
* [x] - Implement LocalVFS directory change as exemple.

### What is the Jira issue?
 * [ZEPPELIN-1575](https://issues.apache.org/jira/browse/ZEPPELIN-1575)

### How should this be tested?
Go to notebook repo setting page, edit the notebook path and save.

### Screenshots (if appropriate)
![notebook_repo_settings](https://cloud.githubusercontent.com/assets/3139557/19643248/583dbc2a-9a24-11e6-8f14-7deda9c443f2.gif)

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

Author: Anthony Corbacho <corbacho.anthony@gmail.com>
Author: Damien CORNEAU <corneadoug@gmail.com>

Closes #1553 from anthonycorbacho/feat/NotebookRepoSettings and squashes the following commits:

6d63832 [Anthony Corbacho] Fix style and rebase mistake...
6f17b18 [Anthony Corbacho] Add tests :: API and REST API
23ad18e [Anthony Corbacho] Rename NotebookRepoSettings to NotebookRepoSettingsInfo
42fd3b5 [Anthony Corbacho] Apply broadcasting note list after sucessful update for notebook repo
7fc1f37 [Anthony Corbacho] Change textarea size to 100 row
357b659 [Anthony Corbacho] Fix ASF header
d49bfe1 [Anthony Corbacho] Fix style
517ebc8 [Anthony Corbacho] Fix style
dc7fc50 [Anthony Corbacho] Fix indentation
0b4b74a [Anthony Corbacho] Add exemple of how to change local notebook repo FS
2d67bc8 [Anthony Corbacho] Added method from notebook repo interface
5a13e62 [Anthony Corbacho] Added 2 new methos in notebookRepoSync, exposed get and update notebook repo
8e890d3 [Anthony Corbacho] Add new wrapper for notebook repo PLUS settings
53346d7 [Anthony Corbacho] Add new methods in notebookRepo :: get and set settings in notebook
23912ce [Anthony Corbacho] Added new wrapper class
4d745ab [Damien CORNEAU] Improve ux
05a64de [Damien CORNEAU] Improve edit repo
9c1f999 [Damien CORNEAU] Implement edit
6a97512 [Damien CORNEAU] Get Repos from api
76479b3 [Damien CORNEAU] Change presentation of notebook settings
8075b04 [Damien CORNEAU] Render mocked list of notebook repo settings
054d2aa [Damien CORNEAU] Base structure for notebook repo ui
30d29cd [Anthony Corbacho] Update zeppelin server and add NotebookRepo rest api to the singleton
f7c7bf2 [Anthony Corbacho] Update method :: updateRepoSettings to create NotebookRepoSettingsRequest with Empty static object instead of null
a4d9749 [Anthony Corbacho] Added utility class for notebook re po payload deserialization
efe4c34 [Anthony Corbacho] Add new Rest api endpoint for notebook Repo settings
2016-10-27 17:42:41 +09:00
Kai Jiang
0dd04d5284 [MINOR] remove comments in NotebookRestApi.java
### What is this PR for?
Since ZEPPELIN-1162 (PR #1341) has been solved, we should remove TODO comments correspondingly.

### What type of PR is it?
Minor

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

Author: Kai Jiang <jiangkai@gmail.com>

Closes #1556 from vectorijk/minor-remove-comments and squashes the following commits:

1e8ce8a [Kai Jiang] remove TODO comments since 1162 has been solved
2016-10-25 15:05:14 +09:00
hyonzin
4f6a0e34ff [ZEPPELIN-1549] Change NotebookID variable name to NoteID
### What is this PR for?
This PR fixes wrong written NotebookID to NoteID.

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

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

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

Author: hyonzin <hyeonjin507@gmail.com>
Author: 정현진 <hyeonjin507@gmail.com>
Author: Mina Lee <minalee@apache.org>

Closes #1518 from hyonzin/ZEPPELIN-1549 and squashes the following commits:

2c5d461 [hyonzin] fix pullNoteID to pullNoteId
f843abd [hyonzin] Fix missed line
22aecb3 [hyonzin] Merge branch 'master' of https://github.com/apache/zeppelin into ZEPPELIN-1549
ac03666 [정현진] Merge pull request #1 from minahlee/ZEPPELIN-1549
8b3fffd [Mina Lee] Change notebook to note and fix indentation
000605f [hyonzin] Change clonedNotebookId to clonedNoteId
496695c [hyonzin] Change noteID to noteId
1e87463 [hyonzin] Remove tab indent
5647d37 [hyonzin] Rebase and solve conflicts
09bacd8 [hyonzin] Fix more lines unchanged
070bc2d [hyonzin] fix more in ZeppelinRestApiTest.java
24822a3 [hyonzin] Fix more code not changed (notebookIndex to noteSearchService)
4b4e1e8 [hyonzin] Fix detail (function's name) & Change some placeholder
429203d [hyonzin] Fix details & convention to camel
5fa270d [hyonzin] pull upstream master & fix some details
294bea5 [hyonzin] Fix some wrong written term: Notebook -> Note
cc0d315 [hyonzin] Change NotebookID variable name to NoteID
2016-10-25 14:51:07 +09:00
Khalid Huseynov
dfbea2eb98 [Zeppelin-1561] Improve sync for multiuser environment
### What is this PR for?
apply multi-tenancy for storage sync mechanism

### What type of PR is it?
Bug Fix | Improvement

### Todos
* [x] - broadcast on sync
* [x] - set permissions for pulled notes
* [x] - add test

### What is the Jira issue?
 [ZEPPELIN-1561](https://issues.apache.org/jira/browse/ZEPPELIN-1561)

### How should this be tested?
Outline the steps to test the PR here.

### Screenshots (if appropriate)
green CI

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

Author: Khalid Huseynov <khalidhnv@gmail.com>

Closes #1537 from khalidhuseynov/improve/sync-multiuser and squashes the following commits:

b3e6ed3 [Khalid Huseynov] add userAndRoles
0f2ade7 [Khalid Huseynov] reformat style
bd1a44a [Khalid Huseynov] address comment + test
05afa2a [Khalid Huseynov] remove syncOnStart
b104249 [Khalid Huseynov] add isAnonymous
1a54cc0 [Khalid Huseynov] set perms for pulling notes - make them private
585a675 [Khalid Huseynov] reload, sync and broadcast on login
cd1c3fa [Khalid Huseynov] don't sync on start
2016-10-24 18:07:21 +09:00
Prabhjyot Singh
9e9ea3aea0 [ZEPPELIN-1483] Zeppelin home page list notebooks doesn't show notebook with group permission
### What is this PR for?
Zeppelin home page list notebooks doesn't show notebook with group permission

### What type of PR is it?
[Bug Fix]

### Todos
* [x] - consume userAndRole instead of AuthenticationInfo

### What is the Jira issue?
* [ZEPPELIN-1483](https://issues.apache.org/jira/browse/ZEPPELIN-1483)

### How should this be tested?
In current scenario only those notebook lists that have direct user permission, those with group does not list up, but if user have link to those notebook, it can still be accessed.
IMO the notebook with group permission should also be listed in the home screen.

### Screenshots (if appropriate)
![testgroup](https://cloud.githubusercontent.com/assets/674497/18789097/47c5a558-81c7-11e6-80e1-1d0bc42d0b17.gif)

### 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>
Author: Prabhjyot Singh <prabhjyotsingh@gmail.org>

Closes #1454 from prabhjyotsingh/ZEPPELIN-1483 and squashes the following commits:

2484833 [Prabhjyot Singh] Merge remote-tracking branch 'origin/master' into ZEPPELIN-1483
c8d810e [Prabhjyot Singh] organise imports
d3261c4 [Prabhjyot Singh] consume userAndRole instead of AuthenticationInfo
2016-10-20 14:25:06 +05:30
CloverHearts
908b2a74ff [ZEPPELIN-1210] Run interpreter per user
### What is this PR for?
Enabling each user to run same interpreter.

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

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

### How should this be tested?
1. Enable shiro to use authentication mode
1. Check `per user` in your interpreter tab
1. Run different paragraphs with different users
  1. Run `%spark sc.version`, you will see the two `res0: ...` in your paragraphs

### 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: CloverHearts <cloverheartsdev@gmail.com>
Author: Jongyoul Lee <jongyoul@gmail.com>

Closes #1265 from jongyoul/ZEPPELIN-1210 and squashes the following commits:

48a0d8e [Jongyoul Lee] Fixed ZEPPELIN-1542 Fixed flaky test
e84703d [Jongyoul Lee] Fixed ZEPPELIN-1542
ad80951 [Jongyoul Lee] Fixed some wrong logic of getInterpreterInstanceKey
cee39f4 [Jongyoul Lee] Fixed to pass shiro information to InterpreterFactory from ZeppelinServer
5e7da34 [Jongyoul Lee] Changed instanceKey and processKey for dealing with new UI
d201950 [CloverHearts] fix eqeqeq issue for frontweb
b18bff4 [CloverHearts] implement frontend for interpreter per user mode and misc mode
1f64e52 [CloverHearts] change default value for pernote and peruser
787a366 [CloverHearts] change Back-end test cases and member type (perNote, perUser)
8586e1f [CloverHearts] change ui for interpreter running Per x mode
0b5d671 [Jongyoul Lee] Fixed the style
960bde1 [Jongyoul Lee] Removed SecurityUtils.getPrincipal Added fromMessage.principal to get right user
01c7cf1 [Jongyoul Lee] Fixed NPE while testing ZeppelinSparkClusterTest
1fb50ab [Jongyoul Lee] Fixed NPE while testing ZeppelinSparkClusterTest
d1c4344 [Jongyoul Lee] Fixed getEditorSetting for having users' info
12a27db [Jongyoul Lee] Fixed test after rebase
510942b [Jongyoul Lee] Fixed test after rebase
cb66946 [Jongyoul Lee] Fixed test after rebase
18b39bd [Jongyoul Lee] Fixed test after rebase
daa634f [Jongyoul Lee] Fixed some tests after rebase
ed558be [Jongyoul Lee] Fixed some tests after rebase
fa7fccb [Jongyoul Lee] Fixed destroying process of remoteInterpreterProcess
0a73241 [Jongyoul Lee] Fixed conflict while rebasing.
df423d3 [Jongyoul Lee] Fixed NotebookRestApiTest
b151366 [Jongyoul Lee] Fixed some codes after rebase
a32afd7 [Jongyoul Lee] Fixed some tests
7b7eb78 [Jongyoul Lee] Fixed some tests
47cc668 [Jongyoul Lee] Fixed tests to use AuthenticationInfo
012cf99 [Jongyoul Lee] Fixed some mismatch after rebase
9a03d40 [Jongyoul Lee] Reverted some value to default ones
8589545 [Jongyoul Lee] Added option in UI
ccbedc1 [Jongyoul Lee] WIP
94dfed2 [Jongyoul Lee] WIP
6480d1d [Jongyoul Lee] resolved conflicts
2016-10-20 15:22:59 +09:00
rajarajan-g
1214463c66 [ZEPPELIN-1542] Cleanup of Note created during jUnit test in zeppelin-server, zeppelin-zengine
### What is this PR for?
While running jUnit tests in zeppelin-server & zeppelin-zengine projects, several note are created during the process and those notes are never purged after the execution of the tests.

### What type of PR is it?
Bug Fix

### Todos

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

### How should this be tested?
Prerequisites:
1. Get the list of note that already exist in server.

Now build zeppelin project by running maven commands(mvn clean package)(mvn clean package -pl 'zeppelin-interpreter,zeppelin-zengine,zeppelin-server').
1. Now no extra note should get created after running the maven command

### 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: rajarajan-g <rajarajan.ganesan@imaginea.com>

Closes #1524 from rajarajan-g/ZEPPELIN-1542 and squashes the following commits:

d97cb4a [rajarajan-g] code changes for ZEPPELIN-1542
2016-10-18 18:20:33 +09:00
Khalid Huseynov
b77f9ea8d7 [ZEPPELIN-1437, 1438] Multi-user note management - user aware reload broadcast
### What is this PR for?
This PR addresses part of multi-user note management in Zeppelin. One of the tasks namely listing notes per user on Zeppelin start was addressed in #1330. However that PR didn't solve all problems, and reloading notes was incomplete as well as socket broadcast was not user aware [ZEPPELIN-1437](https://issues.apache.org/jira/browse/ZEPPELIN-1437), [ZEPPELIN-1438](https://issues.apache.org/jira/browse/ZEPPELIN-1438). This PR addresses those issue.

### What type of PR is it?
Improvement

### Todos
* [x] - list notes per user on reload
* [x] - broadcast per user (multicast)
* [x] - tests
* [x] - use authorization module to filter notes on sync
* [x] - broadcast on permissions change
* [ ] - discussion and review

### What is the Jira issue?
[Zeppelin-1437](https://issues.apache.org/jira/browse/ZEPPELIN-1437), [ZEPPELIN-1438](https://issues.apache.org/jira/browse/ZEPPELIN-1438)

### How should this be tested?
1. Start Zeppelin
2. Login as user1, and user2 on different windows
3. Each user should be able to see their own note workbench
4. If note changed to private (readers, writers not empty), that note should disappear from others note workbench.

### Screenshots (if appropriate)
![reload_broadcast](https://cloud.githubusercontent.com/assets/1642088/18679507/e4a0161c-7f9a-11e6-9d57-0930abf4b780.gif)

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

Author: Khalid Huseynov <khalidhnv@gmail.com>

Closes #1392 from khalidhuseynov/feat/multi-user-notes and squashes the following commits:

a2ce268 [Khalid Huseynov] broadcast note list on perm update - zeppelin-1438
9cf1d88 [Khalid Huseynov] fix init not to initialize every time
17eae84 [Khalid Huseynov] bugfix: add precondition for NP
781207e [Khalid Huseynov] bugfix: reload only once
537cc0e [Khalid Huseynov] apply filter from authorization in sync
09e6723 [Khalid Huseynov] notebookAuthorization as singleton
9427e62 [Khalid Huseynov] multicast fine grained note lists to users instead of broadcast
6614e2b [Khalid Huseynov] improve tests
1399407 [Khalid Huseynov] remove unused imports
d9c3bc9 [Khalid Huseynov] filter reload using predicates
92f37f5 [Khalid Huseynov] substitute old getAllNotes(subject) with new implementation
b7f19c9 [Khalid Huseynov] separate getAllNotes() and getAllNotes(subject)
17e2d4c [Khalid Huseynov] first draft
2016-10-18 10:24:57 +09:00
Jongyoul Lee
d2f63f6f96 [ZEPPELIN-1520] Change test environment to use the local mode of Apache Spark
### What is this PR for?
Simplify travis test to reduce usage of resources

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

### Todos
* [x] - Remove start-up/stop SparkCluster

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

### How should this be tested?
Travis will pass without any error

### 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: Jongyoul Lee <jongyoul@gmail.com>

Closes #1487 from jongyoul/ZEPPELIN-1520 and squashes the following commits:

3bccf66 [Jongyoul Lee] Removed some unused scripts anymore
15a3711 [Jongyoul Lee] Cleaned up commented lines
1237658 [Jongyoul Lee] Removed checking mechanism
f37dacf [Jongyoul Lee] Changed master to local[2]
2aac444 [Jongyoul Lee] Remove scripts of start/stop SparkCluster
2016-10-11 17:13:20 +09:00
DuyHai DOAN
79fd3a0242 [ZEPPELIN-1376] Add proxy credentials for dependency repo for corporate firewall use-cases
### What is this PR for?
When using Zeppelin behind corporate firewall, sometimes the dependencies download just fails silently. This PR has 2 objectives:

* add proxy credentials information for dependencies repo
* raise clear error message in case of dependencies download failure

There are 3 commits.

The first one add extra inputs in the form for adding new repository

![add_repo](https://cloud.githubusercontent.com/assets/1532977/18017489/0b486fda-6bd2-11e6-90c7-ceda18c53575.png)

The second commit fixes some issues and display a clear and explicit error message when download of dependencies fail.

Before that, when the download fails, we can see the below behaviour

![irrelevant_double_error_message](https://cloud.githubusercontent.com/assets/1532977/18017541/3cf0de1e-6bd2-11e6-8285-af03f222e8d2.gif)

* the error message is displayed twice because the call twice the method `checkDownloadingDependencies();`. One in the success callback of:

```javascript
 $scope.updateInterpreterSetting = function(form, settingId) {
              ...
            $http.put(baseUrlSrv.getRestApiBase() + '/interpreter/setting/' + settingId, request)
              .success(function(data, status, headers, config) {
                $scope.interpreterSettings[index] = data.body;
                removeTMPSettings(index);
                thisConfirm.close();
                checkDownloadingDependencies();
                $route.reload();
              })
              .error(function(data, status, headers, config) {
             ...
    };
```

Another call is inside success callback of `getInterpreterSettings()`

```javascript
var getInterpreterSettings = function() {
      $http.get(baseUrlSrv.getRestApiBase() + '/interpreter/setting')
      .success(function(data, status, headers, config) {
        $scope.interpreterSettings = data.body;
        checkDownloadingDependencies();
      }).error(function(data, status, headers, config) {
      ....
```

The problem is that `$route.reload();` in the success callback of `updateInterpreterSetting()` will trigger `init()` then `getInterpreterSettings()` so `checkDownloadingDependencies()` is called twice.

I remove the call to `checkDownloadingDependencies()` from success callback of `updateInterpreterSetting()`

The second modification is on class `DependencyResolver`. In the screen capture above, we get a **cryptic** NullPointerException coming from `DefaultRepositorySystem`. I now catch this NPE to wrap it into a more sensible and clearer exception:

```java

  public List<ArtifactResult> getArtifactsWithDep(String dependency,
    Collection<String> excludes) throws RepositoryException {
    Artifact artifact = new DefaultArtifact(dependency);
    DependencyFilter classpathFilter = DependencyFilterUtils.classpathFilter(JavaScopes.COMPILE);
    PatternExclusionsDependencyFilter exclusionFilter =
            new PatternExclusionsDependencyFilter(excludes);

    CollectRequest collectRequest = new CollectRequest();
    collectRequest.setRoot(new Dependency(artifact, JavaScopes.COMPILE));

    synchronized (repos) {
      for (RemoteRepository repo : repos) {
        collectRequest.addRepository(repo);
      }
    }
    DependencyRequest dependencyRequest = new DependencyRequest(collectRequest,
            DependencyFilterUtils.andFilter(exclusionFilter, classpathFilter));

 //Catch NPE thrown by aether and give a proper error message
    try {
      return system.resolveDependencies(session, dependencyRequest).getArtifactResults();
    } catch (NullPointerException ex) {
      throw new RepositoryException(String.format("Cannot fetch dependencies for %s", dependency));
    }
  }
```

The result is much more cleaner

![dependencies_download_error_popup](https://cloud.githubusercontent.com/assets/1532977/18033855/1be5fe9a-6d2e-11e6-91f9-2f5ea66cab26.gif)

The last commit is just doc update

![updated_docs](https://cloud.githubusercontent.com/assets/1532977/18017797/97302f14-6bd3-11e6-97cc-77bd52f25cde.png)

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

### Todos
* [ ] - Code Review
* [ ] - Simple test with no Internet connection
* [ ] - Test within a corporate firewall env with a third-party dependency, requiring download

### What is the Jira issue?
**[ZEPPELIN-1376]**

### How should this be tested?

##### Simple test
* `git fetch origin pull/1369/head:WebProxy`
* `git checkout WebProxy`
* `mvn clean package -DskipTests`
* `bin/zeppelin-daemon.sh restart`
* disconnect from the Internet (pull out the cable, shutdown wifi ...)
* add a random dependency to the Spark interpreter (take `info.archinnov:achilles-core:4.2.2` for example)
* validate the change, you should see an error popup on the top-right corner saying that Zeppelin cannot download the dependency

##### Corporate firewall test
* follow the steps above for simple test
* create a new repository (see how to **[here]**) and set the proxy information
* retry the steps above to ensure that the download is successful

### Screenshots (if appropriate)
See above

### Questions:
* Does the licenses files need update? --> **NO**
* Is there breaking changes for older versions? --> **NO**
* Does this needs documentation?  --> **YES, DONE**

[ZEPPELIN-1376]: https://issues.apache.org/jira/browse/ZEPPELIN-1376
[here]: http://localhost:4000/manual/dependencymanagement.html

Author: DuyHai DOAN <doanduyhai@gmail.com>
Author: doanduyhai <doanduyhai@apache.org>

Closes #1369 from doanduyhai/ZEPPELIN-1376 and squashes the following commits:

b8d44e7 [doanduyhai] [ZEPPELIN-1376] Improve error popup display
177fbd3 [DuyHai DOAN] [ZEPPELIN-1376] Fixes JS bug to display error popup for other interpreters
9f76ef4 [DuyHai DOAN] [ZEPPELIN-1376] Do not repeat the same error popup multiple times
b264193 [DuyHai DOAN] [ZEPPELIN-1376] Add unit test and fix impl for DependencyResolver to catch NPE
1913a0a [DuyHai DOAN] [ZEPPELIN-1376] Update documentation
f01be9b [DuyHai DOAN] [ZEPPELIN-1376] Raise clear error message in case of dependencies download failure
6f2b6f8 [DuyHai DOAN] [ZEPPELIN-1376] Add proxy credentials information for dependencies repo
2016-10-10 09:27:30 +02:00
Lee moon soo
1f6ff6875e [ZEPPELIN-1480] Blocking message pending 10000 for BLOCKING
### What is this PR for?
This patch try to address problem described in ZEPPELIN-1480

### What type of PR is it?
Bug Fix

### Todos
* [x] - Make websocket send thread safe

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

### How should this be tested?
Create multiple paragraphs (for example 10 ```%sh date``` paragraphs) and schedule it every 10sec `0/10 * * * * ?`

### 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: Lee moon soo <moon@apache.org>

Closes #1490 from Leemoonsoo/ZEPPELIN-1480 and squashes the following commits:

0b60743 [Lee moon soo] make websocket send threadsafe
2016-10-07 14:47:30 +09:00
Renjith Kamath
a66b019989 ZEPPELIN-1321 Zeppelin HTTP and HTTPS port should be managed seperately
### What is this PR for?
Use a different variable for ssl port number
- add new property for ssl port

### What type of PR is it?
Improvement

### Todos
* [x] - Add documentation in upgrade.md

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

### How should this be tested?
Add ZEPPELIN_SSL_PORT or  zeppelin.server.ssl.port in zeppelin env or site xml and configure the rest of ssl properties and start zeppelin.

### Screenshots (if appropriate)
n/a

### Questions:
* Does the licenses files need update? n/a
* Is there breaking changes for older versions? n/a
* Does this needs documentation? Updated install doc

Author: Renjith Kamath <renjith.kamath@gmail.com>

Closes #1489 from r-kamath/ZEPPELIN-1321 and squashes the following commits:

8f9006a [Renjith Kamath] ZEPPELIN-1321 update zeppelin upgrade guide
41899b1 [Renjith Kamath] ZEPPELIN-1321 Zeppelin HTTP and HTTPS port should be managed seperately
2016-10-06 13:39:51 +05:30
CloverHearts
23a7e1b45c [ZEPPELIN-1502] Highlights initialization code editor bugs
### What is this PR for?
When there are a variety of para graph interpreter present,
When you refresh the page, the code highlights are incorrectly applied.

### What type of PR is it?
Bug Fix

### Todos
- [x] - Create orderId key in getEditorMode function.

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

### How should this be tested?
1. Create a para-graph form below.
```
%spark
println("spark syn 01");
```
```
%spark
println("spark syn 02");
```
```
%spark
println("spark syn 03");
```
```
%spark
println("spark syn 04");
```
```
%spark
println("spark syn 05");
```
```
%pyspark
print ("pyspark syn);
```
```
%sql
SELECT * FROM SQL_HIGH WHERE ONMYCOM
```

2. Check the highlights of each of the para graphs.
3. Refresh the page and check the highlights again.

### Screenshots (if appropriate)
#### bug (focus on pyspark)
![codeeidtorhigh](https://cloud.githubusercontent.com/assets/10525473/18906890/66b8ede0-85a4-11e6-96fb-6cc000edf477.png)

#### this pr (focus on pyspark)
![code](https://cloud.githubusercontent.com/assets/10525473/18907220/bcc9f818-85a5-11e6-949c-db94fa753d3c.png)

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

Author: CloverHearts <cloverheartsdev@gmail.com>

Closes #1468 from cloverhearts/dev/codeeditor-bugfixed and squashes the following commits:

ff43ce3 [CloverHearts] change payload key name for interpreter syntax property
de03a06 [CloverHearts] remove whitespace - jslint
eaa1b86 [CloverHearts] bug fixed for page refresh initialize editor mode
2016-10-03 16:53:51 +09:00
Kavin
74ef094f6b [ZEPPELIN-808] Changed Permissions on Notebooks do not provide helpful error to user
### What is this PR for?
This is about showing information to the user when there are errors on running paragraphs eg. there could be permission related issue with notebook.

### What type of PR is it?
Improvement

### Todos
NA

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

### How should this be tested?
* Create a notebook and change the file system permission for the notebook folder to have system level write permission to a different user.For eg. if you are running your local zeppelin server with id [USERNAME], then change the file system permission for one of your notebooks created with the former username to different one eg. ROOT user who will only have the write permission
* Try to run all the paragraphs or any individual paragraph for the notebook
* The information as shown in the screenshot should be displayed and the dialog could be closed by the 'Close' button.

### Screenshots (if appropriate)
![erroraboutrunningparagraph-2](https://cloud.githubusercontent.com/assets/20789766/18507272/4cdffe08-7a8d-11e6-8ec7-c712d28cd155.png)

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

Author: Kavin <kavin.kumar@imaginea.com>

Closes #1408 from kavinkumarks/zeppelin-808-handle-notebook-permission-error and squashes the following commits:

21fd49a [Kavin] Exit the run paragraph execution when there are errors with the notebook file system.
950ebda [Kavin] Handle FileSystemException on running paragraph and show the relevant error message to the user.
9f7cf67 [Kavin] Show information to the user when there are errors with related to permission on running paragraphs.
2016-09-28 10:33:21 +09:00
Jeff Zhang
89cf8262e6 ZEPPELIN-1442. UDF can not be found due to 2 instances of SparkSession is created
### What is this PR for?
The issue is that we create 2 SparkSession in zeppelin_pyspark.py (Because we create SQLContext first which will create SparkSession underlying). This cause 2 instances of SparkSession in JVM side and this means we have 2 instances of Catalog as well. So udf registered in SQLContext can not be used in SparkSession. This PR will create SparkSession first and then assign its internal SQLContext to sqlContext in pyspark.

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Task

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

### How should this be tested?
Integration test is added.

### Screenshots (if appropriate)
![image](https://cloud.githubusercontent.com/assets/164491/18774832/7f270de4-818f-11e6-9e4f-c4def4353e5c.png)

### 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 #1452 from zjffdu/ZEPPELIN-1442 and squashes the following commits:

a15e3c6 [Jeff Zhang] fix unit test
93060b6 [Jeff Zhang] ZEPPELIN-1442. UDF can not be found due to 2 instances of SparkSession is created
2016-09-27 10:37:28 +09:00
Jeff Zhang
c717daf655 ZEPPELIN-1427. Scala z.show() doesn't work on v.0.6.1
### What is this PR for?
`ZeppelinContext.show` doesn't work for spark 1.6. The root cause is that `Dataset` is also available in spark 1.6, so the following line will be false when cls is `Dataset` while o is `Dataframe` in spark 1.6
```
if (cls.isInstance(o)) {
```
This PR create a list of supported class and make it a member of `ZeppelinContext `so that we don't need to create it every time.

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Task

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

### How should this be tested?
Tested it manually on spark 1.6 using the following sample code
```
z.show(sqlContext.sql("show tables"))
```

### Screenshots (if appropriate)
![image](https://cloud.githubusercontent.com/assets/164491/18657995/cb25d8e8-7f31-11e6-8b26-62f39bc5587e.png)

### 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 #1440 from zjffdu/ZEPPELIN-1427 and squashes the following commits:

62dbcad [Jeff Zhang] add unit test
a7ba67d [Jeff Zhang] ZEPPELIN-1427. Scala z.show() doesn't work on v.0.6.1
2016-09-26 10:37:48 +09:00
Mina Lee
a3ca800311 [ZEPPELIN-1026] set syntax highlight based on default bound interpreter
### What is this PR for?
This is complete work of #1148. Comments and tasks on #1148 has been handled in this PR.
- Add syntax language information in `interpreter-setting.json`
- When user type `%replName` in paragraph, back-end check if the interpreter name with `replName` exists, and return language information to front-end if it does
- If user doesn't specify `%replName`, default interpreter's language will be used
- Using alias name for paragraph syntax highlight

### What type of PR is it?
[Bug Fix | Improvement]

### What is the Jira issue?
[ZEPPELIN-1026](https://issues.apache.org/jira/browse/ZEPPELIN-1026)

### How should this be tested?
1. Create new note and make markdown interpreter to be default.
2. See if markdown syntax is applied.

### Screenshots (if appropriate)
#### Case 1. When the default interpreter set to python interpreter.
**Before**
Has `scala` as syntax highlight language when %python is not set.
<img width="665" alt="screen shot 2016-07-07 at 10 46 20 pm" src="https://cloud.githubusercontent.com/assets/8503346/16655312/af67a302-4494-11e6-949e-793ad0515d7a.png">

**After**
Has `python` as syntax highlight language even when %python is not set.
<img width="666" alt="screen shot 2016-07-07 at 10 44 39 pm" src="https://cloud.githubusercontent.com/assets/8503346/16655248/769d8ba4-4494-11e6-9b3c-dc5e026e9c53.png">

#### Case 2. When use alias name as repl name.
**Before**
<img width="742" alt="screen shot 2016-09-08 at 4 22 39 pm" src="https://cloud.githubusercontent.com/assets/8503346/18353471/620c5ede-75e2-11e6-9d01-0726bc900dc0.png">

**After**
<img width="741" alt="screen shot 2016-09-08 at 4 34 57 pm" src="https://cloud.githubusercontent.com/assets/8503346/18353487/6cdaa406-75e2-11e6-831a-08e0fa3a85d8.png">

### Further possible improvements
There are still several cases that Zeppelin doesn't handle syntax highlight well. These can be handled with another jira ticket/PR.
1. When default bound interpreter changes, syntax highlight is not changed accordingly
2. When copy/paste code, syntax highlight won't be applied properly since Zeppelin only checks changes when cursor is in first line.

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? yes(for creating new interpreter)

Author: Mina Lee <minalee@apache.org>

Closes #1415 from minahlee/ZEPPELIN-1026 and squashes the following commits:

c66fb0e [Mina Lee] Move getEditorSetting to InterpreterFactory class
2d56222 [Mina Lee] Add description about default syntax highlight in doc
08ccad9 [Mina Lee] Fix test
0874522 [Mina Lee] Change condition for triggering 'getAndSetEditorSetting' to reduce front-end <-> back-end communication
9e4f2e9 [Mina Lee] Change the way to read interpreter language from interpreter-setting.json after #1145
75543b3 [Mina Lee] Add test
565d9d0 [Mina Lee] [DOC] Setting syntax highlight when writing new interpreter
20132ca [Mina Lee] Get paragraph editor mode from backend
52f4207 [Mina Lee] Align comments for readability
26cbbb8 [Mina Lee] Add editor field
2016-09-23 16:47:26 +09:00
Jeff Zhang
c61f1fbced ZEPPELIN-1411. UDF with pyspark not working - object has no attribute 'parseDataType'
### What is this PR for?
The root cause is that SQLContext's signature changes in spark 2.0.
Spark 1.6
```
def __init__(self, sparkContext, sqlContext=None):
```
Spark 2.0
```
def __init__(self, sparkContext, sparkSession=None, jsqlContext=None):
```
So we need to create SQLContext using named parameters, otherwise it would take intp.getSQLContext() as sparkSession which cause the issue.

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Task

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

### How should this be tested?
Tested using the example code in ZEPPELIN-1411.

### Screenshots (if appropriate)
![image](https://cloud.githubusercontent.com/assets/164491/18260139/9bd702c0-741d-11e6-8b23-946c38a794c3.png)

### 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 #1404 from zjffdu/ZEPPELIN-1411 and squashes the following commits:

40b080a [Jeff Zhang] retry
4922de1 [Jeff Zhang] log more logging for travis CI diangnose
4fe033d [Jeff Zhang] add unit test
296c63f [Jeff Zhang] ZEPPELIN-1411. UDF with pyspark not working - object has no attribute 'parseDataType'
2016-09-21 08:09:02 -07:00
Prabhjyot Singh
1e8559e651 ZEPPELIN-1456: Flaky Test: AuthenticationIT
### What is this PR for?
This started happening after ZEPPELIN-1144, https://github.com/apache/zeppelin/pull/1330.
This test (testGroupPermission) is to validate the group related permission on a notebook.

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Fix CI

### What is the Jira issue?
* [ZEPPELIN-1456](https://issues.apache.org/jira/browse/ZEPPELIN-1456)

### How should this be tested?
CI xxx.10 (selenium) should be green

### Screenshots (if appropriate)

### 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 #1444 from prabhjyotsingh/ZEPPELIN-1456 and squashes the following commits:

3c81587 [Prabhjyot Singh] ZEPPELIN-1456: fix
2016-09-21 09:52:50 +09:00
Minwoo Kang
29021896bf [ZEPPELIN-1144]Zeppelin home page should only list notebooks with read or write permission
### What is this PR for?
If logged in user does not have Read and Write permission for a notebook, user should not see the notebook in the zeppelin home page.

### What type of PR is it?
Bug Fix

### Todos

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

### How should this be tested?
* unit test
* online test

### 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: Minwoo Kang <minwoo.kang@outlook.com>

Closes #1330 from mwkang/ZEPPELIN-1144 and squashes the following commits:

82beb18 [Minwoo Kang] User see read, write, owner permission notebook.
2016-09-16 09:29:17 -07:00
Kavin
294eef1327 [ZEPPELIN-1142] Zeppelin allows two users to simultaneously edit the notebook permissions
### What is this PR for?
This is about storing the owner information on creating a note so when the same user tries to edit the permissions of the note he could do it successfully.

### What type of PR is it?
Improvement

### Todos
NA

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

### How should this be tested?
Check the below cases via the web application or REST API calls and the owner information should be persisted properly.
* Create note
* Clone note
* Import note

### 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: Kavin <kavin.kumar@imaginea.com>

Closes #1393 from kavinkumarks/zeppelin-1142-simultaneous-note-permission-error and squashes the following commits:

5a45c9e [Kavin] Ensure that the authentication instance is created only when the input prinicipal is not null.
7642f63 [Kavin] Removed the duplicate instance of notebook variable and reused the existing one.
e1b8b08 [Kavin] Store owner information on creating a note and added integration test cases for the relevant scenarios.
2016-09-15 16:14:03 -07:00