Skip to content

Conversation

@Leemoonsoo
Copy link
Contributor

Currently all interpreters are shared to all notes by default.
It'll be good If we can selectively bind/unbind available interpreters to note.

  • Ability to instantiate new interpreter and bind/unbind to note
  • API for bind/unbind interpreter
  • GUI Impelementation for bind/unbind interpreter
  • Save/load interpreter bindings
  • default property display
  • restore z.run() feature

Conflicts:
	zeppelin-server/src/main/java/com/nflabs/zeppelin/server/ZeppelinServer.java
@Leemoonsoo
Copy link
Contributor Author

This PR implements a) ability to create interpreter instance with different configurations, b) bind/unbind created interpreters to note.

Interpreter settings

Interpreters can be instantiated with different configurations.
Here's screenshot of listing interpreter settings
image

Here's how screenshot of creating new interpreter setting

image

Interpreter bindings
Each note can configure which interpreter is going to be used.
Each note now have setting menu for interpreter bind/unbind. User can click to bind/unbind interpreter and reorder interpreters by drag&drop. (first interpreter becomes default one)

Screenshot.
image

Configuration
Zeppelin now creates configuration file 'conf/interpreter-settings.json'. The file persist/load information of interpreter settings and bindings. The file is automatically generated when it's not exists.

Any feedback is welcome.
Ready to merge!

@swkimme
Copy link
Contributor

swkimme commented Dec 29, 2014

Super Cool, works great!
I'll test more and post some feedback for UI improvements.

@swkimme
Copy link
Contributor

swkimme commented Jan 12, 2015

I guess a.cons: 'using multiple instance of interpreter derived from the
same type in a single notebook' is quite rare case.

