You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by Leemoonsoo <gi...@git.apache.org> on 2016/02/08 09:58:49 UTC

[GitHub] incubator-zeppelin pull request: [WIP] [ZEPPELIN-513] Dedicated in...

GitHub user Leemoonsoo opened a pull request:

    https://github.com/apache/incubator-zeppelin/pull/703

    [WIP] [ZEPPELIN-513] Dedicated interpreter session per notebook

    ### What is this PR for?
    
    Currently, all notebooks that binded to the same interpreter setting shares the same interpreter instance.
    For example, let's say there're `spark-production` interpreter setting and all notebooks are using it.
    Then all notebooks share a single instance of SparkInterpreter, and that result all the variables are being shared across the notebook.
    
    But sometimes isolated name space for variables per notebook is preferred. In this case we can create per notebook interpreter instance.
    
    
    This PR provides generalized facility to provides per notebook interpreter instance, not only for SparkInterpreter but for any other existing interpreter without modification.
    
    **Design**
    
    It provides toggle switch that user turn on / turn off this mode per interpreter setting.
    When per notebook interpreter is turned on, it still creates a single remote interpreter process per interpreter setting. But inside of the process, each notebook will have it's own interpreter instance and the instance is terminated automatically on removal of notebook or unbinding note from interpreter setting.
    
    **SparkInterpreter**
    
    Because of the design keeps single remote interpreter process and creates multiple interpreter instance inside of it, SparkInterpreter become a problem. While multiple SparkContext can not be created on a single process. So this PR try to, create per notebook scala compiler instance, but share single SparkContext instance. In this way, each notebook can run job concurrently by leveraging fairscheduler of SparkContext without running multiple Spark application (SparkContext).
    
    And this approach is inspired by https://github.com/piyush-mukati/incubator-zeppelin/tree/parallel_scheduler_support_spark, this PR trying to generalize it for all other interpreters.
    
    
    ### What type of PR is it?
    Feature
    
    ### Todos
    * [x] - Per note interpreter session 
    * [x] - Scala compiler instance per note and share a single SparkContext (SparkInterpreter)
    * [ ] - Handle Spark class server correctly
    
    ### Is there a relevant Jira issue?
    
    https://issues.apache.org/jira/browse/ZEPPELIN-513
    
    ### How should this be tested?
    
    Check "Per note session" of your Spark interpreter setting. 
    And create two different notebook and check scala variables are not shared.
    
    
    ### Screenshots (if appropriate)
    ![image](https://cloud.githubusercontent.com/assets/1540981/12881400/f1858e6c-ce8c-11e5-9b05-832f4c0d8788.png)
    
    ### Questions:
    * Does the licenses files need update? no
    * Is there breaking changes for older versions? no
    * Does this needs documentation? yes

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Leemoonsoo/incubator-zeppelin notebook_interpreter_session

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-zeppelin/pull/703.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #703
    
----
commit 5787984def99a63a465ab7a9414875414fc9b817
Author: Lee moon soo <mo...@apache.org>
Date:   2016-02-01T08:34:43Z

    Add option for per note session interpreter

commit ed1ab0d21367b7a299e122446cbe56f4b283d9f2
Author: Lee moon soo <mo...@apache.org>
Date:   2016-02-02T21:33:10Z

    zeppelin-interpreter note session support

commit fc9cb3f4b5bb3411aef3796857a7a26fdda821bd
Author: Lee moon soo <mo...@apache.org>
Date:   2016-02-03T16:39:48Z

    interpreter session aware interpreter factory

commit 366b6519436589bf39be1896c38febbac4004775
Author: Lee moon soo <mo...@apache.org>
Date:   2016-02-06T23:12:43Z

    Don't destroy interpreter on note memove or change bindings when interpreter.option.perNoteSession is false

commit 58e5f917a4a9f14f8821b5db0a45738d854b9855
Author: Lee moon soo <mo...@apache.org>
Date:   2016-02-07T01:12:14Z

    Update spark interpreter

commit 1d1638c27e85ed6613f3d8184c5ee9bbc224daaf
Author: Lee moon soo <mo...@apache.org>
Date:   2016-02-07T01:42:51Z

    Fix test

commit 6dd981a0366f55926905849f17a6bdd48568feac
Author: Lee moon soo <mo...@apache.org>
Date:   2016-02-07T02:17:29Z

    update interpreter module test

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-201039365
  
    It's still an open issue. https://issues.apache.org/jira/browse/ZEPPELIN-183
    
    While trying to answer the question 'how hard would it be', i realized that i can quickly make a patch.
    I'll create a pullrequest soon.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-201087563
  
    @EronWright @sourav-mazumder. I just created a pullrequest https://github.com/apache/incubator-zeppelin/pull/795, Please take a look.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by EronWright <gi...@git.apache.org>.
Github user EronWright commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-200943860
  
    @sourav-mazumder @Leemoonsoo There are two good reasons why Zeppelin should run each note as a separate Spark app instance.
    1. Dependencies - each note may have different dependencies (expressed as %dep, as a spark package, etc.)
    2. Scale - it is reasonable that each note has unique scale requirements; one might be memory-intensive, etc.
    
    I don't think a per-user instance would address those concerns.
    
    @Leemoonsoo how hard would it be to achieve that, and how can I help?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-186934886
  
    It's available in general. So all other interpreter groups can use.
    "Separate interpreter for each notebook" Sounds easier to understand.
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [WIP] [ZEPPELIN-513] Dedicated in...

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-182469949
  
    @Leemoonsoo Cooool!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-187924861
  
    @felixcheung @AhyoungRyu @echarles I have changed to "Separate interpreter for each note"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-186969443
  
    :+1: for @felixcheung !


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-188606641
  
    @felixcheung Thanks for letting me know. I have updated to use System.nanoTime().
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-188110608
  
    @felixcheung Thanks for the review. I have addressed the comments. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by khalidhuseynov <gi...@git.apache.org>.
Github user khalidhuseynov commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-188122438
  
    I see, that makes sense. CI is green, LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Re: [GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by "Amos B. Elberg" <am...@gmail.com>.
This links to 703, which creates per-notebook interpreters and I'm now starting to see problems with. 

> On Mar 16, 2016, at 1:29 PM, sourav-mazumder <gi...@git.apache.org> wrote:
> 
> Github user sourav-mazumder commented on the pull request:
> 
>    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-197444164
> 
>    Hi,
> 
>    I was just trying  some of these. Looks like with this solution there would be queue built up for running multiple paragraphs in parallel for Spark. And that essentially causes huge slowness when multiple paragraphs are running in parallel. It is a big road block for multi-tenancy.
> 
>    My suggestion is to create multiple processes for Spark Interpreter but limit it/link it to user instead of notebook. So for every user there should be a separate interpreter process instead of for every notebook. As we are also having PR on user authentication and authentication in place achieving this should not be a problem.
> 
>    Regards,
>    Sourav
> 
> 
> ---
> If your project is set up for it, you can reply to this email and have your
> reply appear on GitHub as well. If your project does not have this feature
> enabled and wishes so, or if the feature is enabled but not working, please
> contact infrastructure at infrastructure@apache.org or file a JIRA ticket
> with INFRA.
> ---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by sourav-mazumder <gi...@git.apache.org>.
Github user sourav-mazumder commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-197444164
  
    Hi,
    
    I was just trying  some of these. Looks like with this solution there would be queue built up for running multiple paragraphs in parallel for Spark. And that essentially causes huge slowness when multiple paragraphs are running in parallel. It is a big road block for multi-tenancy.
    
    My suggestion is to create multiple processes for Spark Interpreter but limit it/link it to user instead of notebook. So for every user there should be a separate interpreter process instead of for every notebook. As we are also having PR on user authentication and authentication in place achieving this should not be a problem.
    
    Regards,
    Sourav


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-188103224
  
    @khalidhuseynov Thanks for the opinion. Both UX and Performance point of view, which make sense to be default will be totally depends on the interpreters.
    
    For example, much higher resource will be required to use "separate interpreter per note" for SparkInterpreter, while it creates separate scala compiler instance per note.
    But for markdown interpreter or shell interpreter, resource requirement will be pretty much the same.
    
    And UX side, i was more focused on the providing the same default behavior to the previous version.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by khalidhuseynov <gi...@git.apache.org>.
Github user khalidhuseynov commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-188035398
  
    Thanks for the great improvement! 
    What do you think would be the default use case for the interpreter context sharing? Currently the checkbox is unmarked by default, meaning the context is shared for notes by default. Other way would be to have it marked by default (or more preferably, have unmarked checkbox saying `Share interpreter for notes`). Just wanted to know opinion from UX and performance ( per note interpreter maybe more resourceful) points of views.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by echarles <gi...@git.apache.org>.
Github user echarles commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-187057575
  
    Or "Separate interpreter for each note" ?
    
    cfr. https://issues.apache.org/jira/browse/ZEPPELIN-616 Zeppelin UI consistency: should use Note or Notebook term


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by jongyoul <gi...@git.apache.org>.
Github user jongyoul commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-188128970
  
    @Leemoonsoo As I mentioned in some codes, how about passing InterpreterContext to the RemoteInterpreterServer? It would be useful and we don't any any other information when we add some features.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-185582537
  
    Documentation added. And add gif image in this PR description to show how it works in SparkInterpreter.
    Please review this PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-188101021
  
    big change - only a few minor comments.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-189678616
  
    Thanks @jongyoul @AhyoungRyu @felixcheung @echarles @khalidhuseynov for taking a look and review.
    
    Merging it if there're no more discussions.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-186919160
  
    Is this only applicable to Spark interpreter group?
    Instead of "per note session" should we say "separate interpreter for each notebook" or similar?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-zeppelin/pull/703


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-513] Dedicated interpre...

Posted by jongyoul <gi...@git.apache.org>.
Github user jongyoul commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/703#issuecomment-189130930
  
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---