[GitHub] [zeppelin] zjffdu commented on a change in pull request #3340: [ZEPPELIN-4068] Implement MongoNotebookRepo

2019-04-01 Thread GitBox
zjffdu commented on a change in pull request #3340: [ZEPPELIN-4068] Implement 
MongoNotebookRepo
URL: https://github.com/apache/zeppelin/pull/3340#discussion_r271136156
 
 

 ##
 File path: 
zeppelin-plugins/notebookrepo/mongo/src/test/java/org/apache/zeppelin/notebook/repo/MongoNotebookRepoTest.java
 ##
 @@ -0,0 +1,106 @@
+package org.apache.zeppelin.notebook.repo;
+
+import static 
org.apache.zeppelin.conf.ZeppelinConfiguration.ConfVars.ZEPPELIN_NOTEBOOK_MONGO_URI;
+import static org.junit.Assert.assertEquals;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.util.Map;
+import de.flapdoodle.embed.mongo.MongodExecutable;
+import de.flapdoodle.embed.mongo.MongodStarter;
+import de.flapdoodle.embed.mongo.config.IMongodConfig;
+import de.flapdoodle.embed.mongo.config.MongodConfigBuilder;
+import de.flapdoodle.embed.mongo.config.Net;
+import de.flapdoodle.embed.mongo.distribution.Version;
+import de.flapdoodle.embed.process.runtime.Network;
+import org.apache.zeppelin.conf.ZeppelinConfiguration;
+import org.apache.zeppelin.notebook.Note;
+import org.apache.zeppelin.notebook.NoteInfo;
+import org.apache.zeppelin.notebook.Paragraph;
+import org.apache.zeppelin.user.AuthenticationInfo;
+
+public class MongoNotebookRepoTest {
+
+  private MongodExecutable mongodExecutable;
+
+  private ZeppelinConfiguration zConf;
+
+  private MongoNotebookRepo notebookRepo;
+
+  @Before
+  public void setUp() throws IOException {
+String bindIp = "localhost";
+int port = new ServerSocket(0).getLocalPort();
+
+IMongodConfig mongodConfig = new MongodConfigBuilder()
+.version(Version.Main.PRODUCTION)
+.net(new Net(bindIp, port, Network.localhostIsIPv6()))
+.build();
+
+mongodExecutable = MongodStarter.getDefaultInstance()
+.prepare(mongodConfig);
+mongodExecutable.start();
+
+System.setProperty(ZEPPELIN_NOTEBOOK_MONGO_URI.getVarName(), "mongodb://" 
+ bindIp + ":" + port);
+zConf = new ZeppelinConfiguration();
+notebookRepo = new MongoNotebookRepo();
+notebookRepo.init(zConf);
+  }
+
+  @After
+  public void tearDown() throws IOException {
+if (mongodExecutable != null) {
+  mongodExecutable.stop();
+}
+  }
+
+  @Test
+  public void testBasics() throws IOException {
+assertEquals(0, notebookRepo.list(AuthenticationInfo.ANONYMOUS).size());
+
+// create note1
+Note note1 = new Note();
+note1.setPath("/my_project/my_note1");
+Paragraph p1 = note1.insertNewParagraph(0, AuthenticationInfo.ANONYMOUS);
+p1.setText("%md hello world");
+p1.setTitle("my title");
+notebookRepo.save(note1, AuthenticationInfo.ANONYMOUS);
+
+Map noteInfos = 
notebookRepo.list(AuthenticationInfo.ANONYMOUS);
+assertEquals(1, noteInfos.size());
+assertEquals(note1.getId(), noteInfos.get(note1.getId()).getId());
+assertEquals(note1.getName(), noteInfos.get(note1.getId()).getNoteName());
+
+// create note2
+Note note2 = new Note();
+note2.setPath("/my_note2");
+Paragraph p2 = note2.insertNewParagraph(0, AuthenticationInfo.ANONYMOUS);
+p2.setText("%md hello world2");
+p2.setTitle("my title2");
+notebookRepo.save(note2, AuthenticationInfo.ANONYMOUS);
+
+noteInfos = notebookRepo.list(AuthenticationInfo.ANONYMOUS);
+assertEquals(2, noteInfos.size());
+
+// move note2
+String newPath = "/my_project2/my_note2";
+notebookRepo.move(note2.getId(), note2.getPath(), "/my_project2/my_note2", 
AuthenticationInfo.ANONYMOUS);
+
+Note note3 = notebookRepo.get(note2.getId(), newPath, 
AuthenticationInfo.ANONYMOUS);
+assertEquals(note2, note3);
+
+// move folder
+notebookRepo.move("/my_project2", "/my_project3/my_project2", 
AuthenticationInfo.ANONYMOUS);
+noteInfos = notebookRepo.list(AuthenticationInfo.ANONYMOUS);
+assertEquals(2, noteInfos.size());
+
+Note note4 = notebookRepo.get(note3.getId(), 
"/my_project3/my_project2/my_note2", AuthenticationInfo.ANONYMOUS);
+assertEquals(note3, note4);
+
+// remote note1
+notebookRepo.remove(note1.getId(), note1.getPath(), 
AuthenticationInfo.ANONYMOUS);
+assertEquals(1, notebookRepo.list(AuthenticationInfo.ANONYMOUS).size());
 
 Review comment:
   no test case for removing folder.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [zeppelin] zjffdu commented on a change in pull request #3340: [ZEPPELIN-4068] Implement MongoNotebookRepo

2019-04-01 Thread GitBox
zjffdu commented on a change in pull request #3340: [ZEPPELIN-4068] Implement 
MongoNotebookRepo
URL: https://github.com/apache/zeppelin/pull/3340#discussion_r271136021
 
 

 ##
 File path: 
zeppelin-plugins/notebookrepo/mongo/src/test/java/org/apache/zeppelin/notebook/repo/MongoNotebookRepoTest.java
 ##
 @@ -0,0 +1,106 @@
+package org.apache.zeppelin.notebook.repo;
+
+import static 
org.apache.zeppelin.conf.ZeppelinConfiguration.ConfVars.ZEPPELIN_NOTEBOOK_MONGO_URI;
+import static org.junit.Assert.assertEquals;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.util.Map;
+import de.flapdoodle.embed.mongo.MongodExecutable;
+import de.flapdoodle.embed.mongo.MongodStarter;
+import de.flapdoodle.embed.mongo.config.IMongodConfig;
+import de.flapdoodle.embed.mongo.config.MongodConfigBuilder;
+import de.flapdoodle.embed.mongo.config.Net;
+import de.flapdoodle.embed.mongo.distribution.Version;
+import de.flapdoodle.embed.process.runtime.Network;
+import org.apache.zeppelin.conf.ZeppelinConfiguration;
+import org.apache.zeppelin.notebook.Note;
+import org.apache.zeppelin.notebook.NoteInfo;
+import org.apache.zeppelin.notebook.Paragraph;
+import org.apache.zeppelin.user.AuthenticationInfo;
+
+public class MongoNotebookRepoTest {
+
+  private MongodExecutable mongodExecutable;
+
+  private ZeppelinConfiguration zConf;
+
+  private MongoNotebookRepo notebookRepo;
+
+  @Before
+  public void setUp() throws IOException {
+String bindIp = "localhost";
+int port = new ServerSocket(0).getLocalPort();
+
+IMongodConfig mongodConfig = new MongodConfigBuilder()
+.version(Version.Main.PRODUCTION)
+.net(new Net(bindIp, port, Network.localhostIsIPv6()))
+.build();
+
+mongodExecutable = MongodStarter.getDefaultInstance()
+.prepare(mongodConfig);
+mongodExecutable.start();
+
+System.setProperty(ZEPPELIN_NOTEBOOK_MONGO_URI.getVarName(), "mongodb://" 
+ bindIp + ":" + port);
+zConf = new ZeppelinConfiguration();
+notebookRepo = new MongoNotebookRepo();
+notebookRepo.init(zConf);
+  }
+
+  @After
+  public void tearDown() throws IOException {
+if (mongodExecutable != null) {
+  mongodExecutable.stop();
+}
+  }
+
+  @Test
+  public void testBasics() throws IOException {
+assertEquals(0, notebookRepo.list(AuthenticationInfo.ANONYMOUS).size());
+
+// create note1
+Note note1 = new Note();
+note1.setPath("/my_project/my_note1");
+Paragraph p1 = note1.insertNewParagraph(0, AuthenticationInfo.ANONYMOUS);
+p1.setText("%md hello world");
+p1.setTitle("my title");
+notebookRepo.save(note1, AuthenticationInfo.ANONYMOUS);
+
+Map noteInfos = 
notebookRepo.list(AuthenticationInfo.ANONYMOUS);
+assertEquals(1, noteInfos.size());
+assertEquals(note1.getId(), noteInfos.get(note1.getId()).getId());
+assertEquals(note1.getName(), noteInfos.get(note1.getId()).getNoteName());
+
+// create note2
+Note note2 = new Note();
+note2.setPath("/my_note2");
+Paragraph p2 = note2.insertNewParagraph(0, AuthenticationInfo.ANONYMOUS);
+p2.setText("%md hello world2");
+p2.setTitle("my title2");
+notebookRepo.save(note2, AuthenticationInfo.ANONYMOUS);
+
+noteInfos = notebookRepo.list(AuthenticationInfo.ANONYMOUS);
+assertEquals(2, noteInfos.size());
+
+// move note2
+String newPath = "/my_project2/my_note2";
+notebookRepo.move(note2.getId(), note2.getPath(), "/my_project2/my_note2", 
AuthenticationInfo.ANONYMOUS);
+
+Note note3 = notebookRepo.get(note2.getId(), newPath, 
AuthenticationInfo.ANONYMOUS);
+assertEquals(note2, note3);
+
+// move folder
+notebookRepo.move("/my_project2", "/my_project3/my_project2", 
AuthenticationInfo.ANONYMOUS);
+noteInfos = notebookRepo.list(AuthenticationInfo.ANONYMOUS);
+assertEquals(2, noteInfos.size());
+
+Note note4 = notebookRepo.get(note3.getId(), 
"/my_project3/my_project2/my_note2", AuthenticationInfo.ANONYMOUS);
+assertEquals(note3, note4);
+
+// remote note1
 
 Review comment:
   typo: remove


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Created] (ZEPPELIN-4106) Defaults for GitHub variables are incorrect

2019-04-01 Thread Eric Meadows (JIRA)
Eric Meadows created ZEPPELIN-4106:
--

 Summary: Defaults for GitHub variables are incorrect
 Key: ZEPPELIN-4106
 URL: https://issues.apache.org/jira/browse/ZEPPELIN-4106
 Project: Zeppelin
  Issue Type: Bug
Reporter: Eric Meadows


When referencing 
[https://zeppelin.apache.org/docs/latest/setup/operation/configuration.html], I 
realized that `ZEPPELIN_NOTEBOOK_GIT_REMOTE_ACCESS_TOKEN`, and 
`ZEPPELIN_NOTEBOOK_GIT_REMOTE_ORIGIN` were both incorrectly documented for 
their Default values.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [zeppelin] zjffdu opened a new pull request #3345: [ZEPPELIN-4043]. Create shell script for moving note permission info from notebook-authorization.json to note file

2019-04-01 Thread GitBox
zjffdu opened a new pull request #3345: [ZEPPELIN-4043]. Create shell script 
for moving note permission info from notebook-authorization.json to note file
URL: https://github.com/apache/zeppelin/pull/3345
 
 
   ### What is this PR for?
   This PR is followup of ZEPPELIN-3985. It will help user to the note upgrade.
   
   ### What type of PR is it?
   [ Improvement ]
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   * https://jira.apache.org/jira/browse/ZEPPELIN-4043
   
   ### How should this be tested?
   * CI pass
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the licenses files need update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


Re: [jira] [Created] (ZEPPELIN-4104) Zeppelin interpreter On Docker

2019-04-01 Thread tecgie88
Hi

Question. Is this enhancement going to decouple the interpreters and Zeppelin 
server? In per note scoped mode, will one instance of interpreter docker be 
created per note?  When will this enhancement be available?  In what zeppelin 
version (0.8.2)?  Can R interpreter be in docker as well?

Thanks

> On Apr 1, 2019, at 4:11 AM, Xun Liu (JIRA)  wrote:
> 
> Xun Liu created ZEPPELIN-4104:
> -
> 
> Summary: Zeppelin interpreter On Docker
> Key: ZEPPELIN-4104
> URL: https://issues.apache.org/jira/browse/ZEPPELIN-4104
> Project: Zeppelin
>  Issue Type: Improvement
>Reporter: Xun Liu
>Assignee: Xun Liu
> 
> 
> Python needs to install a lot of dependent libraries in the zeppelin 
> interpreter.
> Different users may need to use different versions of the python library.
> If you install the python library directly on the physical host, Not only 
> difficult to maintain, but also easy to cause python library conflicts.
> In some lightweight user scenarios, They don't have kubernetes or YARN.
> But installing a docker is very easy.
> So, if zeppelin can create the interpreter in docker, Help for users can be 
> very large.
> 
> 
> 
> --
> This message was sent by Atlassian JIRA
> (v7.6.3#76005)



[jira] [Created] (ZEPPELIN-4105) Zeppelin Notebook or Tutorial under Zeppelin is not opening

2019-04-01 Thread naman deep (JIRA)
naman deep created ZEPPELIN-4105:


 Summary: Zeppelin Notebook or Tutorial under Zeppelin is not 
opening
 Key: ZEPPELIN-4105
 URL: https://issues.apache.org/jira/browse/ZEPPELIN-4105
 Project: Zeppelin
  Issue Type: Bug
Reporter: naman deep


I am learning IBM Data Science Professional Certificate from coursera. As part 
of this course I am using Zeppelin Notebook. I not able to access anything 
under Zeppelin Notebook.

I have created a new note but when it is opened I can't see any console or type 
anything to code instead it is a blank page. Attached the screen shots.

Further, the tutorial for python & scala links are also not working, it doesn't 
open.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (ZEPPELIN-4104) Zeppelin interpreter On Docker

2019-04-01 Thread Xun Liu (JIRA)
Xun Liu created ZEPPELIN-4104:
-

 Summary: Zeppelin interpreter On Docker
 Key: ZEPPELIN-4104
 URL: https://issues.apache.org/jira/browse/ZEPPELIN-4104
 Project: Zeppelin
  Issue Type: Improvement
Reporter: Xun Liu
Assignee: Xun Liu


Python needs to install a lot of dependent libraries in the zeppelin 
interpreter.
Different users may need to use different versions of the python library.
If you install the python library directly on the physical host, Not only 
difficult to maintain, but also easy to cause python library conflicts.
In some lightweight user scenarios, They don't have kubernetes or YARN.
But installing a docker is very easy.
So, if zeppelin can create the interpreter in docker, Help for users can be 
very large.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [zeppelin] jongyoul merged pull request #3335: [MINOR] Refactor CronJob class

2019-04-01 Thread GitBox
jongyoul merged pull request #3335: [MINOR] Refactor CronJob class
URL: https://github.com/apache/zeppelin/pull/3335
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [zeppelin] jongyoul commented on issue #3335: [MINOR] Refactor CronJob class

2019-04-01 Thread GitBox
jongyoul commented on issue #3335: [MINOR] Refactor CronJob class
URL: https://github.com/apache/zeppelin/pull/3335#issuecomment-478453914
 
 
   Rebased. Will merge it


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Created] (ZEPPELIN-4103) Notebook Repository permission from Notebook Repos in ZeppelinUI

2019-04-01 Thread Keita Inadome (JIRA)
Keita Inadome created ZEPPELIN-4103:
---

 Summary: Notebook Repository permission from Notebook Repos in 
ZeppelinUI
 Key: ZEPPELIN-4103
 URL: https://issues.apache.org/jira/browse/ZEPPELIN-4103
 Project: Zeppelin
  Issue Type: Improvement
  Components: GUI
Affects Versions: 0.8.1
Reporter: Keita Inadome


All accounts can be freely set Notebook Path from Notebook Repos in ZeppelinUI.
And that setting is reflected in all accounts.

*Can I hide Notebook Repos? Or, can I make settings reflect on all account, not 
individually?*

All local notebook version control is enabled in the standard Git repository.


 zeppelin.notebook.storage
 org.apache.zeppelin.notebook.repo.FileSystemNotebookRepo
 hadoop compatible file system notebook persistence layer 
implementation




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)