I prefer current implementation for simplicity. (also it's more intuitive.)
supplying name as option seems to be quite good alternative like moon
sugested, %spark(name='spark-local')

On Sun Jan 11 2015 at 10:45:27 PM Lee moon soo notifications@github.com
wrote:

@haebin https://github.com/haebin Thanks for nice suggestion!

I think there're pros and cons.

a. Current implementaion

Cons - In a single notebook, can not use multiple instance of interpreter
derived from the same type.
Pros - All zeppelin user will use the same %magic keyword for the same
interpreter type. (therefore notebook can be run in any user's Zeppelin
without %magic keyword modification)

b. Haebin proposed way
Pros - Can use multiple instance of interpreter derived from the same
type. in a single note.
Cons - In case notebook is copied from other, to run, need to modify
%magic keyword for local Zeppelin's setting name.

Guys what do you think? @haebin https://github.com/haebin, @swkimme
https://github.com/swkimme any good idea?

One compromise is using always %spark but giving some arguments like
%spark(name='spark-local')


Reply to this email directly or view it on GitHub
#235 (comment).

@Leemoonsoo
Copy link
Contributor Author

Now, i changed behavior to minimize the UX changes according to @swkimme 's suggestion.
Newly created note now have automatically selected interpreter sets.
(Existing note that created before this feature will still be asked)

Also it'll be asked before discard any changes on note setting menu.

Right buttons are now aligned
image

About description in interpreter menu, i was trying to make it look alike table that explain application's properties. Those kind of table we can see all around, hadoop, spark, etc. (eg. https://spark.apache.org/docs/1.1.0/configuration.html#application-properties)

@Leemoonsoo
Copy link
Contributor Author

Summary of this PR

New features

  • Creating / removing interpreter settings (interpreter instances)
  • Binding/unbinding interpreter to notes

Improvements

  • Align upper right icons in note page.

Bug fix

  • Resolve netty dependency confliction
  • Resolve NPE after Zeppelin restart when trying to to autocomplete
  • Cancel paragraph now cancels only specific paragraph, not all other pending paragraphs.

API Changes

  • Interpreter.interpret(String) -> Interpreter.interpret(String, InterpreterContext)
  • Interpreter.cancel() -> Interpreter.cancel(InterpreterContext)
  • Interpreter.getProgress() -> Interpreter.getProgress(InterpreterContext)

There're thing to be improved, like editing interpreter setting, use radio box instead of drag and drop to make default interpreter when binding interpreter, etc.
But all proposed features are working well and we can address improvements with separate issues.

Ready to merge

@Leemoonsoo
Copy link
Contributor Author

About @haebin 's suggestion, i also agree on @swkimme that using the alternatives. %spark(name='spark-local')
But i want to handle that in separate issue, we can discuss more about it on mailing list.

@Leemoonsoo
Copy link
Contributor Author

If there're no further issues to discuss, i'm merging it.

@corneadoug
Copy link
Contributor

Go for it, but we should also create issues for the suggestions so that we don't forget about it

@anthonycorbacho
Copy link
Contributor

Just wait, There is some part in the rest api i want to talk about.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add swagger annotation for the documentation

@anthonycorbacho
Copy link
Contributor

@Leemoonsoo where are the tests for the rest api ?

@bzz
Copy link

bzz commented Jan 14, 2015

Great job @Leemoonsoo !
Looks good to me, except the conventions for REST API noted by @anthonycorbacho

@Leemoonsoo
Copy link
Contributor Author

@anthonycorbacho I've changed REST API convention and added basic rest API test.
Ready to merge.

@anthonycorbacho
Copy link
Contributor

@Leemoonsoo Looks better!!

Leemoonsoo added a commit that referenced this pull request Jan 27, 2015
Bind/Unbind interpreters to note
@Leemoonsoo Leemoonsoo merged commit 18ffaae into master Jan 27, 2015
epahomov pushed a commit to epahomov/zeppelin that referenced this pull request Jul 23, 2016
This makes it configurable to specify multiple origins as allowed (default only local origin is allowed). Wildcard origin will not be supported as it is a security vulnerability.
It adds a compatibility check in configuration for windows paths.
Upgrades servlet config to add httponly and secure which will secure session cookies if used.

Author: joelz <djoelz@gmail.com>
Author: djoelz <joelz@microsoft.com>

Closes ZEPL#235 from djoelz/master and squashes the following commits:

989f1e0 [joelz] Retrying build as it seems ZeppelinIT failed for not reason.
625b54e [joelz] Fixing unit test that reads from a file but initializes to a default value and hence the configuration is present.
e9d8384 [joelz] Retrying due to git download issue with build
2887f0d [joelz] Renaming tests to singular name so plugin can detect and run
9260d5d [joelz] Fixing adding the origin header for get and post tests.
b7bb7bf [joelz] Fixing Styling
b2b418a [joelz] Fixing cross origin bug for rest calls that allow a malicious user to issue requests from a site other than the zeppelin server. Adding unit tests and a dependency to mockito to the server project (please comment if that is ok or if there is another preferred mocking framework). Also upgrading the servelet version from 2.5 to 3.0 as this also fixes a security vulnerability with respect to httonly cookies.
4ae9129 [joelz] Fixing null reference
3795de7 [joelz] Fixing cross origin bug for rest calls that allow a malicious user to issue requests from a site other than the zeppelin server. Adding unit tests and a dependency to mockito to the server project (please comment if that is ok or if there is another preferred mocking framework). Also upgrading the servelet version from 2.5 to 3.0 as this also fixes a security vulnerability with respect to httonly cookies.
bcb1ac1 [joelz] Fixing cross origin bug for rest calls that allow a malicious user to issue requests from a site other than the zeppelin server. Adding unit tests and a dependency to mockito to the server project (please comment if that is ok or if there is another preferred mocking framework). Also upgrading the servelet version from 2.5 to 3.0 as this also fixes a security vulnerability with respect to httonly cookies.
3d6ce2e [joelz] Fixing cross origin bug for rest calls that allow a malicious user to issue requests from a site other than the zeppelin server. Adding unit tests and a dependency to mockito to the server project (please comment if that is ok or if there is another preferred mocking framework). Also upgrading the servelet version from 2.5 to 3.0 as this also fixes a security vulnerability with respect to httonly cookies.
1f851c0 [joelz] Fixing cross origin bug for rest calls that allow a malicious user to issue requests from a site other than the zeppelin server. Adding unit tests and a dependency to mockito to the server project (please comment if that is ok or if there is another preferred mocking framework). Also upgrading the servelet version from 2.5 to 3.0 as this also fixes a security vulnerability with respect to httonly cookies.
7ecf7e9 [joelz] Merge branch 'master' of https://github.com/djoelz/incubator-zeppelin
faa6204 [joelz] Merge branch 'apache-master'
52eb1bd [joelz] Merge branch 'master' of https://github.com/apache/incubator-zeppelin into apache-master
5ff1a47 [joelz] Merge branch 'masterOrigin'
47902a6 [joelz] Fixing cross origin bug for rest calls that allow a malicious user to issue requests from a site other than the zeppelin server. Adding unit tests and a dependency to mockito to the server project (please comment if that is ok or if there is another preferred mocking framework). Also upgrading the servelet version from 2.5 to 3.0 as this also fixes a security vulnerability with respect to httonly cookies.
a00adc2 [djoelz] Merge pull request ZEPL#1 from apache/master
df324de [joelz] Fixing cross origin bug for rest calls that allow a malicious user to issue requests from a site other than the zeppelin server. Adding unit tests and a dependency to mockito to the server project (please comment if that is ok or if there is another preferred mocking framework). Also upgrading the servelet version from 2.5 to 3.0 as this also fixes a security vulnerability with respect to httonly cookies.
cecbab8 [joelz] Fixing cross origin bug for rest calls that allow a malicious user to issue requests from a site other than the zeppelin server. Adding unit tests and a dependency to mockito to the server project (please comment if that is ok or if there is another preferred mocking framework). Also upgrading the servelet version from 2.5 to 3.0 as this also fixes a security vulnerability with respect to httonly cookies.
61e857d [joelz] Fixing Rest request lack of Origin validation bug, Added tests that use Mockito (unit test framework) and forces the servlet to use version 3.0 instead of 2.5
08ff369 [djoelz] unecessary file
013f22d [joelz] Fixing issue with ZEPPELIN-173: Zeppelin websocket server is vulnerable to Cross-Site WebSocket Hijacking
ea54b55 [joelz] Fixing issue with ZEPPELIN-173: Zeppelin websocket server is vulnerable to Cross-Site WebSocket Hijacking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants